summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfexport/data/tab-stop-fill-chars.rtf14
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx23
-rw-r--r--writerfilter/source/rtftok/rtfdispatchflag.cxx7
3 files changed, 39 insertions, 5 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);
diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index 32de52c40b32..c8f65d57369f 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -150,14 +150,11 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
nParam = NS_ooxml::LN_Value_ST_TabTlc_hyphen;
break;
case RTF_TLUL:
+ case RTF_TLTH:
nParam = NS_ooxml::LN_Value_ST_TabTlc_underscore;
break;
- case RTF_TLTH:
- nParam = NS_ooxml::LN_Value_ST_TabTlc_hyphen;
- break; // thick line is not supported by dmapper, this is just a hack
case RTF_TLEQ:
- nParam = NS_ooxml::LN_Value_ST_TabTlc_none;
- break; // equal sign isn't, either
+ break;
default:
break;
}