diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2020-10-16 13:41:28 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-10-19 14:19:34 +0200 |
commit | f1d798151048dde3f48b124ef406416668d1e9c5 (patch) | |
tree | 033f84ba3868dc727be5261ced54b0bb581bc95a /chart2 | |
parent | 73b115b1a399f57efd727eb71d7ef9e4a27afbc9 (diff) |
tdf#137585 Chart ODF: fix export of DataLabelPlacement::CUSTOM
Saving .ods, the DataLabelPlacement::CUSTOM converted to
the default "avoid-overlap" instead of the requested "outside".
Follow-up of commit 20da1a5dd37c7edac620566c992d5a53b23a5f12
(tdf#134978 Chart OOXML Import: fix pie chart label custom position)
Change-Id: Ib15c7f24e0a650c84e6afce08b84e7eece8dafea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104430
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index e9d154d4ade1..d86fa14ef84c 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -180,6 +180,7 @@ public: void testTdf134977(); void testTdf123647(); void testTdf136267(); + void testDataLabelPlacementPieChart(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -322,6 +323,7 @@ public: CPPUNIT_TEST(testTdf134977); CPPUNIT_TEST(testTdf123647); CPPUNIT_TEST(testTdf136267); + CPPUNIT_TEST(testDataLabelPlacementPieChart); CPPUNIT_TEST_SUITE_END(); @@ -1432,7 +1434,7 @@ void Chart2ExportTest::testPieChartDataLabels() load("/chart2/qa/extras/data/docx/", "PieChartDataLabels.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); CPPUNIT_ASSERT(pXmlDoc); - assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos", "val", "bestFit"); + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser[1]/c:dLbls/c:dLbl[1]/c:dLblPos", "val", "outEnd"); } void Chart2ExportTest::testSeriesIdxOrder() @@ -2949,6 +2951,24 @@ void Chart2ExportTest::testTdf136267() assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:cat/c:strRef/c:strCache/c:pt/c:v", "John"); } +void Chart2ExportTest::testDataLabelPlacementPieChart() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf134978.xlsx"); + reload("calc8"); + uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + UNO_QUERY_THROW); + // test the placement of the manually positioned label + Reference<beans::XPropertySet> + xDataPointPropSet(xChartDoc->getDiagram()->getDataPointProperties(2, 0), + uno::UNO_SET_THROW); + uno::Any aAny = xDataPointPropSet->getPropertyValue("LabelPlacement"); + CPPUNIT_ASSERT(aAny.hasValue()); + sal_Int32 nLabelPlacement = 0; + CPPUNIT_ASSERT(aAny >>= nLabelPlacement); + CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, nLabelPlacement); + +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |