summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-03-04 13:33:40 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-03-04 15:41:18 +0100
commitdc05428405fb96f28b2d7c7bcfa9033f3f5248a3 (patch)
treeabba33b5f4427c0d4265e29ce378f6a152a09a9a
parenta33484276ed16af7599a59653677f21f051c97e8 (diff)
sw padded numbering: add RTF export
RTF import was working already. Change-Id: Ifa71035645d4738138790e72c3f9dee640833d0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89963 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
-rw-r--r--sw/qa/extras/rtfexport/data/arabic-zero-numbering.rtf14
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx13
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx3
3 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/arabic-zero-numbering.rtf b/sw/qa/extras/rtfexport/data/arabic-zero-numbering.rtf
new file mode 100644
index 000000000000..0969ba9088ca
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/arabic-zero-numbering.rtf
@@ -0,0 +1,14 @@
+{\rtf1
+{\*\listtable
+{\list
+{\listlevel\levelnfc22\levelstartat1
+{\leveltext\'02\'00.;}
+{\levelnumbers\'01;}
+}
+\listid0}
+}
+{\*\listoverridetable
+{\listoverride\listid0\ls1}
+}
+\pard\plain\ls1 A\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index a6b501f3f683..51390e001a51 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -143,6 +143,19 @@ DECLARE_RTFEXPORT_TEST(testTdf115180, "tdf115180.docx")
CPPUNIT_ASSERT_MESSAGE("Second cell width", cell2Width >= 218 && cell2Width <= 220);
}
+DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.rtf")
+{
+ auto xNumberingRules
+ = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules");
+ comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0));
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 64
+ // - Actual : 4
+ // i.e. numbering type was ARABIC, not ARABIC_ZERO.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO),
+ aMap["NumberingType"].get<sal_uInt16>());
+}
+
DECLARE_RTFEXPORT_TEST(testTdf116841, "tdf116841.rtf")
{
// This was 0, left margin was ignored as we assumed the default is already
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 36b03f6a0d94..fd1bb3656e3a 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1488,6 +1488,9 @@ void RtfAttributeOutput::NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart,
case SVX_NUM_NUMBER_NONE:
nVal = 255;
break;
+ case SVX_NUM_ARABIC_ZERO:
+ nVal = 22;
+ break;
}
m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVELNFC);
m_rExport.OutULong(nVal);