diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-03-23 13:37:25 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-03-23 14:32:37 +0100 |
commit | 8540c7b18bae9c9b46e6feb7658198a7fc62e811 (patch) | |
tree | 35743ff06a7f5e43bdfbaa5c136d0836cda26e28 /sw | |
parent | fecca49c309fc723c524f12fa671114b316a5562 (diff) |
sw: add pad-to-5 numbering
This is the last padded numbering type that is supported by Word but was
not supported by Writer.
Change-Id: Ica1a0843897c61a4b569105fd21e5bfe7b5012cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90912
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/odfexport/data/arabic-zero5-numbering.odt | bin | 0 -> 8779 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 13 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx | bin | 0 -> 14411 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 |
5 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/arabic-zero5-numbering.odt b/sw/qa/extras/odfexport/data/arabic-zero5-numbering.odt Binary files differnew file mode 100644 index 000000000000..3526ee8d7086 --- /dev/null +++ b/sw/qa/extras/odfexport/data/arabic-zero5-numbering.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 052efd073ad5..7931ee55d6d8 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -2383,5 +2383,18 @@ DECLARE_ODFEXPORT_TEST(testArabicZero4Numbering, "arabic-zero4-numbering.odt") aMap["NumberingType"].get<sal_uInt16>()); } +DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, "arabic-zero5-numbering.odt") +{ + 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: 67 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO5. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO5), + aMap["NumberingType"].get<sal_uInt16>()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx b/sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx Binary files differnew file mode 100644 index 000000000000..f7df2c5267fe --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index c4cd522caccb..cff728463f28 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -176,6 +176,19 @@ DECLARE_ODFEXPORT_TEST(testArabicZero4Numbering, "arabic-zero4-numbering.docx") aMap["NumberingType"].get<sal_uInt16>()); } +DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, "arabic-zero5-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: 67 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO5. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO5), + 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 da71d1fe1176..b2828c2a495c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6380,6 +6380,10 @@ static OString impl_LevelNFC(sal_uInt16 nNumberingType, const SfxItemSet* pOutSe aType = "custom"; rFormat = "0001, 0002, 0003, ..."; break; + case style::NumberingType::ARABIC_ZERO5: + aType = "custom"; + rFormat = "00001, 00002, 00003, ..."; + break; /* Fallback the rest to decimal. case style::NumberingType::NATIVE_NUMBERING: |