diff options
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 14 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx | bin | 0 -> 13917 bytes | |||
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 7 |
3 files changed, 14 insertions, 7 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 68a142090805..4a7ccb373685 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -61,6 +61,7 @@ public: */ void testPPTXHiddenDataSeries(); void testPPTXPercentageNumberFormats(); + void testPieChartLabelsNumFormat(); void testPPTXStackedNonStackedYAxis(); void testPPTChartSeries(); void testODPChartSeries(); @@ -175,6 +176,7 @@ public: CPPUNIT_TEST(testPPTXSparseChartSeries); CPPUNIT_TEST(testPPTXHiddenDataSeries); CPPUNIT_TEST(testPPTXPercentageNumberFormats); + CPPUNIT_TEST(testPieChartLabelsNumFormat); CPPUNIT_TEST(testPPTXStackedNonStackedYAxis); CPPUNIT_TEST(testODPChartSeries); CPPUNIT_TEST(testBnc864396); @@ -710,6 +712,18 @@ void Chart2ImportTest::testPPTXPercentageNumberFormats() CPPUNIT_ASSERT_MESSAGE("Y axis should be a percent format.", (nType & util::NumberFormat::PERCENT)); } +void Chart2ImportTest::testPieChartLabelsNumFormat() +{ + load("/chart2/qa/extras/data/xlsx/", "tdfPieNumFormat.xlsx"); + uno::Reference< chart::XChartDocument > xChartDoc(getChartCompFromSheet(0, mxComponent), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc.is()); + // test data point labels format + Reference<beans::XPropertySet> xDataPointPropSet(xChartDoc->getDiagram()->getDataPointProperties(0, 0), uno::UNO_SET_THROW); + chart2::DataPointLabel aLabel; + xDataPointPropSet->getPropertyValue("Label") >>= aLabel; + CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumber); +} + void Chart2ImportTest::testPPTXStackedNonStackedYAxis() { load("/chart2/qa/extras/data/pptx/", "stacked-non-stacked-mix-y-axis.pptx"); diff --git a/chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx b/chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx Binary files differnew file mode 100644 index 000000000000..0835cb33325b --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdfPieNumFormat.xlsx diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 6ade0b4cfd07..f063019b8327 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -124,13 +124,6 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt bool bShowValue = !rDataLabel.mbDeleted && rDataLabel.mobShowVal.get( !bMSO2007Doc ); bool bShowPercent = !rDataLabel.mbDeleted && rDataLabel.mobShowPercent.get( !bMSO2007Doc ) && (rTypeInfo.meTypeCategory == TYPECATEGORY_PIE); - if( bShowValue && - !bShowPercent && rTypeInfo.meTypeCategory == TYPECATEGORY_PIE && - rDataLabel.maNumberFormat.maFormatCode.indexOf('%') >= 0 ) - { - bShowValue = false; - bShowPercent = true; - } bool bShowCateg = !rDataLabel.mbDeleted && rDataLabel.mobShowCatName.get( !bMSO2007Doc ); bool bShowSymbol = !rDataLabel.mbDeleted && rDataLabel.mobShowLegendKey.get( !bMSO2007Doc ); |