From afbd0960f0b8d8b27cc9582279367540cc8aad84 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 1 Dec 2017 23:50:23 +0100 Subject: Get rid of the css::util::NumberFormat::TEXT abuse as "special" "key" It is a bit, not a key, which demanded special treatment at all places, and a key with the same value could not be handled at all. Abusing the css::util::NumberFormat::TEXT flag as number format key to signal the "special" meaning, having a number format key equal to that value would had resulted in undesired behaviour. The bit value is 256 and a key 256 means 156 user defined number formats in the default locale, rarely in the wild but can happen. Change-Id: Idfd5b07d524c222df3491d201095ef65ad4a46c9 Reviewed-on: https://gerrit.libreoffice.org/45705 Tested-by: Jenkins Reviewed-by: Eike Rathke --- include/svl/zforlist.hxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/svl') diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 3e59064281c2..5b84d0078408 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -54,6 +54,10 @@ namespace com { namespace sun { namespace star { #define SV_COUNTRY_LANGUAGE_OFFSET 10000 // Max count of formats per country/language #define SV_MAX_COUNT_STANDARD_FORMATS 100 // Max count of builtin default formats per CL +/// The built-in @ Text format, offset within a locale, key in the locale the +/// number formatter was constructed with. +constexpr sal_uInt32 NF_STANDARD_FORMAT_TEXT = SV_MAX_COUNT_STANDARD_FORMATS; + #define NUMBERFORMAT_ENTRY_NOT_FOUND (sal_uInt32)(0xffffffff) /// MAX_ULONG -- cgit