summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-03-20 17:27:21 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-04-06 13:46:23 +0200
commit0cb3cde0a8aec707e40400befb8d70cf0610e432 (patch)
tree5a4e2d40b8db45bca4d5a30e9a9a8de8878df3db
parent884d448169ae9ac3cedbb128b0b78edb92150ab4 (diff)
sw pad-to-4 numbering: add ODF filter
This makes the UI work as well. (cherry picked from commit 5b071c10d36371d1f9ce14ab13230bfd703d0245) Change-Id: I4e94b85097cc359b257b07ba7517edfab3011093 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91638 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx1
-rw-r--r--sw/qa/extras/odfexport/data/arabic-zero4-numbering.odtbin0 -> 8702 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx13
3 files changed, 14 insertions, 0 deletions
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 0cb55a04b701..5a13c6c8f054 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -1050,6 +1050,7 @@ static const Supported_NumberingType aSupportedTypes[] =
{style::NumberingType::CHARS_GREEK_LOWER_LETTER, S_GR_A ", " S_GR_B ", ... (gr)", LANG_ALL},
{style::NumberingType::ARABIC_ZERO, "01, 02, 03, ...", LANG_ALL},
{style::NumberingType::ARABIC_ZERO3, "001, 002, 003, ...", LANG_ALL},
+ {style::NumberingType::ARABIC_ZERO4, "0001, 0002, 0003, ...", LANG_ALL},
};
static const sal_Int32 nSupported_NumberingTypes = SAL_N_ELEMENTS(aSupportedTypes);
diff --git a/sw/qa/extras/odfexport/data/arabic-zero4-numbering.odt b/sw/qa/extras/odfexport/data/arabic-zero4-numbering.odt
new file mode 100644
index 000000000000..2eb9b49cedaa
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/arabic-zero4-numbering.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 86c55f2a5984..da4005697099 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2254,6 +2254,19 @@ DECLARE_ODFEXPORT_TEST(testArabicZero3Numbering, "arabic-zero3-numbering.odt")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO3),
aMap["NumberingType"].get<sal_uInt16>());
}
+
+DECLARE_ODFEXPORT_TEST(testArabicZero4Numbering, "arabic-zero4-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: 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>());
+}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();