diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-06-13 23:49:59 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-06-17 18:42:06 +0200 |
commit | 6c0e1270889deb513f961f864dfc1c02ee8705f4 (patch) | |
tree | 3022b60ca3b2aedcfcb3b528efc88cc77b1c7f20 /sw | |
parent | 8ba3116a8f09650b47aa69cf3d828ca0b5f6b51e (diff) |
fdo#70578: writerfilter RTF import: by default style is para style 0
quoth the spec:
"For <style>, both <styledef> and <stylename> are optional; the default
is paragraph style 0."
Of course in order to do that we need to add support for at least
recognizing the \dsN and \tsN keywords to override the default, so that
table styles don't become paragraph styles.
Change-Id: Ic100768581f9e8c327063ff776fbd61ac4242483
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo70578.rtf | 11 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo70578.rtf b/sw/qa/extras/rtfimport/data/fdo70578.rtf new file mode 100644 index 000000000000..b2a4ea826a7d --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo70578.rtf @@ -0,0 +1,11 @@ +{\rtf1\ansi +{\fonttbl +{\f30\fswiss\fcharset0\fprq2{\*\panose 020b0706040902060204}Haettenschweiler;} +} +{\stylesheet +{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;} +{\s16\qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 +\f30\fs44\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext16 Subtitle;} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 2eba05aa0861..3699db8ded84 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1143,6 +1143,17 @@ DECLARE_RTFIMPORT_TEST(testFdo62044, "fdo62044.rtf") CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(xPropertySet, "CharHeight")); // Was 18, i.e. reset back to original value. } +DECLARE_RTFIMPORT_TEST(testFdo70578, "fdo70578.rtf") +{ + // Style without explicit \s0 was not imported as the default style + uno::Reference<beans::XPropertySet> xPropertySet( + getStyles("ParagraphStyles")->getByName("Subtitle"), uno::UNO_QUERY); + uno::Reference<style::XStyle> xStyle(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Standard"), xStyle->getParentStyle()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin")); +} + DECLARE_RTFIMPORT_TEST(testPoshPosv, "posh-posv.rtf") { CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(1), "HoriOrient")); |