diff options
-rw-r--r-- | chart2/qa/extras/chart2import2.cxx | 25 | ||||
-rw-r--r-- | chart2/qa/extras/data/ods/tdf146463.ods | bin | 0 -> 21780 bytes |
2 files changed, 25 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import2.cxx b/chart2/qa/extras/chart2import2.cxx index 17b762824f43..e35473717655 100644 --- a/chart2/qa/extras/chart2import2.cxx +++ b/chart2/qa/extras/chart2import2.cxx @@ -55,6 +55,7 @@ public: void testTdf137505(); void testTdf137734(); void testTdf137874(); + void testTdf146463(); void testTdfCustomShapePos(); void testTdf121281(); void testTdf139658(); @@ -95,6 +96,7 @@ public: CPPUNIT_TEST(testTdf137505); CPPUNIT_TEST(testTdf137734); CPPUNIT_TEST(testTdf137874); + CPPUNIT_TEST(testTdf146463); CPPUNIT_TEST(testTdfCustomShapePos); CPPUNIT_TEST(testTdf121281); CPPUNIT_TEST(testTdf139658); @@ -792,6 +794,29 @@ void Chart2ImportTest2::testTdf137874() CPPUNIT_ASSERT(xLegendEntry.is()); } +void Chart2ImportTest2::testTdf146463() +{ + load(u"/chart2/qa/extras/data/ods/", "tdf146463.ods"); + 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); + uno::Reference<drawing::XShape> xLegend = getShapeByName(xShapes, "CID/D=0:Legend="); + CPPUNIT_ASSERT(xLegend.is()); + + awt::Size aSize = xLegend->getSize(); + + // Without the fix in place, this test would have failed with + // - Expected: 598 + // - Actual : 7072 + CPPUNIT_ASSERT_DOUBLES_EQUAL(598, aSize.Height, 30); + CPPUNIT_ASSERT_DOUBLES_EQUAL(4256, aSize.Width, 30); + awt::Point aPosition = xLegend->getPosition(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(11534, aPosition.X, 30); + CPPUNIT_ASSERT_DOUBLES_EQUAL(4201, aPosition.Y, 30); +} + void Chart2ImportTest2::testTdfCustomShapePos() { load(u"/chart2/qa/extras/data/docx/", "testcustomshapepos.docx"); diff --git a/chart2/qa/extras/data/ods/tdf146463.ods b/chart2/qa/extras/data/ods/tdf146463.ods Binary files differnew file mode 100644 index 000000000000..6214f4a50075 --- /dev/null +++ b/chart2/qa/extras/data/ods/tdf146463.ods |