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

Eike Rathke erack at redhat.com
Tue Oct 29 00:52:03 CET 2013


 i18npool/source/localedata/LocaleNode.cxx |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 2830bf9af9a640e1c484b959ee2dcbe1aeabb0f6
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Oct 29 00:50:46 2013 +0100

    iterateCodePoints() on empty string is no good anymore
    
    Change-Id: Id2ddbbff90f3cd32c03c7623af6d458717c7e8a8

diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 905df2e..b71e769 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -1217,19 +1217,23 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
         }
 
         // Rudimentary check if a pattern interferes with decimal number.
-        nIndex = 0;
-        sal_uInt32 cDecSep = aDecSep.iterateCodePoints( &nIndex);
-        for (vector<OUString>::const_iterator aIt = theDateAcceptancePatterns.begin();
-                aIt != theDateAcceptancePatterns.end(); ++aIt)
+        // But only if not inherited in which case we don't have aDecSep here.
+        if (!aDecSep.isEmpty())
         {
-            if ((*aIt).getLength() == (cDecSep <= 0xffff ? 3 : 4))
+            nIndex = 0;
+            sal_uInt32 cDecSep = aDecSep.iterateCodePoints( &nIndex);
+            for (vector<OUString>::const_iterator aIt = theDateAcceptancePatterns.begin();
+                    aIt != theDateAcceptancePatterns.end(); ++aIt)
             {
-                nIndex = 1;
-                if ((*aIt).iterateCodePoints( &nIndex) == cDecSep)
+                if ((*aIt).getLength() == (cDecSep <= 0xffff ? 3 : 4))
                 {
-                    ++nError;
-                    fprintf( stderr, "Error: Date acceptance pattern '%s' matches decimal number '#%s#'\n",
-                            OSTR( *aIt), OSTR( aDecSep));
+                    nIndex = 1;
+                    if ((*aIt).iterateCodePoints( &nIndex) == cDecSep)
+                    {
+                        ++nError;
+                        fprintf( stderr, "Error: Date acceptance pattern '%s' matches decimal number '#%s#'\n",
+                                OSTR( *aIt), OSTR( aDecSep));
+                    }
                 }
             }
         }


More information about the Libreoffice-commits mailing list