summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-07-22 21:14:50 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-07-23 13:48:53 +0200
commit413956ae4c1e833d7ecb6e3695bcdec92533c2ce (patch)
tree843e54bc5435aa8f4e316ca71e724316e9e95e54 /sw
parent25cf4dad747c506ef7cd25f6aaffac627d8fd0f5 (diff)
RTF import: add tests for RTF_TLMDOT/HYPH/TH/EQ
lcov points out these were not covered previously. Also, Word maps TH to underline and EQ to nothing, so do the same. Change-Id: I994f78cbe1c6c2edec73edc8944f739e2a7cb8d8 Reviewed-on: https://gerrit.libreoffice.org/76144 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tab-stop-fill-chars.rtf14
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx23
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tab-stop-fill-chars.rtf b/sw/qa/extras/rtfexport/data/tab-stop-fill-chars.rtf
new file mode 100644
index 000000000000..f1fc4e8e2284
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tab-stop-fill-chars.rtf
@@ -0,0 +1,14 @@
+{\rtf1
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\tlmdot\tx2520\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1061119
+{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1061119 \tab \hich\af37\dbch\af37\loch\f37 tlmdot
+\par }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\tlhyph\tx2520\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1061119
+{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1061119 \tab \hich\af37\dbch\af37\loch\f37 tlhyph
+\par }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\tlth\tx2520\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1061119
+{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1061119 \tab \hich\af37\dbch\af37\loch\f37 tlth
+\par }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\tleq\tx2520\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1061119
+{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1061119 \tab \hich\af37\dbch\af37\loch\f37 tleq
+\par }
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index 0d86a00df960..6b75eda278fd 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -105,6 +105,29 @@ DECLARE_RTFEXPORT_TEST(testCjklist34, "cjklist34.rtf")
CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH_TW, numFormat);
}
+DECLARE_RTFIMPORT_TEST(testTabStopFillChars, "tab-stop-fill-chars.rtf")
+{
+ // tlmdot
+ auto aTabstops = getProperty<uno::Sequence<style::TabStop>>(getParagraph(1), "ParaTabStops");
+ CPPUNIT_ASSERT(aTabstops.hasElements());
+ CPPUNIT_ASSERT_EQUAL(u'·', aTabstops[0].FillChar);
+
+ // tlhyph
+ aTabstops = getProperty<uno::Sequence<style::TabStop>>(getParagraph(2), "ParaTabStops");
+ CPPUNIT_ASSERT(aTabstops.hasElements());
+ CPPUNIT_ASSERT_EQUAL(u'-', aTabstops[0].FillChar);
+
+ // tlth
+ aTabstops = getProperty<uno::Sequence<style::TabStop>>(getParagraph(3), "ParaTabStops");
+ CPPUNIT_ASSERT(aTabstops.hasElements());
+ CPPUNIT_ASSERT_EQUAL(u'_', aTabstops[0].FillChar);
+
+ // tleq
+ aTabstops = getProperty<uno::Sequence<style::TabStop>>(getParagraph(4), "ParaTabStops");
+ CPPUNIT_ASSERT(aTabstops.hasElements());
+ CPPUNIT_ASSERT_EQUAL(u' ', aTabstops[0].FillChar);
+}
+
DECLARE_RTFEXPORT_TEST(testCjklist38, "cjklist38.rtf")
{
sal_Int16 numFormat = getNumberingTypeOfParagraph(1);