diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-05 09:10:39 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-09 17:09:19 +0100 |
commit | c5b0c15f56f3a74612b4808c7ec699c46d7f1e98 (patch) | |
tree | 184de6ae48df2bd8c1ebdd26f5f454effd7a4c25 /sw/source/core/layout/paintfrm.cxx | |
parent | 9cf6612438a478da3c42de2a2fb83d4b5fdc626e (diff) |
tdf#91920 sw page gutter margin, from top: add layout
Take the new doc setting into account and if it's true, then undo the
existing "increase left margin" logic, and do an "increase top margin"
one instead.
(cherry picked from commit 59e816faa2a2bc0b88c39f063c53e00a33f23722)
Conflicts:
sw/source/core/layout/paintfrm.cxx
Change-Id: I358a34790a52e2720ec23e6841d56e66858e28b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110640
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index da8731a400d1..6563256804f9 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1269,11 +1269,19 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrame *pFrame, if (pFrame->IsPageFrame() && rAttrs.GetLRSpace()) { long nGutterMargin = rAttrs.GetLRSpace()->GetGutterMargin(); - if (nGutterMargin) + const auto pPageFrame = static_cast<const SwPageFrame*>(pFrame); + bool bGutterAtTop = pPageFrame->GetFormat()->getIDocumentSettingAccess().get( + DocumentSettingId::GUTTER_AT_TOP); + if (nGutterMargin && !bGutterAtTop) { // Paint the left border based on the left margin, ignoring the gutter margin. (rRect.*fnRect->fnSubLeft)(nGutterMargin); } + else if (nGutterMargin) + { + // Paint the top border based on the top margin, ignoring the gutter margin. + (rRect.*fnRect->fnSubTop)(nGutterMargin); + } } const SvxBoxItem &rBox = rAttrs.GetBox(); |