diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-12-07 11:43:49 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-12-07 13:08:59 +0000 |
commit | 4f0794e69ec0f8fdcf6a152bfed77b1f18f1b918 (patch) | |
tree | f91fbb5351b874198ef6ba5b1ed09e5d07fce7c9 /chart2/qa | |
parent | 6e502de67a7a19d33dcb69cbd35366c4dd0850f9 (diff) |
chart2: pass chart number to getChartCompFromSheet
will be used in the following commit
Change-Id: I9d0925d0ef2bf93c01499a62b8eeb4153aceb9cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143768
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'chart2/qa')
-rw-r--r-- | chart2/qa/extras/chart2export2.cxx | 2 | ||||
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 24 | ||||
-rw-r--r-- | chart2/qa/extras/chart2import2.cxx | 6 | ||||
-rw-r--r-- | chart2/qa/extras/charttest.hxx | 6 | ||||
-rw-r--r-- | chart2/qa/extras/uichart.cxx | 4 | ||||
-rw-r--r-- | chart2/qa/extras/xshape/chart2xshape.cxx | 2 |
6 files changed, 22 insertions, 22 deletions
diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index dd9cb1bd978b..4a95f40ab515 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -1343,7 +1343,7 @@ void Chart2ExportTest2::testDataLabelPlacementPieChart() { loadFromURL(u"xlsx/tdf134978.xlsx"); saveAndReload("calc8"); - uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0, mxComponent), UNO_QUERY_THROW); // test the placement of the manually positioned label Reference<beans::XPropertySet> xDataPointPropSet( diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index b707b91d8c6d..68791e3b2d21 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -379,7 +379,7 @@ static uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< ch void Chart2ImportTest::testODSChartSeries() { loadFromURL(u"ods/chart.ods"); - uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); uno::Sequence < OUString > seriesList = getChartColumnDescriptions( xChart1Doc); CPPUNIT_ASSERT_EQUAL(OUString("Col 1"), seriesList[0]); CPPUNIT_ASSERT_EQUAL(OUString("Col2"), seriesList[1]); @@ -390,7 +390,7 @@ void Chart2ImportTest::testODSChartSeries() void Chart2ImportTest::testXLSXChartSeries() { loadFromURL(u"xlsx/chart.xlsx"); - uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); uno::Sequence < OUString > seriesList = getChartColumnDescriptions(xChart1Doc ); CPPUNIT_ASSERT_EQUAL(OUString("Col 1"), seriesList[0]); CPPUNIT_ASSERT_EQUAL(OUString("Col2"), seriesList[1]); @@ -401,7 +401,7 @@ void Chart2ImportTest::testXLSXChartSeries() void Chart2ImportTest::testXLSChartSeries() { loadFromURL(u"xls/chart.xls"); - uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); uno::Sequence < OUString > seriesList = getChartColumnDescriptions(xChart1Doc ); CPPUNIT_ASSERT_EQUAL(OUString("Col 1"), seriesList[0]); CPPUNIT_ASSERT_EQUAL(OUString("Col 2"), seriesList[1]); @@ -679,7 +679,7 @@ void Chart2ImportTest::testPPTXPercentageNumberFormats() void Chart2ImportTest::testPieChartLabelsNumFormat() { loadFromURL(u"xlsx/tdfPieNumFormat.xlsx"); - uno::Reference< chart::XChartDocument > xChartDoc(getChartCompFromSheet(0, mxComponent), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChartDoc(getChartCompFromSheet(0, 0, mxComponent), UNO_QUERY_THROW); CPPUNIT_ASSERT(xChartDoc.is()); // test data point labels format Reference<beans::XPropertySet> xDataPointPropSet(xChartDoc->getDiagram()->getDataPointProperties(0, 0), uno::UNO_SET_THROW); @@ -977,7 +977,7 @@ void Chart2ImportTest::testTdf108021() uno::Reference< chart::XDiagram > mxDiagram; uno::Reference< beans::XPropertySet > xAxisProp; bool bTextBreak = false; - uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); mxDiagram.set(xChartDoc->getDiagram()); CPPUNIT_ASSERT(mxDiagram.is()); uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); @@ -1208,7 +1208,7 @@ void Chart2ImportTest::testTextCanOverlapXLSX() uno::Reference< chart::XDiagram > mxDiagram; uno::Reference< beans::XPropertySet > xAxisProp; bool bTextCanOverlap = false; - uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); mxDiagram.set(xChartDoc->getDiagram()); CPPUNIT_ASSERT(mxDiagram.is()); uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); @@ -1227,7 +1227,7 @@ void Chart2ImportTest::testTextBreakXLSX() uno::Reference< chart::XDiagram > mxDiagram; uno::Reference< beans::XPropertySet > xAxisProp; bool textBreak = false; - uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); CPPUNIT_ASSERT(xChartDoc.is()); mxDiagram.set(xChartDoc->getDiagram()); CPPUNIT_ASSERT(mxDiagram.is()); @@ -1530,7 +1530,7 @@ void Chart2ImportTest::testVaryColorDefaultValues2013XLSX() void Chart2ImportTest::testPlotVisOnlyDefaultValue2013XLSX() { loadFromURL(u"xlsx/plotVisOnly.xlsx"); - uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW); uno::Any aAny = xPropSet->getPropertyValue("IncludeHiddenCells"); CPPUNIT_ASSERT(aAny.hasValue()); @@ -1542,7 +1542,7 @@ void Chart2ImportTest::testPlotVisOnlyDefaultValue2013XLSX() void Chart2ImportTest::testRAngAxDefaultValue2013XLSX() { loadFromURL(u"xlsx/rAngAx.xlsx"); - uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW); Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW); uno::Any aAny = xPropSet->getPropertyValue("RightAngledAxes"); CPPUNIT_ASSERT(aAny.hasValue()); @@ -1786,7 +1786,7 @@ void Chart2ImportTest::testInternalDataProvider() { void Chart2ImportTest::testTdf90510() { loadFromURL(u"xls/piechart_outside.xls"); - uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW ); + uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW ); Reference<beans::XPropertySet> xPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_SET_THROW ); uno::Any aAny = xPropSet->getPropertyValue( "LabelPlacement" ); CPPUNIT_ASSERT( aAny.hasValue() ); @@ -1798,7 +1798,7 @@ void Chart2ImportTest::testTdf90510() void Chart2ImportTest::testTdf109858() { loadFromURL(u"xlsx/piechart_outside.xlsx"); - uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW ); + uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW ); // test data point labels position Reference<beans::XPropertySet> xDataPointPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_SET_THROW ); @@ -1834,7 +1834,7 @@ void Chart2ImportTest::testTdf130105() void Chart2ImportTest::testTdf111173() { loadFromURL(u"xlsx/tdf111173.xlsx"); - uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW ); + uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, 0, mxComponent ), UNO_QUERY_THROW ); } void Chart2ImportTest::testTdf122226() diff --git a/chart2/qa/extras/chart2import2.cxx b/chart2/qa/extras/chart2import2.cxx index 6535ee5f15dc..2afbb9c33830 100644 --- a/chart2/qa/extras/chart2import2.cxx +++ b/chart2/qa/extras/chart2import2.cxx @@ -264,7 +264,7 @@ void checkDataLabelProperties(const Reference<chart2::XDataSeries>& xDataSeries, void Chart2ImportTest2::testDeletedDataLabel() { loadFromURL(u"xlsx/deleted_data_labels.xlsx"); - uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0, mxComponent), UNO_QUERY_THROW); Reference<chart2::XDataSeries> xDataSeries0 = getDataSeriesFromDoc(xChartDoc, 0); CPPUNIT_ASSERT(xDataSeries0.is()); @@ -296,7 +296,7 @@ void Chart2ImportTest2::testDataPointInheritedColorDOCX() void Chart2ImportTest2::testExternalStrRefsXLSX() { loadFromURL(u"xlsx/external_str_ref.xlsx"); - uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0, mxComponent), UNO_QUERY_THROW); CPPUNIT_ASSERT(xChartDoc.is()); @@ -310,7 +310,7 @@ void Chart2ImportTest2::testExternalStrRefsXLSX() void Chart2ImportTest2::testSourceNumberFormatComplexCategoriesXLS() { loadFromURL(u"xls/source_number_format_axis.xls"); - uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + uno::Reference<chart2::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0, mxComponent), UNO_QUERY_THROW); CPPUNIT_ASSERT(xChartDoc.is()); diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx index a685c6537bf5..1d78972974e9 100644 --- a/chart2/qa/extras/charttest.hxx +++ b/chart2/qa/extras/charttest.hxx @@ -139,7 +139,7 @@ protected: xmlDocUniquePtr parseExport(const OUString& rDir, const OUString& rFilterFormat); }; -Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > const & xComponent ) +Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, sal_Int32 nChart, uno::Reference< lang::XComponent > const & xComponent ) { // let us assume that we only have one chart per sheet @@ -153,7 +153,7 @@ Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Refe CPPUNIT_ASSERT(xCharts.is()); uno::Reference< container::XIndexAccess > xIACharts(xCharts, UNO_QUERY_THROW); - uno::Reference< table::XTableChart > xChart( xIACharts->getByIndex(0), UNO_QUERY_THROW); + uno::Reference< table::XTableChart > xChart( xIACharts->getByIndex(nChart), UNO_QUERY_THROW); uno::Reference< document::XEmbeddedObjectSupplier > xEmbObjectSupplier(xChart, UNO_QUERY_THROW); @@ -165,7 +165,7 @@ Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Refe Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > const & xComponent ) { - uno::Reference< chart2::XChartDocument > xChartDoc ( getChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW ); + uno::Reference< chart2::XChartDocument > xChartDoc ( getChartCompFromSheet(nSheet, 0, xComponent), UNO_QUERY_THROW ); // Update the chart view, so that its draw page is updated and ready for the test css::uno::Reference<css::frame::XModel> xModel(xChartDoc, css::uno::UNO_QUERY_THROW); diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx index 296677a7d046..2d70428a7547 100644 --- a/chart2/qa/extras/uichart.cxx +++ b/chart2/qa/extras/uichart.cxx @@ -26,7 +26,7 @@ public: CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf120348) { loadFromURL(u"ods/tdf120348.ods"); - uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + 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); @@ -97,7 +97,7 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf151091) = { u"Ωφέλιμο", u"Επικίνδυνο", u"Απόσταση", u"Μάσκα", u"Εμβόλιο" }; loadFromURL(u"ods/tdf151091.ods"); - uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + 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); diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx index 08e639007a8a..23e3f93eaafa 100644 --- a/chart2/qa/extras/xshape/chart2xshape.cxx +++ b/chart2/qa/extras/xshape/chart2xshape.cxx @@ -78,7 +78,7 @@ bool checkDumpAgainstFile(std::u16string_view rDump, std::u16string_view aFilePa OUString Chart2XShapeTest::getXShapeDumpString() { - uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, mxComponent), + uno::Reference<chart::XChartDocument> xChartDoc(getChartCompFromSheet(0, 0, mxComponent), UNO_QUERY_THROW); uno::Reference<qa::XDumper> xDumper(xChartDoc, UNO_QUERY_THROW); return xDumper->dump(); |