[Libreoffice-commits] core.git: i18npool/source include/editeng offapi/com sw/qa

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Sun Aug 9 10:37:51 UTC 2020


 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |    8 +++++
 include/editeng/svxenum.hxx                                           |    1 
 offapi/com/sun/star/style/NumberingType.idl                           |    6 ++++
 sw/qa/extras/odfexport/data/rovas-numbering.odt                       |binary
 sw/qa/extras/odfexport/odfexport.cxx                                  |   14 ++++++++++
 5 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit f4ca7ea13102dfbc0a62e925b6fe4dbe6fd0bf99
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Sun Aug 2 10:41:25 2020 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Sun Aug 9 12:37:13 2020 +0200

    tdf#135573 sw: add Székely rovás (Old Hungarian) numerals
    
    Change-Id: Ic309fc9b07186ce0b86ca54028d62e0fafd104fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99950
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 936f1620ad73..119cc76b4f61 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -942,6 +942,11 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
                result += lcl_formatArabicZero(number, 5);
                break;
 
+          case SZEKELY_ROVAS: // Old Hungarian
+               natNum = NativeNumberMode::NATNUM12;
+               locale.Language = "hu-Hung";
+               break;
+
           default:
                OSL_ASSERT(false);
                throw IllegalArgumentException();
@@ -1036,8 +1041,9 @@ const Supported_NumberingType aSupportedTypes[] =
         {style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_SR,   S_CYR_A ", " S_CYR_B ", .., " S_CYR_A S_CYR_A ", " S_CYR_A S_CYR_B ", ... (sr)", LANG_ALL},
         {style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_N_SR, C_CYR_A ", " C_CYR_B ", .., " C_CYR_A S_CYR_A ", " C_CYR_B S_CYR_B ", ... (sr)", LANG_ALL},
         {style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_N_SR, S_CYR_A ", " S_CYR_B ", .., " S_CYR_A S_CYR_A ", " S_CYR_B S_CYR_B ", ... (sr)", LANG_ALL},
-        {style::NumberingType::CHARS_PERSIAN,   nullptr, LANG_CTL},
+        {style::NumberingType::CHARS_PERSIAN,        nullptr, LANG_CTL},
         {style::NumberingType::CHARS_PERSIAN_WORD,   nullptr, LANG_CTL},
+        {style::NumberingType::SZEKELY_ROVAS,        nullptr, LANG_CTL},
         {style::NumberingType::CHARS_GREEK_UPPER_LETTER,   C_GR_A ", " C_GR_B ", ... (gr)", LANG_ALL},
         {style::NumberingType::CHARS_GREEK_LOWER_LETTER,   S_GR_A ", " S_GR_B ", ... (gr)", LANG_ALL},
         {style::NumberingType::ARABIC_ZERO, "01, 02, 03, ...", LANG_ALL},
diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx
index fb614738366e..6c02165607d7 100644
--- a/include/editeng/svxenum.hxx
+++ b/include/editeng/svxenum.hxx
@@ -210,6 +210,7 @@ enum SvxNumType : sal_Int16
     SVX_NUM_ARABIC_ZERO3          = css::style::NumberingType::ARABIC_ZERO3,
     SVX_NUM_ARABIC_ZERO4          = css::style::NumberingType::ARABIC_ZERO4,
     SVX_NUM_ARABIC_ZERO5          = css::style::NumberingType::ARABIC_ZERO5,
+    SVX_NUM_SZEKELY_ROVAS         = css::style::NumberingType::SZEKELY_ROVAS
 };
 
 #endif
diff --git a/offapi/com/sun/star/style/NumberingType.idl b/offapi/com/sun/star/style/NumberingType.idl
index 230103695bda..fd19e087f7b9 100644
--- a/offapi/com/sun/star/style/NumberingType.idl
+++ b/offapi/com/sun/star/style/NumberingType.idl
@@ -520,6 +520,12 @@ published constants NumberingType
         @since LibreOffice 7.0
      */
     const short ARABIC_ZERO5 = 67;
+
+    /** Numbering is in Szekely rovas (Old Hungarian) numerals
+
+        @since LibreOffice 7.1
+     */
+    const short SZEKELY_ROVAS = 68;
 };
 
 
diff --git a/sw/qa/extras/odfexport/data/rovas-numbering.odt b/sw/qa/extras/odfexport/data/rovas-numbering.odt
new file mode 100644
index 000000000000..72cb8895a95a
Binary files /dev/null and b/sw/qa/extras/odfexport/data/rovas-numbering.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 4f0a04cf69f8..f74980ebc51b 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2537,6 +2537,20 @@ DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, "arabic-zero5-numbering.odt")
                          aMap["NumberingType"].get<sal_uInt16>());
 }
 
+DECLARE_ODFEXPORT_TEST(testRovasNumbering, "rovas-numbering.odt")
+{
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+    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: 68
+    // - Actual  : 4
+    // i.e. numbering type was ARABIC, not SZEKELY_ROVAS.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::SZEKELY_ROVAS),
+                         aMap["NumberingType"].get<sal_uInt16>());
+}
+
 DECLARE_ODFEXPORT_TEST(testPageContentBottom, "page-content-bottom.odt")
 {
     CPPUNIT_ASSERT_EQUAL(1, getShapes());


More information about the Libreoffice-commits mailing list