[Libreoffice-commits] core.git: include/svl svl/source xmloff/source
Caolán McNamara
caolanm at redhat.com
Thu Jan 25 08:54:11 UTC 2018
include/svl/zforlist.hxx | 2 ++
svl/source/numbers/zforscan.hxx | 1 -
xmloff/source/style/xmlnumfi.cxx | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 4f9d4b9b524ed3afd26d2cd67d3559e6a4e6fdfe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 24 12:43:39 2018 +0000
ofz: out-of-memory
Change-Id: If1c9ade3268f4ebadfdad771fe3b35641dca210d
Reviewed-on: https://gerrit.libreoffice.org/48506
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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 ))
More information about the Libreoffice-commits
mailing list