diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-28 10:52:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-28 11:42:46 +0200 |
commit | b669d85de9c933553ae57a9f51902bce7f9da9b5 (patch) | |
tree | b04ba708a47030dd9dc46923611845e472a72361 /sw | |
parent | cc09a58ef3fd39db61369cf399de11360966d39e (diff) |
tdf#94456 RTF import: fix list vs paragraph style interaction wrt para indents
In case we set the paragraph left/right/first margin just to mimic the
list vs paragraph style interaction as Word wants it, never overwrite
properties, as they are always meant to be just callbacks in case there
is no real hard formatting.
Change-Id: Ibdb2834c693d43cf4114453e42628e8f64c0a856
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf94456.rtf | 23 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 10 |
2 files changed, 33 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf94456.rtf b/sw/qa/extras/rtfimport/data/tdf94456.rtf new file mode 100644 index 000000000000..075fb53e2715 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf94456.rtf @@ -0,0 +1,23 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\stylesheet +{\s0\snext0\nowidctlpar\hyphpar0\aspalpha\ltrpar\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang2055 Normal;} +{\s1\sbasedon15\snext16\ilvl0\outlinelevel0\sb240\sa120\keepn\b\dbch\af5\dbch\af6\afs36\ab\loch\f4\fs36 Heading 1;} +{\s15\sbasedon0\snext16\sb240\sa120\keepn\dbch\af5\dbch\af6\afs28\loch\f4\fs28 Heading;} +} +{\*\listtable +{\list\listtemplateid1 +{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2 +{\leveltext \'00;} +{\levelnumbers;} +\fi-432\li432} +\listid1} +} +{\listoverridetable +{\listoverride\listid1\listoverridecount0\ls1} +} +\pard\plain \s1\ilvl0\outlinelevel0\sb240\sa120\keepn\b\dbch\af5\dbch\af6\afs36\ab\loch\f4\fs36 +{\listtext\pard\plain \tab} +\ls1 \li432\ri0\lin432\rin0\fi-432\sb240\sa120 +{\rtlch \ltrch\loch +Heading} +\par} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 6aec7bf1a579..19802d95121b 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2345,6 +2345,16 @@ DECLARE_RTFIMPORT_TEST(testTdf92481, "tdf92481.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int8>(2), getProperty<sal_Int8>(getParagraph(1), "ParaWidows")); } +DECLARE_RTFIMPORT_TEST(testTdf94456, "tdf94456.rtf") +{ + // Paragraph left margin and first line indent wasn't imported correctly. + + // This was 1270. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(762), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); + // This was -635. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-762), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |