diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-08 15:08:38 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-12 13:39:57 +0200 |
commit | be82f6313f298c13a2f040b218c6f2a33705ff8c (patch) | |
tree | daa82f03380ca0565a1e6df88daa65498558d4f2 /chart2 | |
parent | 0b527b7fe7fdceb04e9b35b345b58c72d9ddc656 (diff) |
tdf#140489 fix chart display in xlsx
Commit 1147383:
tdf#114181 XLSX combined chart: fix swapped primary and secondary axes etc.
introduced regression by applying axis swaping not only
for combined charts.
Change-Id: I764399579ff922ddd495540fdd2a39675f2a8da5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113836
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 35 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/tdf140489.xlsx | bin | 0 -> 32626 bytes |
2 files changed, 35 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 93596eebc2a0..3a8b77f48cdd 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -119,6 +119,7 @@ public: void testAxisTitleRotationXLSX(); void testAxisTitlePositionDOCX(); void testCombinedChartAttachedAxisXLSX(); + void testTdf140489MultiSeriesChartAxisXLSX(); void testTdf90510(); // Pie chart label placement settings(XLS) void testTdf109858(); // Pie chart label placement settings(XLSX) @@ -243,6 +244,7 @@ public: CPPUNIT_TEST(testAxisTitleRotationXLSX); CPPUNIT_TEST(testAxisTitlePositionDOCX); CPPUNIT_TEST(testCombinedChartAttachedAxisXLSX); + CPPUNIT_TEST(testTdf140489MultiSeriesChartAxisXLSX); CPPUNIT_TEST(testTdf90510); CPPUNIT_TEST(testTdf109858); CPPUNIT_TEST(testTdf130105); @@ -1759,6 +1761,39 @@ void Chart2ImportTest::testCombinedChartAttachedAxisXLSX() CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex); } +void Chart2ImportTest::testTdf140489MultiSeriesChartAxisXLSX() +{ + load(u"/chart2/qa/extras/data/xlsx/", "tdf140489.xlsx"); + Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + // First series + Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xChartDoc, 0); + CPPUNIT_ASSERT(xSeries.is()); + + Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY_THROW); + sal_Int32 nAxisIndex = -1; + uno::Any aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex); + + // Second series + xSeries = getDataSeriesFromDoc(xChartDoc, 0, 1); + CPPUNIT_ASSERT(xSeries.is()); + + xPropSet.set(xSeries, uno::UNO_QUERY_THROW); + aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex); + + // Third series + xSeries = getDataSeriesFromDoc(xChartDoc, 0, 2); + CPPUNIT_ASSERT(xSeries.is()); + + xPropSet.set(xSeries, uno::UNO_QUERY_THROW); + aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + CPPUNIT_ASSERT(aAny >>= nAxisIndex); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nAxisIndex); +} + void Chart2ImportTest::testInternalDataProvider() { uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress(u"/chart2/qa/extras/data/odp/", "chart.odp"), uno::UNO_QUERY_THROW); const uno::Reference< chart2::data::XDataProvider >& rxDataProvider = xChartDoc->getDataProvider(); diff --git a/chart2/qa/extras/data/xlsx/tdf140489.xlsx b/chart2/qa/extras/data/xlsx/tdf140489.xlsx Binary files differnew file mode 100644 index 000000000000..bd24f40be7b5 --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdf140489.xlsx |