diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-03-31 08:03:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-03-31 09:53:16 +0200 |
commit | c088d26578d1be352efa49bd164a8217627648de (patch) | |
tree | 636da07fe60a990968a94f7ad0c69936a0e260d7 /sw/source/core | |
parent | a182e9ce5e0da3cc98603ed27819405812d7fab1 (diff) |
tdf#140343 sw page rtl gutter margin: add layout
We used to get the gutter margin on the left side and the right gutter
margin on the right side, which works for normal and mirrored layout.
Swap these two in RTL mode.
Change-Id: Ibe866c2d971ce72e94fab5d5c71040ab62ffbe93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113395
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index e1c7eee5148e..7abc46270bfa 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2271,9 +2271,11 @@ tools::Long SwBorderAttrs::CalcRight( const SwFrame* pCaller ) const DocumentSettingId::GUTTER_AT_TOP); if (!bGutterAtTop) { + bool bRtlGutter = pPageFrame->GetAttrSet()->GetItem<SfxBoolItem>(RES_RTL_GUTTER)->GetValue(); + tools::Long nGutterMargin = bRtlGutter ? m_rLR->GetGutterMargin() : m_rLR->GetRightGutterMargin(); // Decrease the print area: the right space is the sum of right and right gutter // margins. - nRight += m_rLR->GetRightGutterMargin(); + nRight += nGutterMargin; } } @@ -2349,8 +2351,10 @@ tools::Long SwBorderAttrs::CalcLeft( const SwFrame *pCaller ) const DocumentSettingId::GUTTER_AT_TOP); if (!bGutterAtTop) { + bool bRtlGutter = pPageFrame->GetAttrSet()->GetItem<SfxBoolItem>(RES_RTL_GUTTER)->GetValue(); + tools::Long nGutterMargin = bRtlGutter ? m_rLR->GetRightGutterMargin() : m_rLR->GetGutterMargin(); // Decrease the print area: the left space is the sum of left and gutter margins. - nLeft += m_rLR->GetGutterMargin(); + nLeft += nGutterMargin; } } |