summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-06-11 19:00:30 +0200
committerEike Rathke <erack@redhat.com>2014-06-11 19:09:41 +0200
commitaf8bb04739ea0b7fba26e8c5fa1b853990d1e18a (patch)
tree4d01a87d77cbf6acc7087dbea4dde5bbe2eff982 /svl
parentf8220638aba68e81dd7cf8f69292685fa04a6253 (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 (cherry picked from commit 7550e153e55222c68530a1a7f6914575f1e258c8)
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx13
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++;
+ }
}
}