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

Eike Rathke erack at redhat.com
Wed Jun 11 10:05:24 PDT 2014


 i18npool/source/localedata/data/ja_JP.xml |    4 ++--
 svl/source/numbers/zforlist.cxx           |   13 ++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 90b418b759433042f9c0e6647ddef96579640ab6
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jun 11 19:04:19 2014 +0200

    let YYYY/M/D H:MM be the default datetime format
    
    Change-Id: I1d8af400810b9ffd4586320c706a1f00ef1c1369

diff --git a/i18npool/source/localedata/data/ja_JP.xml b/i18npool/source/localedata/data/ja_JP.xml
index 5cca653..c177bf3 100644
--- a/i18npool/source/localedata/data/ja_JP.xml
+++ b/i18npool/source/localedata/data/ja_JP.xml
@@ -201,10 +201,10 @@
     <FormatElement msgid="DateTimeFormatskey1" default="false" type="long" usage="DATE_TIME" formatindex="46">
       <FormatCode>YY/MM/DD HH:MM</FormatCode>
     </FormatElement>
-    <FormatElement msgid="DateTimeFormatskey3" default="true" type="long" usage="DATE_TIME" formatindex="47">
+    <FormatElement msgid="DateTimeFormatskey3" default="false" type="long" usage="DATE_TIME" formatindex="47">
       <FormatCode>YYYY/M/D H:MM:SS</FormatCode>
     </FormatElement>
-    <FormatElement msgid="DateTimeFormatskey2" default="false" type="long" usage="DATE_TIME" formatindex="55">
+    <FormatElement msgid="DateTimeFormatskey2" default="true" type="long" usage="DATE_TIME" formatindex="55">
       <FormatCode>YYYY/M/D H:MM</FormatCode>
     </FormatElement>
     <FormatElement msgid="DateFormatskey22" default="false" type="medium" usage="DATE" formatindex="54">
commit 7550e153e55222c68530a1a7f6914575f1e258c8
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jun 11 19:00:30 2014 +0200

    allow additional i18n formats to define defaults
    
    a5f62d96b124564f522eac7925e9c3d22c37e503 would had liked to let
    usage="DATE_TIME" formatindex="55" define the default format of that
    usage, which wasn't possible. There is no reason to prevent this.
    
    Change-Id: Ibef453c8a07aa03b0a8bb626b9cf71d362be0699

diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index c84f895..9dfe613 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -2712,16 +2712,17 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
         }
     }
 
-    // all additional format codes provided by I18N that are not old standard index
+    // All additional format codes provided by I18N that are not old standard
+    // index. Additional formats may define defaults, currently there is no
+    // check if more than one default of a usage/type combination is provided,
+    // like it is done for usage groups with ImpAdjustFormatCodeDefault().
+    // There is no harm though, on first invocation ImpGetDefaultFormat() will
+    // use the first default encountered.
     aFormatSeq = rNumberFormatCode.getAllFormatCodes();
     nCodes = aFormatSeq.getLength();
     if ( nCodes )
     {
         pFormatArr = aFormatSeq.getArray();
-        // don't check ALL
-        sal_Int32 nDef = ImpAdjustFormatCodeDefault( pFormatArr, nCodes, false);
-        // don't have any defaults here
-        pFormatArr[nDef].Default = false;
         for ( j = 0; j < nCodes; j++ )
         {
             if ( nPos - CLOffset >= SV_COUNTRY_LANGUAGE_OFFSET )
@@ -2730,10 +2731,12 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
                 break;  // for
             }
             if ( pFormatArr[j].Index >= NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS )
+            {
                 if ( ImpInsertNewStandardFormat( pFormatArr[j], nPos+1,
                         SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS,
                         bAfterChangingSystemCL ) )
                     nPos++;
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list