diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-12-12 17:27:12 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-12-12 21:54:27 +0000 |
commit | 0e5d89a149e86975e103270a0ff4e65776ff8f85 (patch) | |
tree | f20c56ca11f6587f8cb41bc06d288d8351fb6115 /chart2/qa | |
parent | 5b2aa621ec501f580c359a79bfcb8893594ef288 (diff) |
tdf#98690: move UItest to CppUnittest
Change-Id: Icb1ccc4b3d5fc16264d7700201d3884cc935e5ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144004
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/data/xlsx/tdf98690.xlsx | bin | 0 -> 17975 bytes | |||
-rw-r--r-- | chart2/qa/extras/uichart.cxx | 38 |
2 files changed, 38 insertions, 0 deletions
diff --git a/chart2/qa/extras/data/xlsx/tdf98690.xlsx b/chart2/qa/extras/data/xlsx/tdf98690.xlsx Binary files differnew file mode 100644 index 000000000000..4269afa9eadd --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdf98690.xlsx diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx index ec250f80bb27..877ea0ffac1e 100644 --- a/chart2/qa/extras/uichart.cxx +++ b/chart2/qa/extras/uichart.cxx @@ -201,6 +201,44 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf62057) testCopyPasteToNewSheet(xChartDoc, "Object 1", 2, 6); } +CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf98690) +{ + loadFromURL(u"xlsx/tdf98690.xlsx"); + uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xChartDoc.is()); + uno::Reference<chart::XChartDataArray> xChartData(xChartDoc->getData(), uno::UNO_QUERY_THROW); + uno::Sequence<OUString> aSeriesList = xChartData->getColumnDescriptions(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), aSeriesList.getLength()); + + uno::Sequence<beans::PropertyValue> aPropertyValues = { + comphelper::makePropertyValue("ToObject", OUString("Chart 2")), + }; + dispatchCommand(mxComponent, ".uno:GoToObject", aPropertyValues); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:Copy", {}); + Scheduler::ProcessEventsToIdle(); + + // create a new document + load("private:factory/scalc"); + + dispatchCommand(mxComponent, ".uno:Paste", {}); + Scheduler::ProcessEventsToIdle(); + + uno::Reference<chart::XChartDocument> xChartDoc2(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc2.is()); + uno::Reference<chart::XChartDataArray> xChartData2(xChartDoc2->getData(), uno::UNO_QUERY_THROW); + uno::Sequence<OUString> aSeriesList2 = xChartData2->getColumnDescriptions(); + + // Without the fix in place, this test would have failed with + // - Expected: 12 + // - Actual : 0 + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(12), aSeriesList2.getLength()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |