diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf118047.rtf | 14 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport5.cxx | 15 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf118047.rtf b/sw/qa/extras/rtfexport/data/tdf118047.rtf new file mode 100644 index 000000000000..258d99de9bef --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf118047.rtf @@ -0,0 +1,14 @@ +{\rtf1\ansi
+
+{\stylesheet
+{\fs72\sa3200 Normal;}
+}
+
+\sectd
+{
+\headerr
+Header\par
+}
+
+Text\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 04c857ade582..c59448af2514 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -1348,6 +1348,21 @@ DECLARE_RTFEXPORT_TEST(testTdf131234, "tdf131234.rtf") CPPUNIT_ASSERT_EQUAL(awt::FontSlant_NONE, getProperty<awt::FontSlant>(xRun, "CharPosture")); } +DECLARE_RTFEXPORT_TEST(testTdf118047, "tdf118047.rtf") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + + // Ensure that default "Normal" style properties are not applied to text: + // text remains with fontsize 12pt and no huge margin below + CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(getRun(xPara, 1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); + + // Same for header, it should not derive props from "Normal" style + CPPUNIT_ASSERT_EQUAL(OUString("Header"), parseDump("/root/page[1]/header/txt/text()")); + sal_Int32 nHeight = parseDump("/root/page[1]/header/infos/bounds", "height").toInt32(); + CPPUNIT_ASSERT_MESSAGE("Header is too large", 1000 > nHeight); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |