summaryrefslogtreecommitdiff
path: root/chart2/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r--chart2/qa/extras/chart2export.cxx19
-rw-r--r--chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsxbin0 -> 14332 bytes
2 files changed, 19 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 1ff1064046e1..b9d5873052ba 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -134,6 +134,7 @@ public:
void testAxisCrossBetweenXSLX();
void testPieChartDataPointExplosionXLSX();
void testCustomDataLabel();
+ void testCustomPositionofDataLabel();
void testCustomDataLabelMultipleSeries();
void testNumberFormatExportPPTX();
void testLabelSeparatorExportDOCX();
@@ -251,6 +252,7 @@ public:
CPPUNIT_TEST(testAxisCrossBetweenXSLX);
CPPUNIT_TEST(testPieChartDataPointExplosionXLSX);
CPPUNIT_TEST(testCustomDataLabel);
+ CPPUNIT_TEST(testCustomPositionofDataLabel);
CPPUNIT_TEST(testCustomDataLabelMultipleSeries);
CPPUNIT_TEST(testNumberFormatExportPPTX);
CPPUNIT_TEST(testLabelSeparatorExportDOCX);
@@ -2170,6 +2172,23 @@ void Chart2ExportTest::testCustomDataLabel()
CPPUNIT_ASSERT_EQUAL(OUString(" <CELLREF"), aFields[1]->getString());
}
+void Chart2ExportTest::testCustomPositionofDataLabel()
+{
+ load("/chart2/qa/extras/data/xlsx/", "testCustomPosDataLabels.xlsx");
+ xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // test custom position of data label
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:idx", "val", "2");
+ OUString aXVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:layout/c:manualLayout/c:x", "val");
+ double nX = aXVal.toDouble();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.11027682973075476, nX, 1e-7);
+
+ OUString aYVal = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:dLbl[1]/c:layout/c:manualLayout/c:y", "val");
+ double nY = aYVal.toDouble();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.0742140311063737, nY, 1e-7);
+}
+
void Chart2ExportTest::testCustomDataLabelMultipleSeries()
{
load("/chart2/qa/extras/data/pptx/", "tdf115107-2.pptx");
diff --git a/chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsx b/chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsx
new file mode 100644
index 000000000000..caa08956cd27
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/testCustomPosDataLabels.xlsx
Binary files differ