diff options
-rw-r--r-- | include/svl/zforlist.hxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 838f69508338..e0c2b95d61c9 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -56,6 +56,8 @@ 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 +constexpr size_t NF_MAX_FORMAT_SYMBOLS = 100; + /// 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; diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 309f963c9c21..34e64bd25da6 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -30,7 +30,6 @@ class SvNumberFormatter; struct ImpSvNumberformatInfo; -const size_t NF_MAX_FORMAT_SYMBOLS = 100; const size_t NF_MAX_DEFAULT_COLORS = 10; // Hack: nThousand==1000 => "Default" occurs in format string diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index e3576285f3da..ce5d6ef925d4 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -951,7 +951,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, break; case XML_TOK_ELEM_ATTR_MIN_EXPONENT_DIGITS: if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) - aNumInfo.nExpDigits = nAttrVal; + aNumInfo.nExpDigits = std::min<sal_Int32>(nAttrVal, NF_MAX_FORMAT_SYMBOLS); break; case XML_TOK_ELEM_ATTR_EXPONENT_INTERVAL: if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) |