summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Arato (NISZ) <arato.daniel@nisz.hu>2021-06-16 10:39:29 +0200
committerLászló Németh <nemeth@numbertext.org>2021-07-20 16:19:37 +0200
commit6128e2d55f0d0c68d3c7f6fb69539ec800637947 (patch)
treeab23736e337f28f1fdc8103552f21ba2e621ca11
parent427d4b30a66bade5a9f3b0da337e1644f5dd7c8a (diff)
tdf#142763 sc UI: add first page header/footer options
Add checkbox "Same content on first page" checkbox (similar to the existing "Same content on left and right pages) to the Page Style dialog window, on the Header and Footer panes. Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388 (tdf#121715 XLSX: support custom first page header/footer) and commit 52beb3907dd3c7e6ae112e263def1005272cecd8 (tdf#142764 sc: import "Same content on first/left page"). Note: to set different header or footer on the first page of the spreadsheet, disable "Same content on first page" on Format->Page Style...->Header (or Footer), and choose the "Edit..." button. Change-Id: I3348fde216424b8d2c662956eab27cbe5880fc1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117316 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sc/UIConfig_scalc.mk4
-rw-r--r--sc/inc/scres.hrc8
-rw-r--r--sc/qa/uitest/calc_tests9/tdf142763.py69
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx12
-rw-r--r--sc/source/ui/inc/hfedtdlg.hxx42
-rw-r--r--sc/source/ui/inc/scuitphfedit.hxx14
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.cxx90
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx26
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx28
-rw-r--r--sc/uiconfig/scalc/ui/footerdialog.ui46
-rw-r--r--sc/uiconfig/scalc/ui/headerdialog.ui46
-rw-r--r--sc/uiconfig/scalc/ui/sharedfirstfooterdialog.ui209
-rw-r--r--sc/uiconfig/scalc/ui/sharedfirstheaderdialog.ui209
-rw-r--r--sc/uiconfig/scalc/ui/sharedleftfooterdialog.ui205
-rw-r--r--sc/uiconfig/scalc/ui/sharedleftheaderdialog.ui205
-rw-r--r--svx/source/dialog/hdft.cxx16
16 files changed, 1202 insertions, 27 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index e19172e49bd3..c7ddfa38f88f 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -217,6 +217,10 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/selectsource \
sc/uiconfig/scalc/ui/sheetprintpage \
sc/uiconfig/scalc/ui/sharedocumentdlg \
+ sc/uiconfig/scalc/ui/sharedfirstfooterdialog \
+ sc/uiconfig/scalc/ui/sharedfirstheaderdialog \
+ sc/uiconfig/scalc/ui/sharedleftfooterdialog \
+ sc/uiconfig/scalc/ui/sharedleftheaderdialog \
sc/uiconfig/scalc/ui/sharedfooterdialog \
sc/uiconfig/scalc/ui/sharedheaderdialog \
sc/uiconfig/scalc/ui/sharedwarningdialog \
diff --git a/sc/inc/scres.hrc b/sc/inc/scres.hrc
index 57ac75843530..8089d41258f0 100644
--- a/sc/inc/scres.hrc
+++ b/sc/inc/scres.hrc
@@ -39,8 +39,12 @@
#define RID_SCDLG_HFEDIT_RIGHTHEADER (SC_DIALOGS_START + 65)
#define RID_SCDLG_HFEDIT_LEFTFOOTER (SC_DIALOGS_START + 66)
#define RID_SCDLG_HFEDIT_RIGHTFOOTER (SC_DIALOGS_START + 67)
-#define RID_SCDLG_HFEDIT_HEADER (SC_DIALOGS_START + 68)
-#define RID_SCDLG_HFEDIT_FOOTER (SC_DIALOGS_START + 69)
+#define RID_SCDLG_HFEDIT_SHAREDFIRSTHEADER (SC_DIALOGS_START + 68)
+#define RID_SCDLG_HFEDIT_SHAREDLEFTHEADER (SC_DIALOGS_START + 69)
+#define RID_SCDLG_HFEDIT_SHAREDFIRSTFOOTER (SC_DIALOGS_START + 70)
+#define RID_SCDLG_HFEDIT_SHAREDLEFTFOOTER (SC_DIALOGS_START + 71)
+#define RID_SCDLG_HFEDIT_HEADER (SC_DIALOGS_START + 72)
+#define RID_SCDLG_HFEDIT_FOOTER (SC_DIALOGS_START + 73)
#define WID_CONDFRMT_REF (SC_DIALOGS_START + 163)
diff --git a/sc/qa/uitest/calc_tests9/tdf142763.py b/sc/qa/uitest/calc_tests9/tdf142763.py
new file mode 100644
index 000000000000..5808dd1df624
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf142763.py
@@ -0,0 +1,69 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import get_cell_by_position
+import time
+
+class Tdf142763(UITestCase):
+
+ def test_tdf142763_header(self):
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ with self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog") as xPageFormatDialog:
+ xTabControl = xPageFormatDialog.getChild("tabcontrol")
+ select_pos(xTabControl, "4")
+
+ xHeaderOnBtn = xPageFormatDialog.getChild("checkHeaderOn")
+ xHeaderOnBtn.executeAction("CLICK", tuple())
+ xFirstHeaderSameBtn = xPageFormatDialog.getChild("checkSameFP")
+ xFirstHeaderSameBtn.executeAction("CLICK", tuple())
+
+ with self.ui_test.execute_dialog_through_command(".uno:EditHeaderAndFooter") as xHeaderDialog:
+ xLeftTextWindow = xHeaderDialog.getChild("textviewWND_LEFT")
+ xLeftTextWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "first"}))
+ xCenterTextWindow = xHeaderDialog.getChild("textviewWND_CENTER")
+ xCenterTextWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "page | "}))
+ xRightTextWindow = xHeaderDialog.getChild("textviewWND_RIGHT")
+ xRightTextWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "header"}))
+
+ self.assertEqual("first", get_state_as_dict(xLeftTextWindow)["Text"])
+ self.assertEqual("page | Sheet1", get_state_as_dict(xCenterTextWindow)["Text"])
+ self.assertEqual("header", get_state_as_dict(xRightTextWindow)["Text"])
+
+ def test_tdf142763_footer(self):
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ with self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog") as xPageFormatDialog:
+ xTabControl = xPageFormatDialog.getChild("tabcontrol")
+ select_pos(xTabControl, "5")
+
+ xFooterOnBtn = xPageFormatDialog.getChild("checkFooterOn")
+ xFooterOnBtn.executeAction("CLICK", tuple())
+ xFirstFooterSameBtn = xPageFormatDialog.getChild("checkSameFP")
+ xFirstFooterSameBtn.executeAction("CLICK", tuple())
+
+ with self.ui_test.execute_dialog_through_command(".uno:EditHeaderAndFooter") as xFooterDialog:
+ xLeftTextWindow = xFooterDialog.getChild("textviewWND_LEFT")
+ xLeftTextWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "first"}))
+ xCenterTextWindow = xFooterDialog.getChild("textviewWND_CENTER")
+ xCenterTextWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "page | "}))
+ xRightTextWindow = xFooterDialog.getChild("textviewWND_RIGHT")
+ xRightTextWindow.executeAction("TYPE", mkPropertyValues({"TEXT": "footer"}))
+
+ self.assertEqual("first", get_state_as_dict(xLeftTextWindow)["Text"])
+ self.assertEqual("page | Sheet1", get_state_as_dict(xCenterTextWindow)["Text"])
+ self.assertEqual("footer", get_state_as_dict(xRightTextWindow)["Text"])
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 14e4f6920e2f..9fbfccaa4d38 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1232,6 +1232,18 @@ VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScHFEditDlg( we
case RID_SCDLG_HFEDIT_FOOTER:
xDlg = std::make_shared<ScHFEditFooterDlg>(pParent, rCoreSet, rPageStyle);
break;
+ case RID_SCDLG_HFEDIT_SHAREDFIRSTHEADER:
+ xDlg = std::make_shared<ScHFEditSharedFirstHeaderDlg>(pParent, rCoreSet, rPageStyle);
+ break;
+ case RID_SCDLG_HFEDIT_SHAREDLEFTHEADER:
+ xDlg = std::make_shared<ScHFEditSharedLeftHeaderDlg>(pParent, rCoreSet, rPageStyle);
+ break;
+ case RID_SCDLG_HFEDIT_SHAREDFIRSTFOOTER:
+ xDlg = std::make_shared<ScHFEditSharedFirstFooterDlg>(pParent, rCoreSet, rPageStyle);
+ break;
+ case RID_SCDLG_HFEDIT_SHAREDLEFTFOOTER:
+ xDlg = std::make_shared<ScHFEditSharedLeftFooterDlg>(pParent, rCoreSet, rPageStyle);
+ break;
case RID_SCDLG_HFEDIT_LEFTHEADER:
xDlg = std::make_shared<ScHFEditLeftHeaderDlg>(pParent, rCoreSet, rPageStyle);
break;
diff --git a/sc/source/ui/inc/hfedtdlg.hxx b/sc/source/ui/inc/hfedtdlg.hxx
index dba0cf346126..61d02f9c6f5c 100644
--- a/sc/source/ui/inc/hfedtdlg.hxx
+++ b/sc/source/ui/inc/hfedtdlg.hxx
@@ -51,6 +51,41 @@ public:
const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
};
+class ScHFEditSharedFirstHeaderDlg : public ScHFEditDlg
+{
+public:
+ ScHFEditSharedFirstHeaderDlg(weld::Window* pParent,
+ const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
+};
+
+class ScHFEditSharedFirstFooterDlg : public ScHFEditDlg
+{
+public:
+ ScHFEditSharedFirstFooterDlg(weld::Window* pParent,
+ const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
+};
+
+class ScHFEditSharedLeftHeaderDlg : public ScHFEditDlg
+{
+public:
+ ScHFEditSharedLeftHeaderDlg(weld::Window* pParent,
+ const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
+};
+
+class ScHFEditSharedLeftFooterDlg : public ScHFEditDlg
+{
+public:
+ ScHFEditSharedLeftFooterDlg(weld::Window* pParent,
+ const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
+};
+
+class ScHFEditFirstHeaderDlg : public ScHFEditDlg
+{
+public:
+ ScHFEditFirstHeaderDlg(weld::Window* pParent,
+ const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
+};
+
class ScHFEditLeftHeaderDlg : public ScHFEditDlg
{
public:
@@ -65,6 +100,13 @@ public:
const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
};
+class ScHFEditFirstFooterDlg : public ScHFEditDlg
+{
+public:
+ ScHFEditFirstFooterDlg(weld::Window* pParent,
+ const SfxItemSet& rCoreSet, std::u16string_view rPageStyle);
+};
+
class ScHFEditLeftFooterDlg : public ScHFEditDlg
{
public:
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index 6b06b27ff509..4d84365f85d6 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -113,6 +113,13 @@ private:
DECL_LINK( MenuHdl, const OString&, void );
};
+class ScFirstHeaderEditPage : public ScHFEditPage
+{
+public:
+ static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet );
+ ScFirstHeaderEditPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet );
+};
+
class ScRightHeaderEditPage : public ScHFEditPage
{
public:
@@ -127,6 +134,13 @@ public:
ScLeftHeaderEditPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet );
};
+class ScFirstFooterEditPage : public ScHFEditPage
+{
+public:
+ static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet );
+ ScFirstFooterEditPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet );
+};
+
class ScRightFooterEditPage : public ScHFEditPage
{
public:
diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx
index 3bda901ed0fc..820115749880 100644
--- a/sc/source/ui/pagedlg/hfedtdlg.cxx
+++ b/sc/source/ui/pagedlg/hfedtdlg.cxx
@@ -51,23 +51,79 @@ ScHFEditHeaderDlg::ScHFEditHeaderDlg(
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
"modules/scalc/ui/headerdialog.ui", "HeaderDialog")
{
+ AddTabPage("headerfirst", ScFirstHeaderEditPage::Create, nullptr);
AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr);
AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr);
}
ScHFEditFooterDlg::ScHFEditFooterDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
"modules/scalc/ui/footerdialog.ui", "FooterDialog" )
{
+ AddTabPage("footerfirst", ScFirstFooterEditPage::Create, nullptr);
AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr);
AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr);
}
+ScHFEditSharedFirstHeaderDlg::ScHFEditSharedFirstHeaderDlg(
+ weld::Window* pParent,
+ const SfxItemSet& rCoreSet,
+ std::u16string_view rPageStyle)
+ : ScHFEditDlg( pParent, rCoreSet, rPageStyle,
+ "modules/scalc/ui/sharedfirstheaderdialog.ui", "SharedFirstHeaderDialog" )
+{
+ AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr);
+ AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr);
+}
+
+ScHFEditSharedFirstFooterDlg::ScHFEditSharedFirstFooterDlg(
+ weld::Window* pParent,
+ const SfxItemSet& rCoreSet,
+ std::u16string_view rPageStyle)
+ : ScHFEditDlg( pParent, rCoreSet, rPageStyle,
+ "modules/scalc/ui/sharedfirstfooterdialog.ui", "SharedFirstFooterDialog" )
+{
+ AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr);
+ AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr);
+}
+
+ScHFEditSharedLeftHeaderDlg::ScHFEditSharedLeftHeaderDlg(
+ weld::Window* pParent,
+ const SfxItemSet& rCoreSet,
+ std::u16string_view rPageStyle)
+ : ScHFEditDlg( pParent, rCoreSet, rPageStyle,
+ "modules/scalc/ui/sharedleftheaderdialog.ui", "SharedLeftHeaderDialog" )
+{
+ AddTabPage("headerfirst", ScFirstHeaderEditPage::Create, nullptr);
+ AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr);
+}
+
+ScHFEditSharedLeftFooterDlg::ScHFEditSharedLeftFooterDlg(
+ weld::Window* pParent,
+ const SfxItemSet& rCoreSet,
+ std::u16string_view rPageStyle)
+ : ScHFEditDlg( pParent, rCoreSet, rPageStyle,
+ "modules/scalc/ui/sharedleftfooterdialog.ui", "SharedLeftFooterDialog" )
+{
+ AddTabPage("footerfirst", ScFirstFooterEditPage::Create, nullptr);
+ AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr);
+}
+
+ScHFEditFirstHeaderDlg::ScHFEditFirstHeaderDlg(
+ weld::Window* pParent,
+ const SfxItemSet& rCoreSet,
+ std::u16string_view rPageStyle)
+ : ScHFEditDlg( pParent, rCoreSet, rPageStyle,
+ "modules/scalc/ui/firstheaderdialog.ui", "FirstHeaderDialog" )
+{
+ AddTabPage("headerfirst", ScFirstHeaderEditPage::Create, nullptr);
+}
+
ScHFEditLeftHeaderDlg::ScHFEditLeftHeaderDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
@@ -77,7 +133,7 @@ ScHFEditLeftHeaderDlg::ScHFEditLeftHeaderDlg(
}
ScHFEditRightHeaderDlg::ScHFEditRightHeaderDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
@@ -86,8 +142,18 @@ ScHFEditRightHeaderDlg::ScHFEditRightHeaderDlg(
AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr);
}
+ScHFEditFirstFooterDlg::ScHFEditFirstFooterDlg(
+ weld::Window* pParent,
+ const SfxItemSet& rCoreSet,
+ std::u16string_view rPageStyle)
+ : ScHFEditDlg( pParent, rCoreSet, rPageStyle,
+ "modules/scalc/ui/firstfooterdialog.ui", "FirstFooterDialog" )
+{
+ AddTabPage("footerfirst", ScFirstFooterEditPage::Create, nullptr);
+}
+
ScHFEditLeftFooterDlg::ScHFEditLeftFooterDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
@@ -97,7 +163,7 @@ ScHFEditLeftFooterDlg::ScHFEditLeftFooterDlg(
}
ScHFEditRightFooterDlg::ScHFEditRightFooterDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
@@ -107,44 +173,50 @@ ScHFEditRightFooterDlg::ScHFEditRightFooterDlg(
}
ScHFEditSharedHeaderDlg::ScHFEditSharedHeaderDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
"modules/scalc/ui/sharedheaderdialog.ui", "SharedHeaderDialog" )
{
+ AddTabPage("headerfirst", ScFirstHeaderEditPage::Create, nullptr);
AddTabPage("header", ScRightHeaderEditPage::Create, nullptr);
+ AddTabPage("footerfirst", ScFirstFooterEditPage::Create, nullptr);
AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr);
AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr);
}
ScHFEditSharedFooterDlg::ScHFEditSharedFooterDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
"modules/scalc/ui/sharedfooterdialog.ui", "SharedFooterDialog" )
{
+ AddTabPage("headerfirst", ScFirstFooterEditPage::Create, nullptr);
AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr);
AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr);
+ AddTabPage("footerfirst", ScFirstFooterEditPage::Create, nullptr);
AddTabPage("footer", ScRightFooterEditPage::Create, nullptr);
}
ScHFEditAllDlg::ScHFEditAllDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
"modules/scalc/ui/allheaderfooterdialog.ui", "AllHeaderFooterDialog" )
{
+ AddTabPage("headerfirst", ScFirstHeaderEditPage::Create, nullptr);
AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr);
AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr);
+ AddTabPage("footerfirst", ScFirstFooterEditPage::Create, nullptr);
AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr);
AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr);
}
ScHFEditActiveDlg::ScHFEditActiveDlg(
- weld::Window* pParent,
+ weld::Window* pParent,
const SfxItemSet& rCoreSet,
std::u16string_view rPageStyle)
: ScHFEditDlg( pParent, rCoreSet, rPageStyle,
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index cb100995f112..38d5fae13e83 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -778,6 +778,19 @@ IMPL_LINK(ScHFEditPage, MenuHdl, const OString&, rSelectedId, void)
}
+ScFirstHeaderEditPage::ScFirstHeaderEditPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet )
+ : ScHFEditPage( pPage, pController,
+ rCoreSet,
+ rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_HEADERFIRST ),
+ true )
+ {}
+
+std::unique_ptr<SfxTabPage> ScFirstHeaderEditPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet )
+{
+ return std::make_unique<ScFirstHeaderEditPage>( pPage, pController, *rCoreSet );
+}
+
+
ScRightHeaderEditPage::ScRightHeaderEditPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet )
: ScHFEditPage( pPage, pController,
rCoreSet,
@@ -804,6 +817,19 @@ std::unique_ptr<SfxTabPage> ScLeftHeaderEditPage::Create( weld::Container* pPage
}
+ScFirstFooterEditPage::ScFirstFooterEditPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet )
+ : ScHFEditPage( pPage, pController,
+ rCoreSet,
+ rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_FOOTERFIRST ),
+ false )
+ {}
+
+std::unique_ptr<SfxTabPage> ScFirstFooterEditPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rCoreSet )
+{
+ return std::make_unique<ScFirstFooterEditPage>( pPage, pController, *rCoreSet );
+}
+
+
ScRightFooterEditPage::ScRightFooterEditPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet )
: ScHFEditPage( pPage, pController,
rCoreSet,
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index bc4457870c76..cdf4802af3e9 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -150,11 +150,31 @@ IMPL_LINK_NOARG(ScHFPage, BtnHdl, weld::Button&, void)
return;
}
- if (m_xCntSharedBox->get_sensitive() && !m_xCntSharedBox->get_active())
+ if ( (m_xCntSharedBox->get_sensitive() && !m_xCntSharedBox->get_active()) ||
+ (m_xCntSharedFirstBox->get_sensitive() && !m_xCntSharedFirstBox->get_active()) )
{
- sal_uInt16 nResId = ( nId == SID_ATTR_PAGE_HEADERSET )
- ? RID_SCDLG_HFED_HEADER
- : RID_SCDLG_HFED_FOOTER;
+ sal_uInt16 nResId;
+
+ if ( m_xCntSharedBox->get_sensitive() && !m_xCntSharedBox->get_active() &&
+ m_xCntSharedFirstBox->get_sensitive() && !m_xCntSharedFirstBox->get_active() )
+ {
+ nResId = ( nId == SID_ATTR_PAGE_HEADERSET )
+ ? RID_SCDLG_HFED_HEADER
+ : RID_SCDLG_HFED_FOOTER;
+ }
+ else if (m_xCntSharedBox->get_sensitive() && !m_xCntSharedBox->get_active())
+ {
+ nResId = ( nId == SID_ATTR_PAGE_HEADERSET )
+ ? RID_SCDLG_HFEDIT_SHAREDFIRSTHEADER
+ : RID_SCDLG_HFEDIT_SHAREDFIRSTFOOTER;
+ }
+ else
+ {
+ OSL_ENSURE( m_xCntSharedFirstBox->get_sensitive() && !m_xCntSharedFirstBox->get_active(), "This should be logically impossible." );
+ nResId = ( nId == SID_ATTR_PAGE_HEADERSET )
+ ? RID_SCDLG_HFEDIT_SHAREDLEFTHEADER
+ : RID_SCDLG_HFEDIT_SHAREDLEFTFOOTER;
+ }
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
diff --git a/sc/uiconfig/scalc/ui/footerdialog.ui b/sc/uiconfig/scalc/ui/footerdialog.ui
index af7abe28b6c9..4d009c4cc9b7 100644
--- a/sc/uiconfig/scalc/ui/footerdialog.ui
+++ b/sc/uiconfig/scalc/ui/footerdialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.0 -->
<interface domain="sc">
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="FooterDialog">
@@ -133,6 +133,50 @@
</object>
</child>
<child type="tab">
+ <object class="GtkLabel" id="footerfirst">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="footerdialog|footerfirst">Footer (first)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
<object class="GtkLabel" id="footerright">
<property name="visible">True</property>
<property name="can_focus">False</property>
diff --git a/sc/uiconfig/scalc/ui/headerdialog.ui b/sc/uiconfig/scalc/ui/headerdialog.ui
index df5624b990c6..d5668c12d29b 100644
--- a/sc/uiconfig/scalc/ui/headerdialog.ui
+++ b/sc/uiconfig/scalc/ui/headerdialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.0 -->
<interface domain="sc">
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="HeaderDialog">
@@ -133,6 +133,50 @@
</object>
</child>
<child type="tab">
+ <object class="GtkLabel" id="headerfirst">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="headerdialog|headerfirst">Header (first)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
<object class="GtkLabel" id="headerright">
<property name="visible">True</property>
<property name="can_focus">False</property>
diff --git a/sc/uiconfig/scalc/ui/sharedfirstfooterdialog.ui b/sc/uiconfig/scalc/ui/sharedfirstfooterdialog.ui
new file mode 100644
index 000000000000..dd716a7f8a8d
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/sharedfirstfooterdialog.ui
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.0 -->
+<interface domain="sc">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="SharedFirstFooterDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes" context="sharedfirstfooterdialog|SharedFirstFooterDialog">Footers</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="reset">
+ <property name="label" translatable="yes" context="stock">_Reset</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes" context="stock">_OK</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes" context="stock">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label" translatable="yes" context="stock">_Help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="tabcontrol">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="scrollable">True</property>
+ <property name="enable_popup">True</property>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="footerright">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedfirstfooterdialog|footerright">Footer (right)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="footerleft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedfirstfooterdialog|footerleft">Footer (left)</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="100">reset</action-widget>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-11">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/sharedfirstheaderdialog.ui b/sc/uiconfig/scalc/ui/sharedfirstheaderdialog.ui
new file mode 100644
index 000000000000..1d23a12f320a
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/sharedfirstheaderdialog.ui
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.0 -->
+<interface domain="sc">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="SharedFirstHeaderDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes" context="sharedfirstheaderdialog|SharedFirstHeaderDialog">Headers</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="reset">
+ <property name="label" translatable="yes" context="stock">_Reset</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes" context="stock">_OK</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes" context="stock">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label" translatable="yes" context="stock">_Help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="tabcontrol">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="scrollable">True</property>
+ <property name="enable_popup">True</property>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="headerright">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedfirstheaderdialog|headerright">Header (right)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="headerleft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedfirstheaderdialog|headerleft">Header (left)</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="100">reset</action-widget>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-11">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/sharedleftfooterdialog.ui b/sc/uiconfig/scalc/ui/sharedleftfooterdialog.ui
new file mode 100644
index 000000000000..3875e35eaaa5
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/sharedleftfooterdialog.ui
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.0 -->
+<interface domain="sc">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="SharedLeftFooterDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes" context="sharedleftfooterdialog|SharedLeftFooterDialog">Footers</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="reset">
+ <property name="label" translatable="yes" context="stock">_Reset</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes" context="stock">_OK</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes" context="stock">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label" translatable="yes" context="stock">_Help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="tabcontrol">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="scrollable">True</property>
+ <property name="enable_popup">True</property>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="footerfirst">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedleftfooterdialog|footerfirst">Footer (first)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="footerright">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedleftfooterdialog|footerright">Footer (rest)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="100">reset</action-widget>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-11">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/sharedleftheaderdialog.ui b/sc/uiconfig/scalc/ui/sharedleftheaderdialog.ui
new file mode 100644
index 000000000000..305767acebcb
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/sharedleftheaderdialog.ui
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.0 -->
+<interface domain="sc">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="SharedLeftHeaderDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes" context="sharedleftheaderdialog|SharedLeftHeaderDialog">Headers</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="reset">
+ <property name="label" translatable="yes" context="stock">_Reset</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes" context="stock">_OK</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes" context="stock">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label" translatable="yes" context="stock">_Help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="tabcontrol">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="scrollable">True</property>
+ <property name="enable_popup">True</property>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="headerfirst">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedleftheaderdialog|headerfirst">Header (first)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=1 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="headerright">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="sharedleftheaderdialog|headerright">Header (rest)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="100">reset</action-widget>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-11">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 9ab8f6b9dcdd..40956cdc6572 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -324,14 +324,6 @@ void SvxHFPage::Reset( const SfxItemSet* rSet )
DBG_ASSERT( pPool, "Where is the pool" );
MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_PAGE_SIZE ) );
- //hide "same content on first page when this is calc
- bool bIsCalc = false;
- const SfxPoolItem* pExt1 = GetItem(*rSet, SID_ATTR_PAGE_EXT1);
- const SfxPoolItem* pExt2 = GetItem(*rSet, SID_ATTR_PAGE_EXT2);
- if (dynamic_cast<const SfxBoolItem*>(pExt1) && dynamic_cast<const SfxBoolItem*>(pExt2) )
- bIsCalc = true;
- m_xCntSharedFirstBox->set_visible(!bIsCalc);
-
// Evaluate header-/footer- attributes
const SvxSetItem* pSetItem = nullptr;
@@ -384,14 +376,18 @@ void SvxHFPage::Reset( const SfxItemSet* rSet )
m_xCntSharedBox->set_active(rShared.GetValue());
if (pSharedFirst)
m_xCntSharedFirstBox->set_active(pSharedFirst->GetValue());
- else
- m_xCntSharedFirstBox->hide();
}
else
pSetItem = nullptr;
}
else
{
+ bool bIsCalc = false;
+ const SfxPoolItem* pExt1 = GetItem(*rSet, SID_ATTR_PAGE_EXT1);
+ const SfxPoolItem* pExt2 = GetItem(*rSet, SID_ATTR_PAGE_EXT2);
+ if (dynamic_cast<const SfxBoolItem*>(pExt1) && dynamic_cast<const SfxBoolItem*>(pExt2) )
+ bIsCalc = true;
+
// defaults for distance and height
tools::Long nDefaultDist = bIsCalc ? DEF_DIST_CALC : DEF_DIST_WRITER;
SetMetricValue( *m_xDistEdit, nDefaultDist, MapUnit::Map100thMM );