diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-07-29 07:53:22 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-07-29 22:58:15 +0200 |
commit | 5f47e319428a703ea53ce49d166e7628aaa60789 (patch) | |
tree | f21d27a9839b28b2276860bed25d2efab3a0b10b /oox | |
parent | 5893a7536a0bbce57c4a2f89680dcb4cff3d06d7 (diff) |
bnc#862510: PPTX import: Properly show data labels in percent format.
Usually, "General" is "0.00" number format, but in this case, when we
want to show percent value, MSO writes that instead of "0%".
Change-Id: I748719765f58e66f9f3fb43c2b527c6823ef6fa1
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/objectformatter.cxx | 7 |
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 ); } |