summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-08-25 14:18:13 +0200
committerEike Rathke <erack@redhat.com>2017-08-25 14:23:56 +0200
commit001e0e530f42b3838fa882ab77a3bb2b24f69ef7 (patch)
tree27d143bb246c51f9d1244894afc59100df0f1204 /svl
parent9c8c4415f64d91c0c30b025edef649344649c3d7 (diff)
Add check and comment for i18npool locale data using reserved formatIndex
Change-Id: I9401e353241973129bff764d6d7b7f94d7c9b7b0
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index bd6346a3ee39..8099fe888c33 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1823,6 +1823,13 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const css::i18n::NumberForma
sal_uInt32 nPos, bool bAfterChangingSystemCL,
sal_Int16 nOrgIndex )
{
+ SAL_WARN_IF( NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS <= rCode.Index && rCode.Index < NF_INDEX_TABLE_ENTRIES,
+ "svl.numbers", "i18npool locale '" << maLanguageTag.getBcp47() <<
+ "' uses reserved formatIndex value " << rCode.Index << ", next free: " << NF_INDEX_TABLE_ENTRIES <<
+ " Please see description in include/svl/zforlist.hxx at end of enum NfIndexTableOffset");
+ assert( (rCode.Index < NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS || NF_INDEX_TABLE_ENTRIES <= rCode.Index) &&
+ "reserved formatIndex, see warning above");
+
OUString aCodeStr( rCode.Code );
if ( rCode.Index < NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS &&
rCode.Usage == css::i18n::KNumberFormatUsage::CURRENCY &&