summaryrefslogtreecommitdiff
path: root/chart2/qa
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2020-09-17 16:49:02 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-09 09:24:18 +0200
commit20da1a5dd37c7edac620566c992d5a53b23a5f12 (patch)
treec86ca1c4d3617889469ee1cf8ddb7d3d36e07d0c /chart2/qa
parent4777f5a0512655552c8803a7378926ad7c02da71 (diff)
tdf#134978 Chart OOXML Import: fix pie chart label custom position
Follow-up of commit dff7a46fb46d1fa2a3ad674ee493ae2d59150fe3 (tdf#130032 Chart OOXML Import: fix data label custom position). Change-Id: Iaaf4ae654ac0c1b4896a53be6034e6c027412df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102981 Tested-by: Jenkins 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.cxx23
-rw-r--r--chart2/qa/extras/data/xlsx/tdf134978.xlsxbin0 -> 13746 bytes
2 files changed, 22 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index dadc782c0af6..d901f879ea18 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -158,6 +158,7 @@ public:
void testTdf125444PercentageCustomLabel();
void testDataPointLabelCustomPos();
void testTdf130032();
+ void testTdf134978();
void testTdf119138MissingAutoTitleDeleted();
void testStockChartShiftedCategoryPosition();
void testTdf133376();
@@ -272,6 +273,7 @@ public:
CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
CPPUNIT_TEST(testDataPointLabelCustomPos);
CPPUNIT_TEST(testTdf130032);
+ CPPUNIT_TEST(testTdf134978);
CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted);
CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
CPPUNIT_TEST(testTdf133376);
@@ -1783,7 +1785,7 @@ void Chart2ImportTest::testTdf109858()
CPPUNIT_ASSERT( aAny.hasValue() );
sal_Int32 nLabelPlacement = 0;
CPPUNIT_ASSERT( aAny >>= nLabelPlacement );
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data point label should be placed bestFit", chart::DataLabelPlacement::AVOID_OVERLAP, nLabelPlacement );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data point label should be placed bestfit", chart::DataLabelPlacement::CUSTOM, nLabelPlacement );
// test data series label position
Reference<beans::XPropertySet> xSeriesPropSet(xChart1Doc->getDiagram()->getDataRowProperties(0), uno::UNO_SET_THROW);
@@ -2511,6 +2513,25 @@ void Chart2ImportTest::testTdf130032()
CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::RIGHT, aPlacement);
}
+void Chart2ImportTest::testTdf134978()
+{
+ // test CustomLabelPosition on Pie chart
+ load("/chart2/qa/extras/data/xlsx/", "tdf134978.xlsx");
+ uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+ CPPUNIT_ASSERT(xDataSeries.is());
+
+ uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(2),
+ uno::UNO_SET_THROW);
+ CPPUNIT_ASSERT(xPropertySet.is());
+
+ chart2::RelativePosition aCustomLabelPosition;
+ xPropertySet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition;
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.040273622047244093, aCustomLabelPosition.Primary, 1e-7);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.25635352872557599, aCustomLabelPosition.Secondary, 1e-7);
+}
+
void Chart2ImportTest::testTdf119138MissingAutoTitleDeleted()
{
load("/chart2/qa/extras/data/xlsx/", "tdf119138-missing-autotitledeleted.xlsx");
diff --git a/chart2/qa/extras/data/xlsx/tdf134978.xlsx b/chart2/qa/extras/data/xlsx/tdf134978.xlsx
new file mode 100644
index 000000000000..ad5522a9144d
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf134978.xlsx
Binary files differ