Kaydet (Commit) af8bb047 authored tarafından Eike Rathke's avatar Eike Rathke

allow additional i18n formats to define defaults

a5f62d96 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 7550e153)
üst f8220638
......@@ -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++;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment