diff options
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 18 | ||||
-rw-r--r-- | chart2/qa/extras/data/ods/tdf136024.ods | bin | 0 -> 15430 bytes | |||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 6384ac17f0bc..fddfdc0c2e67 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -15,6 +15,7 @@ #include <com/sun/star/chart2/XRegressionCurveContainer.hpp> #include <com/sun/star/chart2/XDataPointCustomLabelField.hpp> #include <com/sun/star/chart2/DataPointCustomLabelFieldType.hpp> +#include <com/sun/star/chart2/RelativePosition.hpp> #include <com/sun/star/lang/XServiceName.hpp> #include <com/sun/star/packages/zip/ZipFileAccess.hpp> #include <com/sun/star/text/XTextDocument.hpp> @@ -2312,6 +2313,23 @@ void Chart2ExportTest::testCustomPositionofDataLabel() double nY = aYVal.toDouble(); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.172648731408574, nY, 1e-7); } + + load("/chart2/qa/extras/data/ods/", "tdf136024.ods"); + { + reload("calc8"); + // tdf#136024: test custom position of pie chart data label after an ods export + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); + + chart2::RelativePosition aCustomLabelPosition; + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition); + CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Primary, -0.0961935120945059, 1e-5); + CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Secondary, 0.209578842093566, 1e-5); + } } void Chart2ExportTest::testCustomDataLabelMultipleSeries() diff --git a/chart2/qa/extras/data/ods/tdf136024.ods b/chart2/qa/extras/data/ods/tdf136024.ods Binary files differnew file mode 100644 index 000000000000..c8d004f54469 --- /dev/null +++ b/chart2/qa/extras/data/ods/tdf136024.ods diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 2d65645d26c5..a2c18e494d19 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3315,6 +3315,7 @@ void SchXMLExportHelper_Impl::exportDataPoints( aPoint.maStyleName = maAutoStyleNameQueue.front(); if(bExportNumFmt) aPoint.mCustomLabelText = lcl_getCustomLabelField(nElement, xSeries); + aPoint.mCustomLabelPos = lcl_getCustomLabelPosition(nElement, xSeries); maAutoStyleNameQueue.pop(); aDataPointVector.push_back( aPoint ); } |