diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-07-29 07:53:22 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-08-11 12:24:43 +0000 |
commit | c76daf9b5f1efc44eaf6541314f122d641c791cc (patch) | |
tree | 0509bce3118d5e6dbcff4a644982fc6f503af146 /oox | |
parent | 8de2e9b4bc53e6c097897142bad223c100d36292 (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
(cherry picked from commit 5f47e319428a703ea53ce49d166e7628aaa60789)
Reviewed-on: https://gerrit.libreoffice.org/10781
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
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 b5b0a5b4d37b..8e91941ea7a8 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -1113,9 +1113,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 ); } |