summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfexport/data/gutter-left.rtf4
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx15
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx5
-rw-r--r--writerfilter/source/rtftok/rtfdispatchvalue.cxx5
4 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/gutter-left.rtf b/sw/qa/extras/rtfexport/data/gutter-left.rtf
new file mode 100644
index 000000000000..66016045c9d1
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/gutter-left.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter720
+\pard\plain Half in gutter on the left\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index cf9a25e40d7c..2bfdf0a13c87 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -385,6 +385,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126309)
static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
}
+CPPUNIT_TEST_FIXTURE(Test, testGutterLeft)
+{
+ load(mpTestDocumentPath, "gutter-left.rtf");
+ reload(mpFilter, "gutter-left.rtf");
+ uno::Reference<beans::XPropertySet> xPageStyle;
+ getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+ sal_Int32 nGutterMargin{};
+ xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1270
+ // - Actual : 0
+ // i.e. gutter margin was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 3f39c585a0ab..79f88ab22ba0 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3163,6 +3163,11 @@ void RtfAttributeOutput::FormatLRSpace(const SvxLRSpaceItem& rLRSpace)
m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGRSXN);
m_aSectionBreaks.append(static_cast<sal_Int32>(rLRSpace.GetRight()));
}
+ if (rLRSpace.GetGutterMargin())
+ {
+ m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_GUTTER);
+ m_aSectionBreaks.append(static_cast<sal_Int32>(rLRSpace.GetGutterMargin()));
+ }
if (!m_bBufferSectionBreaks)
m_rExport.Strm().WriteOString(m_aSectionBreaks.makeStringAndClear());
}
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index 930c613c9750..f9198baafb12 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -1375,6 +1375,11 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_footer,
pIntValue);
break;
+ case RTF_GUTTER:
+ putNestedAttribute(m_aStates.top().getSectionSprms(),
+ NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_gutter,
+ pIntValue);
+ break;
case RTF_DEFTAB:
m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_defaultTabStop, pIntValue);
break;