diff options
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo68787.rtf (renamed from sw/qa/extras/rtfimport/data/fdo68787.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 7 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.hxx | 1 |
5 files changed, 22 insertions, 7 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo68787.rtf b/sw/qa/extras/rtfexport/data/fdo68787.rtf index 4c8a68f1db8e..4c8a68f1db8e 100644 --- a/sw/qa/extras/rtfimport/data/fdo68787.rtf +++ b/sw/qa/extras/rtfexport/data/fdo68787.rtf diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index b6084cbed641..40cc51f5001e 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -579,6 +579,13 @@ DECLARE_RTFEXPORT_TEST(testFdo66743, "fdo66743.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(0xd8d8d8), getProperty<sal_Int32>(xCell, "BackColor")); } +DECLARE_RTFEXPORT_TEST(testFdo68787, "fdo68787.rtf") +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); + // This was 0, the 'lack of \chftnsep' <-> '0 line width' mapping was missing in the RTF tokenizer / exporter. + CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 0ad517738405..a5ab93d3df15 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1405,13 +1405,6 @@ DECLARE_RTFIMPORT_TEST(testBackground, "background.rtf") CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(getShape(2), "Opaque"))); } -DECLARE_RTFIMPORT_TEST(testFdo68787, "fdo68787.rtf") -{ - uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); - // This was 0, the 'lack of \chftnsep' <-> '0 line width' mapping was missing in the RTF tokenizer. - CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth")); -} - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 5113f931f9a6..59f55d975772 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -382,6 +382,18 @@ void RtfExport::WriteStyles() SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); } +void RtfExport::WriteFootnoteSettings() +{ + const SwPageFtnInfo& rFtnInfo = pDoc->GetPageDesc(0).GetFtnInfo(); + // Request a separator only in case the width is larger than zero. + bool bSeparator = double(rFtnInfo.GetWidth()) > 0; + + Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_FTNSEP; + if (bSeparator) + Strm() << OOO_STRING_SVTOOLS_RTF_CHFTNSEP; + Strm() << '}'; +} + void RtfExport::WriteMainText() { SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); @@ -696,6 +708,8 @@ void RtfExport::ExportDocument_Impl() Strm() << SAL_NEWLINE_STRING; + WriteFootnoteSettings(); + WriteMainText(); Strm() << '}'; diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 9e30cf3465bd..7e429af2d2ac 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -173,6 +173,7 @@ private: void WriteFonts(); void WriteStyles(); + void WriteFootnoteSettings(); void WriteMainText(); void WriteInfo(); /// Writes the writer-specific \pgdsctbl group. |