summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-05-21 12:50:31 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-05-21 21:35:07 +0200
commit10609749126ca76eaf12904d4cce9cc5a16d8405 (patch)
tree5de89de333d015b33bf63d61e72f87430c438d65 /chart2
parent40d259217beb73ece0c0cd4a90d497e95a565745 (diff)
tdf#122765: Legend interferes with pie chart after pptx import
Revert the commit caused this regression: 0fc41c53dfbd21e526fb0ad68a6651693c4a2ecd The original issue does not come back with reverting this commit. Change-Id: I666c4f92e3b70b416ec6da7a704298d207451649 Reviewed-on: https://gerrit.libreoffice.org/72679 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx23
-rw-r--r--chart2/qa/extras/data/pptx/tdf122765.pptxbin0 -> 47625 bytes
2 files changed, 23 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index cd5e61d03f21..b7eb3e31fc07 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -126,6 +126,7 @@ public:
void testExternalStrRefsXLSX();
void testSourceNumberFormatComplexCategoriesXLS();
void testTdf123504();
+ void testTdf122765();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -206,6 +207,7 @@ public:
CPPUNIT_TEST(testExternalStrRefsXLSX);
CPPUNIT_TEST(testSourceNumberFormatComplexCategoriesXLS);
CPPUNIT_TEST(testTdf123504);
+ CPPUNIT_TEST(testTdf122765);
CPPUNIT_TEST_SUITE_END();
@@ -1870,6 +1872,27 @@ void Chart2ImportTest::testTdf123504()
CPPUNIT_ASSERT_GREATER(sal_Int32(8500), aSliceSize.Width);
}
+void Chart2ImportTest::testTdf122765()
+{
+ // The horizontal position of the slices was wrong.
+ load("/chart2/qa/extras/data/pptx/", "tdf122765.pptx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_QUERY);
+ 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> xSeriesSlices(getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=0"),
+ UNO_SET_THROW);
+
+ Reference<container::XIndexAccess> xIndexAccess(xSeriesSlices, UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(9), xIndexAccess->getCount());
+ Reference<drawing::XShape> xSlice(xIndexAccess->getByIndex(0), UNO_QUERY_THROW);
+
+ // Check position of the first slice, all slices move together, so enough to check only one.
+ // Wrong poisition was around 5856.
+ awt::Point aSlicePosition = xSlice->getPosition();
+ CPPUNIT_ASSERT_GREATER(sal_Int32(7000), aSlicePosition.X);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/pptx/tdf122765.pptx b/chart2/qa/extras/data/pptx/tdf122765.pptx
new file mode 100644
index 000000000000..948190c30b55
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/tdf122765.pptx
Binary files differ