summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-03-01 17:38:03 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-03-01 17:53:57 +0100
commit58c30a3545a5725d704eabd79071db02f1f2cb23 (patch)
tree55f6e1d68b7d09a497ee382ef585d3cbd658562e /sw
parent2f82a08d3565239c2bfe8d21fbebd89bd4657708 (diff)
fdo#59638 handle RTF_F inside RTF_LISTLEVEL
Word typically uses the Symbol font to describe bullet characters instead of using a sane Unicode value, the previous can only be handled if we parse the custom font set for the list. Change-Id: I1491f07c40953949e381a035c1596c207cdc4c35
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo59638.rtf35
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx25
2 files changed, 60 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo59638.rtf b/sw/qa/extras/rtfimport/data/fdo59638.rtf
new file mode 100644
index 000000000000..e2572bf008e3
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo59638.rtf
@@ -0,0 +1,35 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0
+{\fonttbl
+{\f0\fbidi \froman\fcharset238\fprq2
+Times New Roman;}
+{\f2\fbidi \fmodern\fcharset238\fprq1
+Courier New;}
+{\f3\fbidi \froman\fcharset2\fprq2
+Symbol;}
+}
+{\*\listtable
+{\list\listtemplateid-1784933330\listsimple
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0
+{\leveltext\'01*;}
+{\levelnumbers;}
+\hres0\chhres0 }
+{\listname ;}
+\listid-2}
+}
+{\*\listoverridetable
+{\listoverride\listid-2\listoverridecount1
+{\lfolevel\listoverrideformat
+{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelold\levelspace0
+\levelindent0
+{\leveltext\'01\u-3913 ?;}
+{\levelnumbers;}
+\f3\fbias0 }
+}
+\ls1}
+}
+\pard\plain \ltrpar\ql \fi-360\li720\ri0\nowidctlpar\wrapdefault
+\faauto\ls1\rin0\lin720\itap0\pararsid7241016 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1031\langfe1031\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1031\langfenp1031
+{\rtlch\fcs1 \af37 \ltrch\fcs0
+\f37\insrsid15285686 \hich\af37\dbch\af31505\loch\f37 3
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index f923762cae2a..e577f4269f15 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -143,6 +143,7 @@ public:
void testFdo59419();
void testFdo58076_2();
void testFdo59953();
+ void testFdo59638();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -258,6 +259,7 @@ void Test::run()
{"fdo59419.rtf", &Test::testFdo59419},
{"fdo58076-2.rtf", &Test::testFdo58076_2},
{"fdo59953.rtf", &Test::testFdo59953},
+ {"fdo59638.rtf", &Test::testFdo59638},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1120,6 +1122,29 @@ void Test::testFdo59953()
CPPUNIT_ASSERT_EQUAL(sal_Int16(7650), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position);
}
+void Test::testFdo59638()
+{
+ // The problem was that w:lvlOverride inside w:num was ignores by dmapper.
+
+ 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
+
+ for (int i = 0; i < aProps.getLength(); ++i)
+ {
+ const beans::PropertyValue& rProp = aProps[i];
+
+ if (rProp.Name == "BulletChar")
+ {
+ // Was '*', should be 'o'.
+ CPPUNIT_ASSERT_EQUAL(OUString("\xEF\x82\xB7", 3, RTL_TEXTENCODING_UTF8), rProp.Value.get<OUString>());
+ return;
+ }
+ }
+ CPPUNIT_FAIL("no BulletChar property");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();