[Libreoffice-commits] core.git: i18npool/qa i18npool/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 29 21:40:24 UTC 2021


 i18npool/qa/cppunit/test_defaultnumberingprovider.cxx                 |    4 --
 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |   17 ++++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit ac80ec817eb07c77a51bc0729985a473c734182e
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Jul 29 17:49:08 2021 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Thu Jul 29 23:39:47 2021 +0200

    Make duplicate generated numbering identifiers unique, tdf#143526 follow-up
    
    Change-Id: I28366c4e868e97b70e016b056b73b88b4cc8b812
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119677
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
index 4770abb93808..f7382ede1a9f 100644
--- a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
+++ b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
@@ -57,10 +57,6 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testNumberingIdentifi
                 // FIXME: duplicate of NUMBER_UPPER_ZH_TW
             case css::style::NumberingType::NUMBER_INDIC_DEVANAGARI:
                 // FIXME: duplicate of NUMBER_EAST_ARABIC_INDIC
-            case css::style::NumberingType::NUMBER_DIGITAL_KO:
-                // FIXME: duplicate of NUMBER_HANGUL_KO
-            case css::style::NumberingType::NUMBER_DIGITAL2_KO:
-                // FIXME: duplicate of NUMBER_LOWER_ZH
                 break;
             default:
                 if (aID.isEmpty() || !aMap.insert(std::pair(aID, i)).second)
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index b7ee64cac5eb..a5a604903ad6 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -1128,6 +1128,23 @@ OUString DefaultNumberingProvider::makeNumberingIdentifier(sal_Int16 index)
             result.append(", ");
         }
         result.append("...");
+        // Make known duplicate generated identifiers unique.
+        // Note this alone works only for newly added numberings, if duplicates
+        // are in the wild further handling is needed when loading documents
+        // and asking for numberings.
+        switch (aSupportedTypes[index].nType)
+        {
+            case css::style::NumberingType::NUMBER_DIGITAL_KO:
+                // Duplicate of NUMBER_HANGUL_KO.
+                result.append(" (ko-x-digital)");
+            break;
+            case css::style::NumberingType::NUMBER_DIGITAL2_KO:
+                // Duplicate of NUMBER_LOWER_ZH.
+                result.append(" (ko)");
+            break;
+            default:
+                ; // nothing
+        }
         return result.makeStringAndClear();
     }
 }


More information about the Libreoffice-commits mailing list