summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-06-15 16:27:05 +0200
committerEike Rathke <erack@redhat.com>2013-06-15 16:40:00 +0200
commite7d73b42bd71aaab862c3e519348507a84f74754 (patch)
tree76e4f43580eb98afaed07a05b835657bc0faaa16 /svl
parent296834c2da5c5a9e733b209d68cdb831441e8a64 (diff)
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
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 1a3438008369..99c3da2596bd 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 ) )