summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf107620.docxbin0 -> 12654 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx11
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx5
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf107620.docx b/sw/qa/extras/rtfexport/data/tdf107620.docx
new file mode 100644
index 000000000000..285bd92ae670
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf107620.docx
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 19b3235a4cdc..003b5ef03bc5 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1136,6 +1136,17 @@ DECLARE_RTFEXPORT_TEST(testTdf104228, "tdf104228.rtf")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xParagraph, "ParaLeftMargin"));
}
+DECLARE_RTFEXPORT_TEST(testTdf107620, "tdf107620.docx")
+{
+ // This failed, RTF export didn't write the \htmautsp compat flag, the
+ // original bugdoc resulting in 2 pages instead of 1.
+ uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xSettings(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ bool bAddParaTableSpacing = true;
+ xSettings->getPropertyValue("AddParaTableSpacing") >>= bAddParaTableSpacing;
+ CPPUNIT_ASSERT(!bAddParaTableSpacing);
+}
+
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 edf7281984ef..c1143b3c5b6c 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -47,6 +47,7 @@
#include <svx/xflclit.hxx>
#include <editeng/hyphenzoneitem.hxx>
#include <fmtmeta.hxx>
+#include <IDocumentSettingAccess.hxx>
using namespace ::com::sun::star;
@@ -824,6 +825,10 @@ void RtfExport::ExportDocument_Impl()
Strm().WriteCharPtr(pOut);
}
+ if (!m_pDoc->getIDocumentSettingAccess().get(DocumentSettingId::PARA_SPACE_MAX))
+ // RTF default is true, so write compat flag if this should be false.
+ Strm().WriteCharPtr(LO_STRING_SVTOOLS_RTF_HTMAUTSP);
+
Strm().WriteCharPtr(SAL_NEWLINE_STRING);
WriteFootnoteSettings();