summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/paintfrm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r--sw/source/core/layout/paintfrm.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 6563256804f9..921699234913 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1269,19 +1269,28 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrame *pFrame,
if (pFrame->IsPageFrame() && rAttrs.GetLRSpace())
{
long nGutterMargin = rAttrs.GetLRSpace()->GetGutterMargin();
+ long nRightGutterMargin = rAttrs.GetLRSpace()->GetRightGutterMargin();
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)
+ if (bGutterAtTop)
{
// Paint the top border based on the top margin, ignoring the gutter margin.
(rRect.*fnRect->fnSubTop)(nGutterMargin);
}
+ else
+ {
+ if (nGutterMargin)
+ {
+ // Paint the left border based on the left margin, ignoring the gutter margin.
+ (rRect.*fnRect->fnSubLeft)(nGutterMargin);
+ }
+ if (nRightGutterMargin)
+ {
+ // Paint the right border based on the right margin, ignoring the gutter margin.
+ (rRect.*fnRect->fnAddRight)(nRightGutterMargin);
+ }
+ }
}
const SvxBoxItem &rBox = rAttrs.GetBox();