diff options
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index aab66e24013f..82727ddd3b1a 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -2868,7 +2868,10 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, { eLnge = IniLnge; } - SvNumFormatType eType = GetType(nIndex); + + const SvNumberformat* pFormat = GetFormatEntry( nIndex ); + const SvNumFormatType eType = (pFormat ? pFormat->GetMaskedType() : SvNumFormatType::UNDEFINED); + ImpGenerateCL(eLnge); // create new standard formats if necessary utl::DigitGroupingIterator aGrouping( xLocaleData->getDigitGrouping()); @@ -2876,8 +2879,6 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, const sal_Int32 nDigitsInFirstGroup = ( bThousand && (eType == SvNumFormatType::SCIENTIFIC) ) ? 3 : aGrouping.get(); const OUString& rThSep = GetNumThousandSep(); - SvNumberformat* pFormat = GetFormatEntry( nIndex ); - OUStringBuffer sString; using comphelper::string::padToLength; @@ -3025,7 +3026,7 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, { OUStringBuffer sTmpStr(sString); - if ( pFormat->HasPositiveBracketPlaceholder() ) + if (pFormat && pFormat->HasPositiveBracketPlaceholder()) { sTmpStr.append('_'); sTmpStr.append(')'); |