From d48a4174708ce0850577dba76dccaf85c4f6ffa1 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 1 Apr 2021 10:09:45 +0200 Subject: tdf#140343 sw page rtl gutter margin: add UI And extend SwFrame::UpdateAttrFrame() so that the layout is updated when the UI mutates the doc model. Change-Id: I4112388981187226f97ec39f4c44ffb3cc1e5253 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113440 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- cui/source/inc/page.hxx | 1 + cui/source/tabpages/page.cxx | 16 ++++++++++++++++ cui/uiconfig/ui/pageformatpage.ui | 16 +++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) (limited to 'cui') diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index 1d92d275d3a1..e3c5aa4ed268 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -125,6 +125,7 @@ private: std::unique_ptr m_xRegisterLB; std::unique_ptr m_xGutterPositionFT; std::unique_ptr m_xGutterPositionLB; + std::unique_ptr m_xRtlGutterCB; std::unique_ptr m_xBackgroundFullSizeCB; std::unique_ptr m_xInsideLbl; std::unique_ptr m_xOutsideLbl; diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 53dfe1e5cb5d..729aef82bbfd 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -179,6 +179,7 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController* , m_xRegisterLB(m_xBuilder->weld_combo_box("comboRegisterStyle")) , m_xGutterPositionFT(m_xBuilder->weld_label("labelGutterPosition")) , m_xGutterPositionLB(m_xBuilder->weld_combo_box("comboGutterPosition")) + , m_xRtlGutterCB(m_xBuilder->weld_check_button("checkRtlGutter")) , m_xBackgroundFullSizeCB(m_xBuilder->weld_check_button("checkBackgroundFullSize")) // Strings stored in UI , m_xInsideLbl(m_xBuilder->weld_label("labelInner")) @@ -383,6 +384,14 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // Left. m_xGutterPositionLB->set_active(0); } + it = rGrabBagItem.GetGrabBag().find("RtlGutter"); + bool bRtlGutter{}; + if (it != rGrabBagItem.GetGrabBag().end()) + { + it->second >>= bRtlGutter; + m_xRtlGutterCB->set_active(bRtlGutter); + m_xRtlGutterCB->show(); + } it = rGrabBagItem.GetGrabBag().find("BackgroundFullSize"); bool isBackgroundFullSize{}; if (it != rGrabBagItem.GetGrabBag().end()) @@ -572,6 +581,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) m_xHorzBox->save_state(); m_xAdaptBox->save_state(); m_xGutterPositionLB->save_value(); + m_xRtlGutterCB->save_state(); m_xBackgroundFullSizeCB->save_state(); CheckMarginEdits( true ); @@ -669,6 +679,12 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet ) aGrabBagItem.GetGrabBag()["GutterAtTop"] <<= bGutterAtTop; bModified = true; } + if (m_xRtlGutterCB->get_state_changed_from_saved()) + { + bool const bRtlGutter(m_xRtlGutterCB->get_active()); + aGrabBagItem.GetGrabBag()["RtlGutter"] <<= bRtlGutter; + bModified = true; + } if (m_xBackgroundFullSizeCB->get_state_changed_from_saved()) { bool const isBackgroundFullSize(m_xBackgroundFullSizeCB->get_active()); diff --git a/cui/uiconfig/ui/pageformatpage.ui b/cui/uiconfig/ui/pageformatpage.ui index b6974eebc15d..3a28c29409a5 100644 --- a/cui/uiconfig/ui/pageformatpage.ui +++ b/cui/uiconfig/ui/pageformatpage.ui @@ -706,6 +706,20 @@ + + + Gutter on right side of page + True + False + True + True + True + + + 1 + 8 + + Background covers margins @@ -723,7 +737,7 @@ 1 - 8 + 9 -- cgit