diff options
author | Eike Rathke <erack@redhat.com> | 2014-06-11 19:00:30 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-06-11 19:04:59 +0200 |
commit | 7550e153e55222c68530a1a7f6914575f1e258c8 (patch) | |
tree | 3c88c5325256ef77b68f6678b11180911f9cdfcf /svl | |
parent | e9261e8b413bc76ca2770df30495fec1979cfca1 (diff) |
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
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index c84f895ae866..9dfe6138b364 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++; + } } } |