Resolves tdf#131478 - Add printing options to Calc's Tabbed UI

Change-Id: Ib17f06fb63c3fe9c05f368f4bd4ec9f718691e83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209027
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
This commit is contained in:
Heiko Tietze
2026-08-07 17:04:37 +02:00
committed by Heiko Tietze
parent 29a105a3e9
commit bf86d12913
9 changed files with 361 additions and 11 deletions
+1 -1
View File
@@ -695,7 +695,7 @@ class SvxZoomItem;
#define FN_NOUPDATE TypedWhichId<SfxBoolItem>(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)
@@ -2665,6 +2665,38 @@
<value>1</value>
</prop>
</node>
<node oor:name=".uno:TogglePrintGrid" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Grid Lines</value>
</prop>
<prop oor:name="TooltipLabel" oor:type="xs:string">
<value xml:lang="en-US">Print grid lines</value>
</prop>
</node>
<node oor:name=".uno:TogglePrintColRowHeader" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Col/Row Header</value>
</prop>
<prop oor:name="TooltipLabel" oor:type="xs:string">
<value xml:lang="en-US">Print column and row header</value>
</prop>
</node>
<node oor:name=".uno:TogglePrintComments" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Comments</value>
</prop>
<prop oor:name="TooltipLabel" oor:type="xs:string">
<value xml:lang="en-US">Print comments</value>
</prop>
</node>
<node oor:name=".uno:TogglePrintZeroValues" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Zero Values</value>
</prop>
<prop oor:name="TooltipLabel" oor:type="xs:string">
<value xml:lang="en-US">Print zero values</value>
</prop>
</node>
</node>
<node oor:name="Popups">
<node oor:name=".uno:InsertFieldMenu" oor:op="replace">
+5 -1
View File
@@ -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<SvxZoomSliderItem>(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
+5
View File
@@ -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; ]
+68
View File
@@ -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;
]
+4
View File
@@ -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 )
+73
View File
@@ -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();
+169 -9
View File
@@ -12212,12 +12212,12 @@
</packing>
</child>
<child>
<!-- n-columns=3 n-rows=3 -->
<!-- n-columns=4 n-rows=3 -->
<object class="GtkGrid" id="gdPrintPrint">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">3</property>
<property name="margin-end">6</property>
<property name="margin-end">3</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="row-spacing">3</property>
@@ -12240,7 +12240,7 @@
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
<property name="width">2</property>
<property name="width">3</property>
</packing>
</child>
<child>
@@ -12253,7 +12253,7 @@
<property name="orientation">vertical</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="left-attach">3</property>
<property name="top-attach">0</property>
<property name="height">3</property>
</packing>
@@ -12266,9 +12266,11 @@
<property name="vexpand">True</property>
<property name="toolbar-style">both</property>
<property name="show-arrow">False</property>
<property name="icon_size">3</property>
<child>
<object class="GtkToolButton" id="btnPrintPrint">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action-name">.uno:Print</property>
</object>
<packing>
@@ -12284,17 +12286,18 @@
</packing>
</child>
<child>
<object class="sfxlo-NotebookbarToolBox" id="bxPrintClosePreview">
<object class="sfxlo-NotebookbarToolBox" id="bxPrintGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
<property name="toolbar-style">both</property>
<property name="toolbar-style">both-horiz</property>
<property name="show-arrow">False</property>
<child>
<object class="GtkToolButton" id="btnPrintClosePreview">
<object class="GtkToolButton" id="btnTogglePrintGrid">
<property name="visible">True</property>
<property name="action-name">.uno:ClosePreview</property>
<property name="can-focus">False</property>
<property name="action-name">.uno:TogglePrintGrid</property>
</object>
<packing>
<property name="expand">False</property>
@@ -12305,7 +12308,81 @@
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="sfxlo-NotebookbarToolBox" id="bxPrintColRowHeader">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
<property name="toolbar-style">both-horiz</property>
<property name="show-arrow">False</property>
<child>
<object class="GtkToolButton" id="btnTogglePrintColRowHeader">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action-name">.uno:TogglePrintColRowHeader</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="sfxlo-NotebookbarToolBox" id="bxPrintComment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
<property name="toolbar-style">both-horiz</property>
<property name="show-arrow">False</property>
<child>
<object class="GtkToolButton" id="btnTogglePrintComment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action-name">.uno:TogglePrintComments</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="sfxlo-NotebookbarToolBox" id="bxPrintZeroValues">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
<property name="toolbar-style">both-horiz</property>
<property name="show-arrow">False</property>
<child>
<object class="GtkToolButton" id="btnTogglePrintZeroValues">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action-name">.uno:TogglePrintZeroValues</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">1</property>
</packing>
</child>
<accessibility>
@@ -12318,6 +12395,89 @@
<property name="position">2</property>
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=3 -->
<object class="GtkGrid" id="gdPrintClose">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">3</property>
<property name="margin-end">6</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="row-spacing">3</property>
<property name="column-spacing">3</property>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="sfxlo-NotebookbarToolBox" id="bxPrintClosePreview">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
<property name="toolbar-style">both</property>
<property name="show-arrow">False</property>
<property name="icon_size">3</property>
<child>
<object class="GtkToolButton" id="btnPrintClosePreview">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="action-name">.uno:ClosePreview</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbPrintClose">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">end</property>
<property name="vexpand">True</property>
<property name="label" translatable="no" context="TabbedCalc|lbPrintClose"></property>
<attributes>
<attribute name="style" value="italic"/>
<attribute name="scale" value="0.9"/>
</attributes>
<accessibility>
<relation type="label-for" target="gdPrintClose"/>
</accessibility>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<accessibility>
<relation type="labelled-by" target="lbPrintClose"/>
</accessibility>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
+4
View File
@@ -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