From 001e0e530f42b3838fa882ab77a3bb2b24f69ef7 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 25 Aug 2017 14:18:13 +0200 Subject: Add check and comment for i18npool locale data using reserved formatIndex Change-Id: I9401e353241973129bff764d6d7b7f94d7c9b7b0 --- svl/source/numbers/zforlist.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'svl') 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 && -- cgit