diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index be39d69bec7e..95ce424689f6 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -695,7 +695,7 @@ class SvxZoomItem; #define FN_NOUPDATE TypedWhichId(FN_PARAM+67) #define FN_FAX (SID_SW_START + 28) /* Fax */ -#define SID_KEYFUNC_START (SID_SC_START + 521) +#define SID_KEYFUNC_START (SID_SC_START + 525) #define SID_CURSORDOWN_SEL (SID_KEYFUNC_START + 0) #define SID_CURSORUP_SEL (SID_KEYFUNC_START + 1) #define SID_CURSORLEFT_SEL (SID_KEYFUNC_START + 2) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index bf0f30a5f2a8..baec0e299257 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -2665,6 +2665,38 @@ 1 + + + Grid Lines + + + Print grid lines + + + + + Col/Row Header + + + Print column and row header + + + + + Comments + + + Print comments + + + + + Zero Values + + + Print zero values + + diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 6e4e6020ae03..8c196db2a58f 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -476,7 +476,11 @@ class SvxZoomSliderItem; #define SID_PREVIEW_CLOSE (SID_PREVIEW_START+7) #define SID_PREVIEW_MARGIN (SID_PREVIEW_START+8) #define SID_PREVIEW_SCALINGFACTOR TypedWhichId(SID_PREVIEW_START+9) -#define SID_PREVIEW_END (SID_PREVIEW_START+10) +#define SID_TOGGLEPRINTGRID (SID_PREVIEW_START+10) +#define SID_TOGGLEPRINTCOLROWHEADER (SID_PREVIEW_START+11) +#define SID_TOGGLEPRINTCOMMENTS (SID_PREVIEW_START+12) +#define SID_TOGGLEPRINTZEROVALUES (SID_PREVIEW_START+13) +#define SID_PREVIEW_END (SID_PREVIEW_START+14) // with SID_KEYFUNC_START defined in include/sfx2/sfxsids.hrc there is a risk of // adding entries that cause an overlap here diff --git a/sc/sdi/prevwsh.sdi b/sc/sdi/prevwsh.sdi index 58cba8eaf47a..3c237c3446cf 100644 --- a/sc/sdi/prevwsh.sdi +++ b/sc/sdi/prevwsh.sdi @@ -129,6 +129,11 @@ interface TablePrintPreview SID_PREVIEW_CLOSE [ ExecMethod = Execute; StateMethod = GetState; ] SID_CANCEL [ ExecMethod = Execute; StateMethod = GetState; ] + SID_TOGGLEPRINTGRID [ ExecMethod = Execute; StateMethod = GetState; ] + SID_TOGGLEPRINTCOLROWHEADER [ ExecMethod = Execute; StateMethod = GetState; ] + SID_TOGGLEPRINTCOMMENTS [ ExecMethod = Execute; StateMethod = GetState; ] + SID_TOGGLEPRINTZEROVALUES [ ExecMethod = Execute; StateMethod = GetState; ] + SID_SAVEDOC [ StateMethod = GetState; ] SID_SAVEASDOC [ StateMethod = GetState; ] SID_MAIL_SENDDOC [ StateMethod = GetState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 35c2e19f91b8..53fd8374050a 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -7008,3 +7008,71 @@ SfxVoidItem CopyDelete SID_COPYDELETE ToolBoxConfig = TRUE, GroupId = SfxGroupId::Edit; ] + +SfxBoolItem TogglePrintGrid SID_TOGGLEPRINTGRID +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] + +SfxBoolItem TogglePrintColRowHeader SID_TOGGLEPRINTCOLROWHEADER +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] + +SfxBoolItem TogglePrintComments SID_TOGGLEPRINTCOMMENTS +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] + +SfxBoolItem TogglePrintZeroValues SID_TOGGLEPRINTZEROVALUES +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 285bc11d01f1..df84d38eab7e 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -913,6 +913,10 @@ void ScPreview::StaticInvalidate() rBindings.Invalidate(SID_ZOOM_OUT); rBindings.Invalidate(SID_PREVIEW_SCALINGFACTOR); rBindings.Invalidate(SID_ATTR_ZOOMSLIDER); + rBindings.Invalidate(SID_TOGGLEPRINTGRID); + rBindings.Invalidate(SID_TOGGLEPRINTCOLROWHEADER); + rBindings.Invalidate(SID_TOGGLEPRINTCOMMENTS); + rBindings.Invalidate(SID_TOGGLEPRINTZEROVALUES); } IMPL_STATIC_LINK_NOARG( ScPreview, InvalidateHdl, void*, void ) diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 1af4c22399bc..5eb25ba65650 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -750,6 +750,43 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) ScViewUtil::SetFullScreen( *this, false ); break; + case SID_TOGGLEPRINTGRID: + case SID_TOGGLEPRINTCOLROWHEADER: + case SID_TOGGLEPRINTCOMMENTS: + case SID_TOGGLEPRINTZEROVALUES: + { + OUString sStyle = pDocShell->GetDocument().GetPageStyle(pPreview->GetTab()); + ScStyleSheetPool* pStylePool = pDocShell->GetDocument().GetStyleSheetPool(); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find(sStyle, SfxStyleFamily::Page); + OSL_ENSURE(pStyleSheet, "PageStyle not found! :-/"); + + SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); + bool bOn; + switch (nSlot) + { + case SID_TOGGLEPRINTGRID: + bOn = rItemSet.Get(ATTR_PAGE_GRID).GetValue(); + rItemSet.Put(SfxBoolItem(ATTR_PAGE_GRID, !bOn)); + break; + case SID_TOGGLEPRINTCOLROWHEADER: + bOn = rItemSet.Get(ATTR_PAGE_HEADERS).GetValue(); + rItemSet.Put(SfxBoolItem(ATTR_PAGE_HEADERS, !bOn)); + break; + case SID_TOGGLEPRINTCOMMENTS: + bOn = rItemSet.Get(ATTR_PAGE_NOTES).GetValue(); + rItemSet.Put(SfxBoolItem(ATTR_PAGE_NOTES, !bOn)); + break; + case SID_TOGGLEPRINTZEROVALUES: + bOn = rItemSet.Get(ATTR_PAGE_NULLVALS).GetValue(); + rItemSet.Put(SfxBoolItem(ATTR_PAGE_NULLVALS, !bOn)); + break; + } + rReq.Done(); + GetViewFrame().GetBindings().Invalidate(nSlot); + pPreview->Invalidate(); + } + break; + default: break; } @@ -856,6 +893,42 @@ void ScPreviewShell::GetState( SfxItemSet& rSet ) if( pDocShell->IsReadOnly() ) rSet.DisableItem( nWhich ); break; + + case SID_TOGGLEPRINTGRID: + case SID_TOGGLEPRINTCOLROWHEADER: + case SID_TOGGLEPRINTCOMMENTS: + case SID_TOGGLEPRINTZEROVALUES: + { + if (pDocShell->IsReadOnly()) + rSet.DisableItem(nWhich); + else + { + OUString sStyle = pDocShell->GetDocument().GetPageStyle(pPreview->GetTab()); + ScStyleSheetPool* pStylePool = pDocShell->GetDocument().GetStyleSheetPool(); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find(sStyle, SfxStyleFamily::Page); + OSL_ENSURE(pStyleSheet, "PageStyle not found! :-/"); + const SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); + + bool bOn = false; + switch (nWhich) + { + case SID_TOGGLEPRINTGRID: + bOn = rItemSet.Get(ATTR_PAGE_GRID).GetValue(); + break; + case SID_TOGGLEPRINTCOLROWHEADER: + bOn = rItemSet.Get(ATTR_PAGE_HEADERS).GetValue(); + break; + case SID_TOGGLEPRINTCOMMENTS: + bOn = rItemSet.Get(ATTR_PAGE_NOTES).GetValue(); + break; + case SID_TOGGLEPRINTZEROVALUES: + bOn = rItemSet.Get(ATTR_PAGE_NULLVALS).GetValue(); + break; + } + rSet.Put(SfxBoolItem(nWhich, bOn)); + } + } + break; } nWhich = aIter.NextWhich(); diff --git a/sc/uiconfig/scalc/ui/notebookbar.ui b/sc/uiconfig/scalc/ui/notebookbar.ui index b091b11e1fb6..9b4ce7211946 100644 --- a/sc/uiconfig/scalc/ui/notebookbar.ui +++ b/sc/uiconfig/scalc/ui/notebookbar.ui @@ -12212,12 +12212,12 @@ - + True False 3 - 6 + 3 6 6 3 @@ -12240,7 +12240,7 @@ 0 2 - 2 + 3 @@ -12253,7 +12253,7 @@ vertical - 2 + 3 0 3 @@ -12266,9 +12266,11 @@ True both False + 3 True + False .uno:Print @@ -12284,17 +12286,18 @@ - + True False center True - both + both-horiz False - + True - .uno:ClosePreview + False + .uno:TogglePrintGrid False @@ -12305,7 +12308,81 @@ 1 0 - 2 + + + + + True + False + center + True + both-horiz + False + + + True + False + .uno:TogglePrintColRowHeader + + + False + True + + + + + 1 + 1 + + + + + True + False + center + True + both-horiz + False + + + True + False + .uno:TogglePrintComments + + + False + True + + + + + 2 + 0 + + + + + True + False + center + True + both-horiz + False + + + True + False + .uno:TogglePrintZeroValues + + + False + True + + + + + 2 + 1 @@ -12318,6 +12395,89 @@ 2 + + + + True + False + 3 + 6 + 6 + 6 + 3 + 3 + + + True + False + end + 5 + 5 + vertical + + + 1 + 0 + 3 + + + + + True + False + center + True + both + False + 3 + + + True + False + .uno:ClosePreview + + + False + True + + + + + 0 + 0 + 2 + + + + + True + False + end + True + + + + + + + + + + + 0 + 2 + + + + + + + + False + True + 3 + + True diff --git a/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr index ab64de064c4a..69936c084cf1 100644 --- a/solenv/sanitizers/ui/modules/scalc.suppr +++ b/solenv/sanitizers/ui/modules/scalc.suppr @@ -756,3 +756,7 @@ sc/uiconfig/scalc/ui/notebookbar.ui://GtkMenuToolButton[@id='btnDrawExtrusionSur sc/uiconfig/scalc/ui/notebookbar.ui://GtkMenuToolButton[@id='btnObjectXLineStyle'] button-no-label sc/uiconfig/scalc/ui/notebookbar.ui://GtkMenuToolButton[@id='btnMediaAnchorMenu'] button-no-label sc/uiconfig/scalc/ui/notebookbar.ui://GtkToolButton[@id='btnToolsAutoCorrectDlg'] button-no-label +sc/uiconfig/scalc/ui/notebookbar.ui://GtkToolButton[@id='btnTogglePrintGrid'] button-no-label +sc/uiconfig/scalc/ui/notebookbar.ui://GtkToolButton[@id='btnTogglePrintComment'] button-no-label +sc/uiconfig/scalc/ui/notebookbar.ui://GtkToolButton[@id='btnTogglePrintColRowHeader'] button-no-label +sc/uiconfig/scalc/ui/notebookbar.ui://GtkToolButton[@id='btnTogglePrintZeroValues'] button-no-label