summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-03-30 14:00:11 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-04-07 10:34:35 +0200
commitcfdfe45bf2f8e054c811eeac5f993de501cdb532 (patch)
treeb469cc495d22739a1e3014b78311486e5fb9739c /sw/qa
parenta3f0459e57980a70bcb13f0e639bbed26d2d8b62 (diff)
tdf#141341 docxexport: consolidate conversion of NumTypes
so that one comprehensive function is used for Page and Footnote numbering types (which was already being used by list numbering). I also added support for CHARS_ARABIC_ABJAD <=> arabicAbjad, which was my trigger for consolidating all this. OOXML has one definition (ST_NumberFormat) that specifies the valid values for pgNumType, numFmt (list numbering), numFmt (Endnote and Footnote numbering), so use the same conversion function for all of these. [Also used for caption, but I haven't noticed that yet in export.) In the previous code, there was no possibility for fmt.isEmpty() [despite repeated checks for that situation]. However, I thought it made sense to not specify anything if the conversion didn't match something known (because perhaps the locale could take over then?). In any case, that is a slight change, but for pgNumType we were specifying "none" instead of decimal, which didn't make much sense either. So I don't expect anyone crying 'regression' over that. Change-Id: I90037eb25a0f71d22d6ad1848f43761eb6b9fe00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113351 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 17928387f16c..c272a5878ff6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -16,6 +16,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
@@ -78,6 +79,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf141231_arabicHebrewNumbering, "tdf141231_arabicH
// The page's numbering type: instead of Hebrew, this was default style::NumberingType::ARABIC (4).
auto nActual = getProperty<sal_Int16>(getStyles("PageStyles")->getByName("Standard"), "NumberingType");
CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_HEBREW, nActual);
+
+ // The footnote numbering type: instead of arabicAbjad, this was the default style::NumberingType::ARABIC.
+ uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xFootnoteSettings = xFootnotesSupplier->getFootnoteSettings();
+ nActual = getProperty<sal_Int16>(xFootnotesSupplier->getFootnoteSettings(), "NumberingType");
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::CHARS_ARABIC_ABJAD, nActual);
}
DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx")