diff options
-rwxr-xr-x | chart2/qa/extras/chart2dump/chart2dump.cxx | 64 | ||||
-rwxr-xr-x | chart2/qa/extras/chart2dump/data/normal_area_chart.ods | bin | 0 -> 29023 bytes | |||
-rwxr-xr-x | chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods | bin | 0 -> 31559 bytes | |||
-rwxr-xr-x | chart2/qa/extras/chart2dump/data/stacked_area_chart.ods | bin | 0 -> 30199 bytes | |||
-rwxr-xr-x | chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt | 62 | ||||
-rwxr-xr-x | chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt | 62 | ||||
-rwxr-xr-x | chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt | 62 |
7 files changed, 250 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx b/chart2/qa/extras/chart2dump/chart2dump.cxx index 049a7cfbfc16..ba1d83b391a5 100755 --- a/chart2/qa/extras/chart2dump/chart2dump.cxx +++ b/chart2/qa/extras/chart2dump/chart2dump.cxx @@ -937,6 +937,70 @@ DECLARE_DUMP_TEST(PieChartTest, Chart2DumpTest, false) } } +DECLARE_DUMP_TEST(AreaChartTest, Chart2DumpTest, false) +{ + const std::vector<OUString> aTestFiles = + { + "normal_area_chart.ods", + "stacked_area_chart.ods", + "percent_stacked_area_chart.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< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference<chart2::XChartType> xChartType = getChartTypeFromDoc(xChartDoc2, 0); + CPPUNIT_ASSERT(xChartType.is()); + + std::vector<std::vector<double> > aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + size_t nSeriesCount = aDataSeriesYValues.size(); + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nSeriesCount); + + for (size_t nSeries = 0; nSeries < nSeriesCount; ++nSeries) + { + uno::Reference<drawing::XShape> xSeries = getShapeByName(xShapes, "CID/D=0:CS=0:CT=0:Series=" + OUString::number(nSeries)); + CPPUNIT_ASSERT(xSeries.is()); + CPPUNIT_DUMP_ASSERT_NOTE("Series " + OUString::number(nSeries)); + + // One are for one series + uno::Reference<container::XIndexAccess> xIndexAccess(xSeries, UNO_QUERY_THROW); + uno::Reference<container::XIndexAccess> xIndexAccess2(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); // Why this second group shape is here? + uno::Reference<drawing::XShape> xArea(xIndexAccess2->getByIndex(0), UNO_QUERY_THROW); + + // Check size and position + awt::Point aAreaPosition = xArea->getPosition(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaPosition.X, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaPosition.Y, INT_EPS); + awt::Size aAreaSize = xArea->getSize(); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaSize.Height, INT_EPS); + CPPUNIT_DUMP_ASSERT_DOUBLES_EQUAL(aAreaSize.Width, INT_EPS); + + // Check transformation + Reference< beans::XPropertySet > xPropSet(xArea, UNO_QUERY_THROW); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::HomogenMatrix3 aAreaTransformation; + xPropSet->getPropertyValue("Transformation") >>= aAreaTransformation; + CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aAreaTransformation); + + // Check area fill style and color + drawing::FillStyle aAreaFillStyle; + xPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= aAreaFillStyle; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aAreaFillStyle)); + util::Color aAreaFillColor = 0; + xPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aAreaFillColor; + CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aAreaFillColor)); + } + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/chart2dump/data/normal_area_chart.ods b/chart2/qa/extras/chart2dump/data/normal_area_chart.ods Binary files differnew file mode 100755 index 000000000000..84b9ec224732 --- /dev/null +++ b/chart2/qa/extras/chart2dump/data/normal_area_chart.ods diff --git a/chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods b/chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods Binary files differnew file mode 100755 index 000000000000..0cc5d1728a17 --- /dev/null +++ b/chart2/qa/extras/chart2dump/data/percent_stacked_area_chart.ods diff --git a/chart2/qa/extras/chart2dump/data/stacked_area_chart.ods b/chart2/qa/extras/chart2dump/data/stacked_area_chart.ods Binary files differnew file mode 100755 index 000000000000..56bc4e499249 --- /dev/null +++ b/chart2/qa/extras/chart2dump/data/stacked_area_chart.ods diff --git a/chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt b/chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt new file mode 100755 index 000000000000..4f4a5181fd4f --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/areacharttest/normal_area_chart.txt @@ -0,0 +1,62 @@ +// nSeriesCount +4 +/// Series 0 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3295 +// aAreaSize.Height +4052 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;4052;3295;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +1 +// static_cast<sal_Int32>(aAreaFillColor) +16711680 +/// Series 1 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3385 +// aAreaSize.Height +3962 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;3962;3385;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +2 +// static_cast<sal_Int32>(aAreaFillColor) +10079487 +/// Series 2 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3345 +// aAreaSize.Height +4002 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;4002;3345;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +4 +// static_cast<sal_Int32>(aAreaFillColor) +10079487 +/// Series 3 +// aAreaPosition.X +5507 +// aAreaPosition.Y +2334 +// aAreaSize.Height +5013 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;5013;2334;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +3 +// static_cast<sal_Int32>(aAreaFillColor) +16777215 diff --git a/chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt b/chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt new file mode 100755 index 000000000000..b8769b7ad3b2 --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/areacharttest/percent_stacked_area_chart.txt @@ -0,0 +1,62 @@ +// nSeriesCount +4 +/// Series 0 +// aAreaPosition.X +5507 +// aAreaPosition.Y +5080 +// aAreaSize.Height +2267 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2267;5080;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +1 +// static_cast<sal_Int32>(aAreaFillColor) +16711680 +/// Series 1 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3458 +// aAreaSize.Height +2693 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2693;3458;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +2 +// static_cast<sal_Int32>(aAreaFillColor) +10079487 +/// Series 2 +// aAreaPosition.X +5507 +// aAreaPosition.Y +2634 +// aAreaSize.Height +2049 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2049;2634;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +4 +// static_cast<sal_Int32>(aAreaFillColor) +10079487 +/// Series 3 +// aAreaPosition.X +5507 +// aAreaPosition.Y +1344 +// aAreaSize.Height +2157 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2157;1344;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +3 +// static_cast<sal_Int32>(aAreaFillColor) +16777215 diff --git a/chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt b/chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt new file mode 100755 index 000000000000..00934b44bf8f --- /dev/null +++ b/chart2/qa/extras/chart2dump/reference/areacharttest/stacked_area_chart.txt @@ -0,0 +1,62 @@ +// nSeriesCount +4 +/// Series 0 +// aAreaPosition.X +5507 +// aAreaPosition.Y +5958 +// aAreaSize.Height +1389 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;1389;5958;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +1 +// static_cast<sal_Int32>(aAreaFillColor) +16711680 +/// Series 1 +// aAreaPosition.X +5507 +// aAreaPosition.Y +4882 +// aAreaSize.Height +1710 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;1710;4882;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +2 +// static_cast<sal_Int32>(aAreaFillColor) +10079487 +/// Series 2 +// aAreaPosition.X +5507 +// aAreaPosition.Y +3510 +// aAreaSize.Height +2542 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;2542;3510;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +4 +// static_cast<sal_Int32>(aAreaFillColor) +10079487 +/// Series 3 +// aAreaPosition.X +5507 +// aAreaPosition.Y +1792 +// aAreaSize.Height +3985 +// aAreaSize.Width +11328 +// aAreaTransformation +11328;0;5507;0;3985;1792;0;0;1 +// static_cast<sal_Int32>(aAreaFillStyle) +3 +// static_cast<sal_Int32>(aAreaFillColor) +16777215 |