diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-05-26 14:13:00 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-06-02 14:07:08 +0200 |
commit | 73477348e30c6931a537cba5557c250183fbeb9b (patch) | |
tree | 47d9e863d4453de74bcb0d309eaaa18a41da4a04 /chart2/qa | |
parent | a9b47360c2af2514b1064fb179f9fb9f0b8ad225 (diff) |
tdf#133376 Chart view: improve BestFit position of data labels
Put exceeding data label outside the pie slice
without overlapping the other pie slices.
Change-Id: I220fd43f0d52c940cf3ef30764074776d19da184
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94859
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 21 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/tdf133376.xlsx | bin | 0 -> 12736 bytes |
2 files changed, 21 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index df324ee5e7a3..e47f1234ef60 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -159,6 +159,7 @@ public: void testTdf130032(); void testTdf119138MissingAutoTitleDeleted(); void testStockChartShiftedCategoryPosition(); + void testTdf133376(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -266,6 +267,7 @@ public: CPPUNIT_TEST(testTdf130032); CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted); CPPUNIT_TEST(testStockChartShiftedCategoryPosition); + CPPUNIT_TEST(testTdf133376); CPPUNIT_TEST_SUITE_END(); @@ -2482,6 +2484,25 @@ void Chart2ImportTest::testStockChartShiftedCategoryPosition() CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); } +void Chart2ImportTest::testTdf133376() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf133376.xlsx"); + Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW); + Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW); + Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW); + Reference<drawing::XShape> xDataPointLabel(getShapeByName(xShapes, + "CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2"), UNO_SET_THROW); + + CPPUNIT_ASSERT(xDataPointLabel.is()); + // Check the position of the 3rd data point label, which is out from the pie slice + awt::Point aLabelPosition = xDataPointLabel->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1466, aLabelPosition.X, 30); + CPPUNIT_ASSERT_DOUBLES_EQUAL(5269, aLabelPosition.Y, 30); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/tdf133376.xlsx b/chart2/qa/extras/data/xlsx/tdf133376.xlsx Binary files differnew file mode 100644 index 000000000000..2000733ec8ba --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdf133376.xlsx |