summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfexport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-05-09 09:10:24 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-09 13:51:29 +0200
commit3a9854a92923df8013ca832c48aa9f284bcb1adc (patch)
tree92ed195d12e40ba8b4ece1216eb878a0263853dd /sw/qa/extras/rtfexport
parent5e062501eb6c3abe5219777fd9267702689785c7 (diff)
tdf#107620 RTF export: handle DocumentSettingId::PARA_SPACE_MAX compat setting
As it turns out it has a dedicated RTF control word. With this, the bugdoc is again kept as a one-page document during DOCX -> RTF conversion. If we are at it, also write the automatic before/after paragraph spacing markup. Change-Id: I78de644f0631e59ef507dfaa07c5a812d4ef10cd
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf107620.docxbin0 -> 12654 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx11
2 files changed, 11 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 0eccf65dd748..87e86c198612 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1193,6 +1193,17 @@ DECLARE_RTFEXPORT_TEST(testHyperlinkTarget, "hyperlink-target.rtf")
CPPUNIT_ASSERT_EQUAL(OUString("_blank"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkTarget"));
}
+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: */