[Libreoffice-commits] core.git: chart2/qa
Marco Cecchetti
marco.cecchetti at collabora.com
Sat Nov 28 15:39:11 PST 2015
chart2/qa/extras/xshape/chart2xshape.cxx | 68 ++++++++++
chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx |binary
2 files changed, 68 insertions(+)
New commits:
commit 4daba1f0e526c8c1ba829fe6e95c957bef6e46bb
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Sat Oct 10 21:51:48 2015 +0200
tdf#88154 - added unit test for rotated layout
Change-Id: Ie0243bda8ec253d68f3bc5e469623d1f4edddcf5
Reviewed-on: https://gerrit.libreoffice.org/19297
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx
index dd74e18..c49662f 100644
--- a/chart2/qa/extras/xshape/chart2xshape.cxx
+++ b/chart2/qa/extras/xshape/chart2xshape.cxx
@@ -35,6 +35,7 @@ public:
void testPieChartLabels3();
void testPieChartLabels4();
void testTdf76649TrendLineBug();
+ void testTdf88154LabelRotatedLayout();
CPPUNIT_TEST_SUITE(Chart2XShapeTest);
CPPUNIT_TEST(testFdo75075);
@@ -44,6 +45,7 @@ public:
CPPUNIT_TEST(testPieChartLabels3);
CPPUNIT_TEST(testPieChartLabels4);
CPPUNIT_TEST(testTdf76649TrendLineBug);
+ CPPUNIT_TEST(testTdf88154LabelRotatedLayout);
CPPUNIT_TEST_SUITE_END();
@@ -155,6 +157,72 @@ void Chart2XShapeTest::testTdf76649TrendLineBug()
assertXPath(pXmlDoc, "//XShape[@name='CID/D=0:CS=0:CT=0:Series=0:Curve=0']", 1);
}
+void Chart2XShapeTest::testTdf88154LabelRotatedLayout()
+{
+ load("chart2/qa/extras/xshape/data/pptx/", "tdf88154_LabelRotatedLayout.pptx");
+ uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromDrawImpress(0,6);
+ uno::Reference< qa::XDumper > xDumper( xChartDoc, UNO_QUERY_THROW );
+ OUString rDump = xDumper->dump();
+ OString aXmlDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8);
+ xmlDocPtr pXmlDoc = xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr()));
+
+ {
+ OString aPath( "//XShape[@text='Oct-12']/Transformation" );
+ assertXPath(pXmlDoc, aPath, 1);
+ double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
+ double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
+ double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1").toDouble();
+ double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2").toDouble();
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
+ }
+ {
+ OString aPath( "//XShape[@text='Nov-12']/Transformation" );
+ assertXPath(pXmlDoc, aPath, 1);
+ double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
+ double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
+ double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1").toDouble();
+ double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2").toDouble();
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
+ }
+ {
+ OString aPath( "//XShape[@text='Dec-12']/Transformation" );
+ assertXPath(pXmlDoc, aPath, 1);
+ double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
+ double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
+ double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1").toDouble();
+ double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2").toDouble();
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
+ }
+ {
+ OString aPath( "//XShape[@text='May-13']/Transformation" );
+ assertXPath(pXmlDoc, aPath, 1);
+ double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
+ double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
+ double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1").toDouble();
+ double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2").toDouble();
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
+ }
+ {
+ OString aPath( "//XShape[@text='Jan-14']/Transformation" );
+ assertXPath(pXmlDoc, aPath, 1);
+ double fT11 = getXPath(pXmlDoc, aPath + "/Line1", "column1").toDouble();
+ double fT12 = getXPath(pXmlDoc, aPath + "/Line1", "column2").toDouble();
+ double fT21 = getXPath(pXmlDoc, aPath + "/Line2", "column1").toDouble();
+ double fT22 = getXPath(pXmlDoc, aPath + "/Line2", "column2").toDouble();
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT11, -fT21, 1e-8);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fT12, fT22, 1e-8);
+ }
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2XShapeTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx b/chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx
new file mode 100644
index 0000000..f3af677
Binary files /dev/null and b/chart2/qa/extras/xshape/data/pptx/tdf88154_LabelRotatedLayout.pptx differ
More information about the Libreoffice-commits
mailing list