summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 1f282f79ac85..40f7c9e25c81 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -130,6 +130,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 266b63ad57d4..13c1a8c72478 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1455,6 +1455,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);