diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-07-10 12:12:55 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-07-10 13:31:37 +0200 |
commit | 8422d1f5042de08e8b090a907889b41e133bda40 (patch) | |
tree | 1c3b06d0b765b36495b0dcb86a6e7c6742f234e5 /sw/qa/extras/rtfexport | |
parent | 4721fbbccdb582449ac938fe36d01685cd650f1d (diff) |
fdo#66682 RTF export: fix level text of SVX_NUM_ARABIC
Even if level text is not ASCII, we should just write the placeholder
values (0x00, 0x01, etc.) in a hex encoded form, without Unicode.
Regression from 07d01742c69f1c0335bc7e1b57abd8341ce255e7.
Also, fix the import side, so the previous bad output now looks bad in
Writer as well.
Change-Id: I2f93892006c07eec243ec7dfcb23372d243a2db4
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo66682.rtf | 25 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 21 |
2 files changed, 46 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/fdo66682.rtf b/sw/qa/extras/rtfexport/data/fdo66682.rtf new file mode 100644 index 000000000000..76128a2f722c --- /dev/null +++ b/sw/qa/extras/rtfexport/data/fdo66682.rtf @@ -0,0 +1,25 @@ +{\rtf1\ansi\deff4\adeflang1025 +{\*\listtable +{\list\listtemplateid1 +{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0 +{\leveltext \'03 \'00 ;} +{\levelnumbers\'02;} +\fi-360\li720} +\listid1} +} +{\listoverridetable +{\listoverride\listid1\listoverridecount0\ls1} +} +\pard\plain \s0\sb0\sa113\nowidctlpar +\ilvl0\ls1 \li720\ri0\lin720\rin0\fi-360 +{\rtlch \ltrch\loch +This should be 1} +\par \pard\plain \s0\sb0\sa113\nowidctlpar +\ilvl0\ls1 \li720\ri0\lin720\rin0\fi-360 +{\rtlch \ltrch\loch +and 2} +\par \pard\plain \s0\sb0\sa113\nowidctlpar +\ilvl0\ls1 \li720\ri0\lin720\rin0\fi-360\sb0\sa113 +{\rtlch \ltrch\loch +and 3} +\par } diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 0249426e2d8b..48db195cf4d1 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -66,6 +66,7 @@ public: void testTextframeGradient(); void testRecordChanges(); void testTextframeTable(); + void testFdo66682(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -121,6 +122,7 @@ void Test::run() {"textframe-gradient.rtf", &Test::testTextframeGradient}, {"record-changes.rtf", &Test::testRecordChanges}, {"textframe-table.rtf", &Test::testTextframeTable}, + {"fdo66682.rtf", &Test::testFdo66682}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -607,6 +609,25 @@ void Test::testTextframeTable() CPPUNIT_ASSERT_EQUAL(OUString("Last para."), getParagraphOfText(3, xText)->getString()); } +void Test::testFdo66682() +{ + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + OUString aSuffix; + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + + if (rProp.Name == "Suffix") + aSuffix = rProp.Value.get<OUString>(); + } + // Suffix was '\0' instead of ' '. + CPPUNIT_ASSERT_EQUAL(OUString(" "), aSuffix); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |