summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-06-21 10:42:08 -0400
committerJustin Luth <jluth@mail.com>2024-07-03 16:44:26 +0200
commit433c4180acd5c5a699e71ab2f749713db36dc165 (patch)
tree1b9badb156ec7950d1681079d59d028f74bd1d6c /sw/source/ui
parent79a77bba092dce84f7fee3e72da9600ec2d1bd2b (diff)
tdf#161646 sw page number wizard: fit into existing margins
Often page numbers are inserted when a document is finished, and at that point it would be annoying to repaginate everything, so offer this option of trying to fit the page number into the existing margins. I was tempted to enable it by default, except that it would then mismatch any pages that had header/footers created via other methods. Problem: -how to know which font is really needed: western, CTL, CJK? This patch depends on NFC b7fce2b26ee4ba585544457adc742807a2129d2c Change-Id: I285a99f8e2f12c87a8bdee20a9c86a1d79f80dd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169349 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx5
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx1
-rw-r--r--sw/source/ui/misc/pagenumberdlg.cxx12
3 files changed, 16 insertions, 2 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 4e3d87ba0ff0..1c042afd38f0 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -779,6 +779,11 @@ bool AbstractSwPageNumberDlg_Impl::GetIncludePageTotal() const
return m_xDlg->GetIncludePageTotal();
}
+bool AbstractSwPageNumberDlg_Impl::GetFitIntoExistingMargins() const
+{
+ return m_xDlg->GetFitIntoExistingMargins();
+}
+
SvxNumType AbstractSwPageNumberDlg_Impl::GetPageNumberType() const
{
return m_xDlg->GetPageNumberType();
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index ae11902beedc..feb703e621e0 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -171,6 +171,7 @@ public:
virtual int GetPageNumberAlignment() const override;
bool GetMirrorOnEvenPages() const override;
bool GetIncludePageTotal() const override;
+ bool GetFitIntoExistingMargins() const override;
SvxNumType GetPageNumberType() const override;
void SetPageNumberType(SvxNumType nSet) override;
};
diff --git a/sw/source/ui/misc/pagenumberdlg.cxx b/sw/source/ui/misc/pagenumberdlg.cxx
index d812cfaee60f..bc3cadb701e8 100644
--- a/sw/source/ui/misc/pagenumberdlg.cxx
+++ b/sw/source/ui/misc/pagenumberdlg.cxx
@@ -34,6 +34,8 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent)
, m_xPageNumberAlignment(m_xBuilder->weld_combo_box(u"alignmentCombo"_ustr))
, m_xMirrorOnEvenPages(m_xBuilder->weld_check_button(u"mirrorCheckbox"_ustr))
, m_xIncludePageTotal(m_xBuilder->weld_check_button(u"pagetotalCheckbox"_ustr))
+ , m_xFitIntoExistingMargins(
+ m_xBuilder->weld_check_button(u"fitintoexistingmarginsCheckbox"_ustr))
, m_xPageNumberTypeLB(new SvxPageNumberListBox(m_xBuilder->weld_combo_box(u"numfmtlb"_ustr)))
, m_xPreviewImage(m_xBuilder->weld_image(u"previewImage"_ustr))
, m_aPageNumberPosition(1) // bottom
@@ -48,6 +50,7 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent)
m_xMirrorOnEvenPages->set_sensitive(false);
m_xMirrorOnEvenPages->set_state(TRISTATE_TRUE);
m_xIncludePageTotal->set_state(TRISTATE_FALSE);
+ m_xFitIntoExistingMargins->set_state(TRISTATE_FALSE);
SvxNumOptionsTabPageHelper::GetI18nNumbering(m_xPageNumberTypeLB->get_widget(),
::std::numeric_limits<sal_uInt16>::max());
m_xPageNumberTypeLB->connect_changed(LINK(this, SwPageNumberDlg, NumberTypeSelectHdl));
@@ -84,17 +87,22 @@ IMPL_LINK_NOARG(SwPageNumberDlg, IncludePageTotalChangeHdl, weld::Toggleable&, v
updateImage();
}
-bool SwPageNumberDlg::GetMirrorOnEvenPages()
+bool SwPageNumberDlg::GetMirrorOnEvenPages() const
{
return m_xMirrorOnEvenPages->get_sensitive()
&& m_xMirrorOnEvenPages->get_state() == TRISTATE_TRUE;
}
-bool SwPageNumberDlg::GetIncludePageTotal()
+bool SwPageNumberDlg::GetIncludePageTotal() const
{
return m_xIncludePageTotal->get_state() == TRISTATE_TRUE;
}
+bool SwPageNumberDlg::GetFitIntoExistingMargins() const
+{
+ return m_xFitIntoExistingMargins->get_state() == TRISTATE_TRUE;
+}
+
void SwPageNumberDlg::SetPageNumberType(SvxNumType nSet)
{
m_nPageNumberType = nSet;