[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - 2 commits - i18npool/source include/svl svl/source xmloff/source

Eike Rathke erack at redhat.com
Sat Jun 15 08:13:10 PDT 2013


 i18npool/source/localedata/data/ar_DZ.xml |    3 +++
 i18npool/source/localedata/data/ar_EG.xml |    3 +++
 i18npool/source/localedata/data/ar_OM.xml |    3 +++
 include/svl/zforlist.hxx                  |    4 +++-
 svl/source/numbers/zforlist.cxx           |    8 ++++----
 xmloff/source/style/xmlnumfi.cxx          |    2 +-
 6 files changed, 17 insertions(+), 6 deletions(-)

New commits:
commit 9cf2d50ed5f53f5c40ce576c5bc370c18b9f67b7
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Jun 15 16:27:05 2013 +0200

    use proper offset for additional locale data formats, fdo#64947 related
    
    Old number formats had predefined formats from 0..49, locale data could
    define additional formats from index 50 on. Internal (fractional)
    formats were added to the number formatter, shifting the number of
    predefined entries NF_INDEX_TABLE_ENTRIES by two that was also used as
    an offset to determine whether a format needed to be added additionally.
    
    As a consequece, formats defined with index values 50 and 51 in locale
    data were ignored and not available in the dialog.
    
    Introduced a new enum constant NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS to
    use as the old offset value for not having to change all locale data
    definitions everytime an internally generated format is added.
    
    Change-Id: I94bdaabf360f7b9c253b1e3f5b73087f0c45fb44
    (cherry picked from commit e7d73b42bd71aaab862c3e519348507a84f74754)

diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index e4810e6..6eb7dea 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -176,10 +176,12 @@ enum NfIndexTableOffset
     NF_BOOLEAN,                             // BOOLEAN
     NF_TEXT,                                // @
 
+    NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS,    // old number of predefined entries, locale data additions start after this
+
     // From here on are values of new built-in formats that are not in the
     // original NumberFormatIndex.idl
 
-    NF_FRACTION_3,                          // # ?/4
+    NF_FRACTION_3 = NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS,    // # ?/4
     NF_FRACTION_4,                          // # ?/100
 
     NF_INDEX_TABLE_ENTRIES
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index ae0a163..0bd38ab 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1825,7 +1825,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const ::com::sun::star::i18n
                                                     sal_Int16 nOrgIndex )
 {
     String aCodeStr( rCode.Code );
-    if ( rCode.Index < NF_INDEX_TABLE_ENTRIES &&
+    if ( rCode.Index < NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS &&
             rCode.Usage == ::com::sun::star::i18n::KNumberFormatUsage::CURRENCY &&
             rCode.Index != NF_CURRENCY_1000DEC2_CCC )
     {   // strip surrounding [$...] on automatic currency
@@ -1865,7 +1865,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const ::com::sun::star::i18n
         delete pFormat;
         return NULL;
     }
-    if ( rCode.Index >= NF_INDEX_TABLE_ENTRIES )
+    if ( rCode.Index >= NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS )
     {
         sal_uInt32 nCLOffset = nPos - (nPos % SV_COUNTRY_LANGUAGE_OFFSET);
         sal_uInt32 nKey = ImpIsEntry( aCodeStr, nCLOffset, ActLnge );
@@ -2714,7 +2714,7 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
             SAL_WARN( "svl.numbers", "ImpGenerateAdditionalFormats: too many formats" );
             break;  // for
         }
-        if ( pFormatArr[j].Index < NF_INDEX_TABLE_ENTRIES &&
+        if ( pFormatArr[j].Index < NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS &&
                 pFormatArr[j].Index != NF_CURRENCY_1000DEC2_CCC )
         {   // Insert only if not already inserted, but internal index must be
             // above so ImpInsertFormat can distinguish it.
@@ -2750,7 +2750,7 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
                 SAL_WARN( "svl.numbers", "ImpGenerateAdditionalFormats: too many formats" );
                 break;  // for
             }
-            if ( pFormatArr[j].Index >= NF_INDEX_TABLE_ENTRIES )
+            if ( pFormatArr[j].Index >= NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS )
                 if ( ImpInsertNewStandardFormat( pFormatArr[j], nPos+1,
                         SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS,
                         bAfterChangingSystemCL ) )
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index beb6205..7fc2d97 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1612,7 +1612,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter)
         NfIndexTableOffset eFormat = (NfIndexTableOffset) SvXMLNumFmtDefaults::GetDefaultDateFormat(
             eDateDOW, eDateDay, eDateMonth, eDateYear,
             eDateHours, eDateMins, eDateSecs, bFromSystem );
-        if ( eFormat < NF_INDEX_TABLE_ENTRIES )
+        if ( eFormat < NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS )
         {
             //  #109651# if a date format has the automatic-order attribute and
             //  contains exactly the elements of one of the default date formats,
commit 94ae882b2eacc183be65f928891ba174a059e3e5
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Jun 15 15:06:17 2013 +0200

    fdo#64947 added [NatNum1]General format codes
    
    Change-Id: I2e024453d10600a6a688123cd8c9de324537a0a1
    (cherry picked from commit 846818afec377b5827fbdf8959ee2f1cf617e44d)

diff --git a/i18npool/source/localedata/data/ar_DZ.xml b/i18npool/source/localedata/data/ar_DZ.xml
index 7c2649a..c3c3be7 100644
--- a/i18npool/source/localedata/data/ar_DZ.xml
+++ b/i18npool/source/localedata/data/ar_DZ.xml
@@ -201,6 +201,9 @@
     <FormatElement msgid="DateFormatskey22" default="false" type="medium" usage="DATE" formatindex="52">
       <FormatCode>[NatNum1]YYYY/MM/DD</FormatCode>
     </FormatElement>
+    <FormatElement msgid="FixedFormatskey7" default="false" type="medium" usage="FIXED_NUMBER" formatindex="53">
+      <FormatCode>[NatNum1]General</FormatCode>
+    </FormatElement>
   </LC_FORMAT>
   <LC_COLLATION ref="en_US" />
   <LC_SEARCH ref="en_US"/>
diff --git a/i18npool/source/localedata/data/ar_EG.xml b/i18npool/source/localedata/data/ar_EG.xml
index 09ce368..defa49e 100644
--- a/i18npool/source/localedata/data/ar_EG.xml
+++ b/i18npool/source/localedata/data/ar_EG.xml
@@ -201,6 +201,9 @@
     <FormatElement msgid="DateFormatskey22" default="false" type="medium" usage="DATE" formatindex="52">
       <FormatCode>[NatNum1]YYYY/MM/DD</FormatCode>
     </FormatElement>
+    <FormatElement msgid="FixedFormatskey7" default="false" type="medium" usage="FIXED_NUMBER" formatindex="53">
+      <FormatCode>[NatNum1]General</FormatCode>
+    </FormatElement>
   </LC_FORMAT>
   <LC_COLLATION ref="en_US" />
   <LC_SEARCH ref="en_US"/>
diff --git a/i18npool/source/localedata/data/ar_OM.xml b/i18npool/source/localedata/data/ar_OM.xml
index a31b967..d293046 100644
--- a/i18npool/source/localedata/data/ar_OM.xml
+++ b/i18npool/source/localedata/data/ar_OM.xml
@@ -192,6 +192,9 @@
     <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
       <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode>
     </FormatElement>
+    <FormatElement msgid="FixedFormatskey7" default="false" type="medium" usage="FIXED_NUMBER" formatindex="50">
+      <FormatCode>[NatNum1]General</FormatCode>
+    </FormatElement>
   </LC_FORMAT>
   <LC_COLLATION>
     <Collator default="true" unoid="alphanumeric"/>


More information about the Libreoffice-commits mailing list