summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index b919e6bf414c..3b91afef21bc 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1091,9 +1091,12 @@ void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFo
sal_Int32 nPropId = bPercentFormat ? PROP_PercentageNumberFormat : PROP_NumberFormat;
try
{
- sal_Int32 nIndex = rNumberFormat.maFormatCode.equalsIgnoreAsciiCase("general") ?
+ bool bGeneral = rNumberFormat.maFormatCode.equalsIgnoreAsciiCase("general");
+ sal_Int32 nIndex = bGeneral && !bPercentFormat ?
mxData->mxNumTypes->getStandardIndex( mxData->maFromLocale ) :
- mxData->mxNumFmts->addNewConverted( rNumberFormat.maFormatCode, mxData->maEnUsLocale, mxData->maFromLocale );
+ mxData->mxNumFmts->addNewConverted(
+ bGeneral ? OUString("0%") : rNumberFormat.maFormatCode,
+ mxData->maEnUsLocale, mxData->maFromLocale );
if( nIndex >= 0 )
rPropSet.setProperty( nPropId, nIndex );
}