[Libreoffice-commits] core.git: chart2/qa
Tamás Zolnai
tamas.zolnai at collabora.com
Sun Feb 12 21:13:23 UTC 2017
chart2/qa/extras/chart2dump/chart2dump.cxx | 66 ++++++++++
chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods |binary
chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods |binary
chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods |binary
chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt | 20 +++
chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt | 20 +++
chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt | 20 +++
7 files changed, 126 insertions(+)
New commits:
commit 125194ff4b983ccdfb2390449c0a4b4d4345b29b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date: Sun Feb 12 20:50:12 2017 +0100
ChartDumpTest: Test chart wall
Change-Id: I16b7da66c6a6bab160212c47a75ce22951f85f87
Reviewed-on: https://gerrit.libreoffice.org/34181
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx b/chart2/qa/extras/chart2dump/chart2dump.cxx
index 3fa487a..d0adeda 100755
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -744,6 +744,72 @@ DECLARE_DUMP_TEST(ColumnChartTest, Chart2DumpTest, false)
}
}
+DECLARE_DUMP_TEST(ChartWallTest, Chart2DumpTest, false)
+{
+ const std::vector<OUString> aTestFiles =
+ {
+ "chartwall_auto_adjust_with_titles.ods",
+ "chartwall_auto_adjust_without_titles.ods",
+ "chartwall_custom_positioning.ods"
+ };
+
+ for (const OUString& sTestFile : aTestFiles)
+ {
+ setTestFileName(sTestFile);
+ load(getTestFileDirName(), getTestFileName());
+ uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xShapes.is());
+
+ uno::Reference<drawing::XShape> xChartWall = getShapeByName(xShapes, "CID/DiagramWall=");
+ CPPUNIT_ASSERT(xChartWall.is());
+
+ // Check position and size
+ awt::Point aChartWallPosition = xChartWall->getPosition();
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aChartWallPosition.X);
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aChartWallPosition.Y);
+ awt::Size aChartWallSize = xChartWall->getSize();
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aChartWallSize.Height);
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aChartWallSize.Width);
+
+ // Check transformation
+ Reference< beans::XPropertySet > xPropSet(xChartWall, UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xPropSet.is());
+ drawing::HomogenMatrix3 aTransform;
+ xPropSet->getPropertyValue("Transformation") >>= aTransform;
+ OUString sChartWallTransformation = transformationToOneLineString(aTransform);
+ CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sChartWallTransformation);
+
+ // Check fill properties
+ drawing::FillStyle aChartWallFillStyle;
+ xPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= aChartWallFillStyle;
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aChartWallFillStyle));
+ util::Color aChartWallFillColor = 0;
+ xPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aChartWallFillColor;
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aChartWallFillColor));
+
+ // Check line properties
+ // Line type
+ drawing::LineDash aLineDash;
+ xPropSet->getPropertyValue("LineDash") >>= aLineDash;
+ OUString sChartWallLineDash =
+ OUString::number(static_cast<sal_Int32>(aLineDash.Style)) + ";" + OUString::number(aLineDash.Dots) + ";" + OUString::number(aLineDash.DotLen) +
+ OUString::number(aLineDash.Dashes) + ";" + OUString::number(aLineDash.DashLen) + ";" + OUString::number(aLineDash.Distance);
+ CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(sChartWallLineDash);
+ // Line color
+ util::Color aChartWallLineColor = 0;
+ xPropSet->getPropertyValue("LineColor") >>= aChartWallLineColor;
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aChartWallLineColor));
+ // Line width
+ sal_Int32 nChartWallLineWidth = 0;
+ xPropSet->getPropertyValue("LineWidth") >>= nChartWallLineWidth;
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nChartWallLineWidth);
+
+ }
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods
new file mode 100755
index 0000000..9bb8555
Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods differ
diff --git a/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods
new file mode 100755
index 0000000..8c76b81
Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods differ
diff --git a/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods b/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods
new file mode 100755
index 0000000..f0e2b89
Binary files /dev/null and b/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods differ
diff --git a/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt
new file mode 100755
index 0000000..9d3806d
--- /dev/null
+++ b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_with_titles.txt
@@ -0,0 +1,20 @@
+// aChartWallPosition.X
+3712
+// aChartWallPosition.Y
+1421
+// aChartWallSize.Height
+5892
+// aChartWallSize.Width
+9284
+// sChartWallTransformation
+9285;0;37120;5893;14210;0;1
+// static_cast<sal_Int32>(aChartWallFillStyle)
+2
+// static_cast<sal_Int32>(aChartWallFillColor)
+15132390
+// sChartWallLineDash
+0;1;200710;0;152
+// static_cast<sal_Int32>(aChartWallLineColor)
+11010131
+// nChartWallLineWidth
+100
diff --git a/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt
new file mode 100755
index 0000000..96a04e9
--- /dev/null
+++ b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_auto_adjust_without_titles.txt
@@ -0,0 +1,20 @@
+// aChartWallPosition.X
+2714
+// aChartWallPosition.Y
+354
+// aChartWallSize.Height
+7888
+// aChartWallSize.Width
+11853
+// sChartWallTransformation
+11854;0;27140;7889;3540;0;1
+// static_cast<sal_Int32>(aChartWallFillStyle)
+2
+// static_cast<sal_Int32>(aChartWallFillColor)
+15132390
+// sChartWallLineDash
+0;1;200710;0;152
+// static_cast<sal_Int32>(aChartWallLineColor)
+11010131
+// nChartWallLineWidth
+100
diff --git a/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt
new file mode 100755
index 0000000..4370750
--- /dev/null
+++ b/chart2/qa/extras/chart2dump/reference/chartwalltest/chartwall_custom_positioning.txt
@@ -0,0 +1,20 @@
+// aChartWallPosition.X
+6327
+// aChartWallPosition.Y
+1415
+// aChartWallSize.Height
+5949
+// aChartWallSize.Width
+6611
+// sChartWallTransformation
+6612;0;63270;5950;14150;0;1
+// static_cast<sal_Int32>(aChartWallFillStyle)
+1
+// static_cast<sal_Int32>(aChartWallFillColor)
+13773611
+// sChartWallLineDash
+0;2;01;203;203
+// static_cast<sal_Int32>(aChartWallLineColor)
+8388352
+// nChartWallLineWidth
+110
More information about the Libreoffice-commits
mailing list