summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/paintfrm.cxx27
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx9
2 files changed, 9 insertions, 27 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index ef69c5ff81ba..b3c940b87cea 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1289,33 +1289,6 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrame *pFrame,
SwRectFn fnRect = pFrame->IsVertical() ? ( pFrame->IsVertLR() ? (pFrame->IsVertLRBT() ? fnRectVertL2RB2T : fnRectVertL2R) : fnRectVert ) : fnRectHori;
- if (pFrame->IsPageFrame() && rAttrs.GetLRSpace())
- {
- tools::Long nGutterMargin = rAttrs.GetLRSpace()->GetGutterMargin();
- tools::Long nRightGutterMargin = rAttrs.GetLRSpace()->GetRightGutterMargin();
- const auto pPageFrame = static_cast<const SwPageFrame*>(pFrame);
- bool bGutterAtTop = pPageFrame->GetFormat()->getIDocumentSettingAccess().get(
- DocumentSettingId::GUTTER_AT_TOP);
- 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();
const bool bTop = 0 != (pFrame->*fnRect->fnGetTopMargin)();
if ( bTop )
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b5a793ec196f..67d6aa748df4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6743,6 +6743,15 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrameFormat* pFormat, cons
if (aGlue.HasFooter())
aMargins.nBottom = aGlue.dyaHdrBottom;
+ if (pFormat->GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP))
+ {
+ aMargins.nTop += pFormat->GetLRSpace().GetGutterMargin();
+ }
+ else
+ {
+ aMargins.nLeft += pFormat->GetLRSpace().GetGutterMargin();
+ }
+
aOutputBorderOptions.pDistances = std::make_shared<editeng::WordBorderDistances>();
editeng::BorderDistancesToWord(rBox, aMargins, *aOutputBorderOptions.pDistances);