[Libreoffice-commits] .: 2 commits - i18npool/source

Eike Rathke erack at kemper.freedesktop.org
Tue Jan 17 08:05:02 PST 2012


 i18npool/source/localedata/LocaleNode.cxx |   23 +++++++++++++++++++++--
 i18npool/source/localedata/data/zh_TW.xml |    5 +++++
 2 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit c0bbf6f78aba568d3b3edb77fdfa973c183208ff
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jan 17 17:02:57 2012 +0100

    rudimentary check if date acceptance pattern interferes with decimal number

diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index dd07dfe..1b1e777 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -382,7 +382,8 @@ void LCInfoNode::generateCode (const OFileWriter &of) const
 }
 
 
-OUString aDateSep;
+static OUString aDateSep;
+static OUString aDecSep;
 
 void LCCTYPENode::generateCode (const OFileWriter &of) const
 {
@@ -400,7 +401,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
         writeParameterCheckLen( of, "DateSeparator", "dateSeparator", 1, 1);
     OUString aThoSep =
         writeParameterCheckLen( of, "ThousandSeparator", "thousandSeparator", 1, 1);
-    OUString aDecSep =
+    aDecSep =
         writeParameterCheckLen( of, "DecimalSeparator", "decimalSeparator", 1, 1);
     OUString aTimeSep =
         writeParameterCheckLen( of, "TimeSeparator", "timeSeparator", 1, 1);
@@ -1203,6 +1204,24 @@ 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)
+        {
+            if ((*aIt).getLength() == (cDecSep <= 0xffff ? 3 : 4))
+            {
+                nIndex = 1;
+                if ((*aIt).iterateCodePoints( &nIndex) == cDecSep)
+                {
+                    ++nError;
+                    fprintf( stderr, "Error: Date acceptance pattern '%s' matches decimal number '#%s#'\n",
+                            OSTR( *aIt), OSTR( aDecSep));
+                }
+            }
+        }
+
         sal_Int16 nbOfDateAcceptancePatterns = static_cast<sal_Int16>(theDateAcceptancePatterns.size());
 
         for (sal_Int16 i = 0; i < nbOfDateAcceptancePatterns; ++i)
commit fa836f7bf0fcdab6029320bdf7830c561d5ea823
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jan 17 16:40:33 2012 +0100

    added [zh-TW] date acceptance patterns (various)

diff --git a/i18npool/source/localedata/data/zh_TW.xml b/i18npool/source/localedata/data/zh_TW.xml
index 89ecdd9..15681f0 100644
--- a/i18npool/source/localedata/data/zh_TW.xml
+++ b/i18npool/source/localedata/data/zh_TW.xml
@@ -35,6 +35,11 @@
     <MeasurementSystem>metric</MeasurementSystem>
   </LC_CTYPE>
   <LC_FORMAT>
+    <DateAcceptancePattern>Y.M.D</DateAcceptancePattern>
+    <DateAcceptancePattern>M-D</DateAcceptancePattern>
+    <DateAcceptancePattern>M/D</DateAcceptancePattern>
+    <DateAcceptancePattern>Y年M月D日</DateAcceptancePattern>
+    <DateAcceptancePattern>M月D日</DateAcceptancePattern>
     <!-- Fixed Number formats. Index range is 0-5. -->
     <FormatElement msgid="NumberFormatskey1" default="true" type="medium" usage="FIXED_NUMBER"  formatindex="0">
       <FormatCode>General</FormatCode>


More information about the Libreoffice-commits mailing list