diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx | bin | 0 -> 5238 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/ConversionHelper.cxx | 4 |
4 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx b/sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx Binary files differnew file mode 100644 index 000000000000..6779d85989a9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 379ae540bb46..564511acc3d1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -134,6 +134,19 @@ DECLARE_ODFEXPORT_TEST(testArabicZero3Numbering, "arabic-zero3-numbering.docx") aMap["NumberingType"].get<sal_uInt16>()); } +DECLARE_ODFEXPORT_TEST(testArabicZero4Numbering, "arabic-zero4-numbering.docx") +{ + 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: 66 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO4. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO4), + aMap["NumberingType"].get<sal_uInt16>()); +} + CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote) { // Create a document, set footnote numbering type to ARABIC_ZERO. diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index fafd5c5d189b..569a62fc2fd2 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6378,6 +6378,10 @@ static OString impl_LevelNFC(sal_uInt16 nNumberingType, const SfxItemSet* pOutSe aType = "custom"; rFormat = "001, 002, 003, ..."; break; + case style::NumberingType::ARABIC_ZERO4: + aType = "custom"; + rFormat = "0001, 0002, 0003, ..."; + break; /* Fallback the rest to decimal. case style::NumberingType::NATIVE_NUMBERING: diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index d8ca06e5ed34..6758c58b284a 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -622,6 +622,10 @@ sal_Int16 ConvertCustomNumberFormat(const OUString& rFormat) { nRet = style::NumberingType::ARABIC_ZERO3; } + else if (rFormat == "0001, 0002, 0003, ...") + { + nRet = style::NumberingType::ARABIC_ZERO4; + } return nRet; } |