summaryrefslogtreecommitdiff
path: root/chart2/qa/extras
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-07 13:03:58 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-06-08 01:29:32 +0200
commit5708534b942c1d0ce384f6a8473da6bb569410e7 (patch)
tree2ec4fe87624541c15bf89c8b839e8f8dba8a89f4 /chart2/qa/extras
parent1e55a47e89a9d9d6cf9cb3993484022aaf2c097b (diff)
look for unnecessary calls to Reference::is() after an UNO_QUERY_THROW
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r--chart2/qa/extras/chart2_trendcalculators.cxx1
-rw-r--r--chart2/qa/extras/chart2dump/chart2dump.cxx19
-rw-r--r--chart2/qa/extras/chart2export.cxx3
-rw-r--r--chart2/qa/extras/chart2import.cxx12
-rw-r--r--chart2/qa/extras/charttest.hxx28
5 files changed, 0 insertions, 63 deletions
diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx b/chart2/qa/extras/chart2_trendcalculators.cxx
index 42e1f52e467e..a889b6637eb7 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -84,7 +84,6 @@ void Chart2TrendCalculators::loadCalculatorFromSheet(sal_Int32 nSheet)
CPPUNIT_ASSERT(xDataSeries.is());
Reference<chart2::XRegressionCurveContainer> xRegressionCurveContainer(xDataSeries, UNO_QUERY_THROW);
- CPPUNIT_ASSERT( xRegressionCurveContainer.is() );
Sequence< Reference< chart2::XRegressionCurve > > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xRegressionCurveSequence.getLength());
diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx b/chart2/qa/extras/chart2dump/chart2dump.cxx
index 7e8cd9b2a2f6..ceb818c70e0f 100644
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -295,7 +295,6 @@ DECLARE_DUMP_TEST(ChartDataTest, Chart2DumpTest, false)
setTestFileName(aTestFile);
load(getTestFileDirName(), getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc (getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
// Check title
uno::Reference< chart2::XChartDocument > xChartDoc2(xChartDoc, UNO_QUERY_THROW);
@@ -344,7 +343,6 @@ DECLARE_DUMP_TEST(ChartDataTest, Chart2DumpTest, false)
// Check column labels
uno::Reference< chart::XChartDataArray > xChartData(xChartDoc->getData(), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartData.is());
uno::Sequence < OUString > aColumnLabels = xChartData->getColumnDescriptions();
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(aColumnLabels.getLength());
OUString sColumnLabels = sequenceToOneLineString(aColumnLabels);
@@ -410,7 +408,6 @@ DECLARE_DUMP_TEST(LegendTest, Chart2DumpTest, false)
setTestFileName(aTestFile);
load(getTestFileDirName(), getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
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);
@@ -451,7 +448,6 @@ DECLARE_DUMP_TEST(LegendTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xLegendEntryPropSet(xLegendEntry, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xLegendEntryPropSet.is());
drawing::HomogenMatrix3 aLegendEntryTransformation;
xLegendEntryPropSet->getPropertyValue("Transformation") >>= aLegendEntryTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aLegendEntryTransformation, INT_EPS);*/
@@ -469,7 +465,6 @@ DECLARE_DUMP_TEST(LegendTest, Chart2DumpTest, false)
// Check display color
Reference< beans::XPropertySet > xPropSet(xLegendEntryGeom, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPropSet.is());
util::Color aEntryGeomColor = 0;
xPropSet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= aEntryGeomColor;
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(static_cast<sal_Int32>(aEntryGeomColor));
@@ -536,7 +531,6 @@ DECLARE_DUMP_TEST(GridTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xGrid, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPropSet.is());
drawing::HomogenMatrix3 aGridTransformation;
xPropSet->getPropertyValue("Transformation") >>= aGridTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aGridTransformation, INT_EPS);
@@ -545,7 +539,6 @@ DECLARE_DUMP_TEST(GridTest, Chart2DumpTest, false)
uno::Reference<container::XIndexAccess> xIndexAccess(xGrid, UNO_QUERY_THROW);
uno::Reference<drawing::XShape> xGridLine(xIndexAccess->getByIndex(0), UNO_QUERY_THROW);
Reference< beans::XPropertySet > xGridLinePropSet(xGridLine, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xGridLinePropSet.is());
// Line type
drawing::LineDash aLineDash;
xGridLinePropSet->getPropertyValue("LineDash") >>= aLineDash;
@@ -581,7 +574,6 @@ DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false)
setTestFileName(sTestFile);
load(getTestFileDirName(), getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
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);
@@ -609,7 +601,6 @@ DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xXAxis, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPropSet.is());
drawing::HomogenMatrix3 aAxisTransformation;
xPropSet->getPropertyValue("Transformation") >>= aAxisTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aAxisTransformation, INT_EPS);
@@ -620,7 +611,6 @@ DECLARE_DUMP_TEST(AxisGeometryTest, Chart2DumpTest, false)
CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL(nAxisGeometriesCount);
uno::Reference<drawing::XShape> xAxisLine(xIndexAccess->getByIndex(0), UNO_QUERY_THROW);
Reference< beans::XPropertySet > xAxisLinePropSet(xAxisLine, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xAxisLinePropSet.is());
// Line type
drawing::LineDash aLineDash;
xAxisLinePropSet->getPropertyValue("LineDash") >>= aLineDash;
@@ -655,7 +645,6 @@ DECLARE_DUMP_TEST(AxisLabelTest, Chart2DumpTest, false)
setTestFileName(sTestFile);
load(getTestFileDirName(), getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
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);
@@ -705,7 +694,6 @@ DECLARE_DUMP_TEST(AxisLabelTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xLabelShape, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPropSet.is());
/*drawing::HomogenMatrix3 aLabelTransformation;
xPropSet->getPropertyValue("Transformation") >>= aLabelTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aLabelTransformation, INT_EPS);*/
@@ -788,7 +776,6 @@ DECLARE_DUMP_TEST(ColumnBarChartTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xColumnOrBar, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPropSet.is());
drawing::HomogenMatrix3 aColumnOrBarTransformation;
xPropSet->getPropertyValue("Transformation") >>= aColumnOrBarTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aColumnOrBarTransformation, INT_EPS);
@@ -811,7 +798,6 @@ DECLARE_DUMP_TEST(ChartWallTest, Chart2DumpTest, false)
setTestFileName(sTestFile);
load(getTestFileDirName(), getTestFileName());
uno::Reference< chart::XChartDocument > xChartDoc(getChartDocFromDrawImpress(0, 0), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
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);
@@ -830,7 +816,6 @@ DECLARE_DUMP_TEST(ChartWallTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xChartWall, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPropSet.is());
/*drawing::HomogenMatrix3 aChartWallTransformation;
xPropSet->getPropertyValue("Transformation") >>= aChartWallTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aChartWallTransformation, INT_EPS);*/
@@ -922,7 +907,6 @@ DECLARE_DUMP_TEST(PieChartTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPropSet(xSlice, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPropSet.is());
drawing::HomogenMatrix3 aSliceTransformation;
xPropSet->getPropertyValue("Transformation") >>= aSliceTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aSliceTransformation, INT_EPS);
@@ -987,7 +971,6 @@ DECLARE_DUMP_TEST(AreaChartTest, Chart2DumpTest, false)
// 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, INT_EPS);
@@ -1083,7 +1066,6 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
{
uno::Reference<container::XIndexAccess> XPointContainer (
getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=" + OUString::number(nSeries) + ":Point=" + OUString::number(nPoint)), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(XPointContainer.is());
uno::Reference<drawing::XShape> XPoint(XPointContainer->getByIndex(0), UNO_QUERY_THROW);
uno::Reference<container::XNamed> xNamedShape(XPointContainer, uno::UNO_QUERY);
CPPUNIT_DUMP_ASSERT_NOTE(xNamedShape->getName());
@@ -1098,7 +1080,6 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
// Check transformation
Reference< beans::XPropertySet > xPointPropSet(XPoint, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xPointPropSet.is());
drawing::HomogenMatrix3 aPointTransformation;
xPointPropSet->getPropertyValue("Transformation") >>= aPointTransformation;
CPPUNIT_DUMP_ASSERT_TRANSFORMATIONS_EQUAL(aPointTransformation, INT_EPS);
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index c43433d690a9..8ed59e43cf84 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -432,7 +432,6 @@ void Chart2ExportTest::testErrorBarXLSX()
CPPUNIT_ASSERT( xDataSeries.is() );
Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xPropSet.is() );
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
@@ -449,7 +448,6 @@ void Chart2ExportTest::testErrorBarXLSX()
CPPUNIT_ASSERT( xDataSeries.is() );
Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xPropSet.is() );
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
@@ -1143,7 +1141,6 @@ void Chart2ExportTest::testErrorBarDataRangeODS()
CPPUNIT_ASSERT( xDataSeries.is() );
Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xPropSet.is() );
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 4f065d27161e..361b16d43056 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -218,7 +218,6 @@ void Chart2ImportTest::Fdo60083()
CPPUNIT_ASSERT( xDataSeries.is() );
Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xPropSet.is() );
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
@@ -268,7 +267,6 @@ void Chart2ImportTest::testErrorBarRange()
CPPUNIT_ASSERT( xDataSeries.is() );
Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xPropSet.is() );
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
@@ -298,7 +296,6 @@ void Chart2ImportTest::testErrorBarFormatting()
CPPUNIT_ASSERT( xDataSeries.is() );
Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xPropSet.is() );
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
@@ -354,7 +351,6 @@ uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< chart::XC
{
CPPUNIT_ASSERT(xChart1Doc.is());
uno::Reference< chart::XChartDataArray > xChartData ( xChart1Doc->getData(), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartData.is());
uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions();
return seriesList;
}
@@ -690,7 +686,6 @@ void Chart2ImportTest::testBnc889755()
{
load("/chart2/qa/extras/data/pptx/", "bnc889755.pptx");
uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 6), uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider());
uno::Reference< chart2::XInternalDataProvider > xDataProvider( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
@@ -926,7 +921,6 @@ void Chart2ImportTest::testTextCanOverlapXLSX()
uno::Reference< beans::XPropertySet > xAxisProp;
bool bTextCanOverlap = false;
uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
mxDiagram.set(xChartDoc->getDiagram());
CPPUNIT_ASSERT(mxDiagram.is());
uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY );
@@ -1161,7 +1155,6 @@ void Chart2ImportTest::testPlotVisOnlyDefaultValue2013XLSX()
{
load("/chart2/qa/extras/data/xlsx/", "plotVisOnly.xlsx");
uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
- CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChart1Doc.is());
Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW);
uno::Any aAny = xPropSet->getPropertyValue("IncludeHiddenCells");
CPPUNIT_ASSERT(aAny.hasValue());
@@ -1174,7 +1167,6 @@ void Chart2ImportTest::testRAngAxDefaultValue2013XLSX()
{
load("/chart2/qa/extras/data/xlsx/", "rAngAx.xlsx");
uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
- CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChart1Doc.is());
Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW);
uno::Any aAny = xPropSet->getPropertyValue("RightAngledAxes");
CPPUNIT_ASSERT(aAny.hasValue());
@@ -1328,7 +1320,6 @@ void Chart2ImportTest::testTdf90510()
{
load("/chart2/qa/extras/data/xls/", "piechart_outside.xls");
uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW );
- CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChart1Doc.is() );
Reference<beans::XPropertySet> xPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_QUERY_THROW );
uno::Any aAny = xPropSet->getPropertyValue( "LabelPlacement" );
CPPUNIT_ASSERT( aAny.hasValue() );
@@ -1341,7 +1332,6 @@ void Chart2ImportTest::testTdf109858()
{
load("/chart2/qa/extras/data/xlsx/", "piechart_outside.xlsx");
uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW );
- CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChart1Doc.is() );
Reference<beans::XPropertySet> xPropSet( xChart1Doc->getDiagram()->getDataPointProperties( 0, 0 ), uno::UNO_QUERY_THROW );
uno::Any aAny = xPropSet->getPropertyValue( "LabelPlacement" );
CPPUNIT_ASSERT( aAny.hasValue() );
@@ -1354,7 +1344,6 @@ void Chart2ImportTest::testTdf111173()
{
load("/chart2/qa/extras/data/xlsx/", "tdf111173.xlsx");
uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW );
- CPPUNIT_ASSERT_MESSAGE( "failed to load chart", xChart1Doc.is() );
}
void Chart2ImportTest::testTdf115107()
@@ -1556,7 +1545,6 @@ void Chart2ImportTest::testTdf116163()
CPPUNIT_ASSERT(xXAxis.is());
uno::Reference<container::XIndexAccess> xIndexAccess(xXAxis, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xIndexAccess.is());
// Check text
uno::Reference<text::XTextRange> xLabel0(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 438565222db4..202475e7e4ca 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -184,26 +184,20 @@ Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Refe
// let us assume that we only have one chart per sheet
uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComponent, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xDoc.is());
uno::Reference< container::XIndexAccess > xIA(xDoc->getSheets(), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xIA.is());
uno::Reference< table::XTableChartsSupplier > xChartSupplier( xIA->getByIndex(nSheet), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartSupplier.is());
uno::Reference< table::XTableCharts > xCharts = xChartSupplier->getCharts();
CPPUNIT_ASSERT(xCharts.is());
uno::Reference< container::XIndexAccess > xIACharts(xCharts, UNO_QUERY_THROW);
uno::Reference< table::XTableChart > xChart( xIACharts->getByIndex(0), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChart.is());
uno::Reference< document::XEmbeddedObjectSupplier > xEmbObjectSupplier(xChart, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xEmbObjectSupplier.is());
uno::Reference< lang::XComponent > xChartComp( xEmbObjectSupplier->getEmbeddedObject(), UNO_QUERY_THROW );
- CPPUNIT_ASSERT(xChartComp.is());
return xChartComp;
@@ -212,20 +206,16 @@ 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 );
- CPPUNIT_ASSERT(xChartDoc.is());
return xChartDoc;
}
uno::Reference<table::XTablePivotCharts> getTablePivotChartsFromSheet(sal_Int32 nSheet, uno::Reference<lang::XComponent> const & xComponent)
{
uno::Reference<sheet::XSpreadsheetDocument> xDoc(xComponent, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xDoc.is());
uno::Reference<container::XIndexAccess> xIA(xDoc->getSheets(), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xIA.is());
uno::Reference<table::XTablePivotChartsSupplier> xChartSupplier(xIA->getByIndex(nSheet), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartSupplier.is());
uno::Reference<table::XTablePivotCharts> xTablePivotCharts = xChartSupplier->getPivotCharts();
CPPUNIT_ASSERT(xTablePivotCharts.is());
@@ -239,13 +229,10 @@ Reference<lang::XComponent> getPivotChartCompFromSheet(sal_Int32 nSheet, uno::Re
uno::Reference<container::XIndexAccess> xIACharts(xTablePivotCharts, UNO_QUERY_THROW);
uno::Reference<table::XTablePivotChart> xTablePivotChart(xIACharts->getByIndex(0), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xTablePivotChart.is());
uno::Reference<document::XEmbeddedObjectSupplier> xEmbObjectSupplier(xTablePivotChart, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xEmbObjectSupplier.is());
uno::Reference<lang::XComponent> xChartComp(xEmbObjectSupplier->getEmbeddedObject(), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartComp.is());
return xChartComp;
}
@@ -253,7 +240,6 @@ Reference<lang::XComponent> getPivotChartCompFromSheet(sal_Int32 nSheet, uno::Re
Reference<chart2::XChartDocument> getPivotChartDocFromSheet(sal_Int32 nSheet, uno::Reference<lang::XComponent> const & xComponent)
{
uno::Reference<chart2::XChartDocument> xChartDoc(getPivotChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
return xChartDoc;
}
@@ -261,16 +247,12 @@ Reference<chart2::XChartDocument> getPivotChartDocFromSheet(uno::Reference<table
{
uno::Reference<container::XIndexAccess> xIACharts(xTablePivotCharts, UNO_QUERY_THROW);
uno::Reference<table::XTablePivotChart> xTablePivotChart(xIACharts->getByIndex(nIndex), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xTablePivotChart.is());
uno::Reference<document::XEmbeddedObjectSupplier> xEmbObjectSupplier(xTablePivotChart, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xEmbObjectSupplier.is());
uno::Reference<lang::XComponent> xChartComp(xEmbObjectSupplier->getEmbeddedObject(), UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartComp.is());
uno::Reference<chart2::XChartDocument> xChartDoc(xChartComp, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartDoc.is());
return xChartDoc;
}
@@ -283,13 +265,11 @@ Reference< chart2::XChartType > getChartTypeFromDoc( Reference< chart2::XChartDo
CPPUNIT_ASSERT( xDiagram.is() );
Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xCooSysContainer.is() );
Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
CPPUNIT_ASSERT( xCooSysSequence.getLength() > nCooSys );
Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[nCooSys], UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xChartTypeContainer.is() );
Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
CPPUNIT_ASSERT( xChartTypeSequence.getLength() > nChartType );
@@ -304,7 +284,6 @@ Reference<chart2::XAxis> getAxisFromDoc(
CPPUNIT_ASSERT(xDiagram.is());
Reference<chart2::XCoordinateSystemContainer> xCooSysContainer(xDiagram, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xCooSysContainer.is());
Sequence<Reference<chart2::XCoordinateSystem> > xCooSysSequence = xCooSysContainer->getCoordinateSystems();
CPPUNIT_ASSERT(xCooSysSequence.getLength() > nCooSys);
@@ -323,7 +302,6 @@ sal_Int32 getNumberOfDataSeries(uno::Reference<chart2::XChartDocument> const & x
{
Reference<chart2::XChartType> xChartType = getChartTypeFromDoc(xChartDoc, nChartType, nCooSys);
Reference<chart2::XDataSeriesContainer> xDataSeriesContainer(xChartType, UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xDataSeriesContainer.is());
uno::Sequence<uno::Reference<chart2::XDataSeries>> xSeriesSequence(xDataSeriesContainer->getDataSeries());
return xSeriesSequence.getLength();
@@ -335,7 +313,6 @@ Reference< chart2::XDataSeries > getDataSeriesFromDoc(uno::Reference<chart2::XCh
{
Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, nChartType, nCooSys );
Reference< chart2::XDataSeriesContainer > xDataSeriesContainer( xChartType, UNO_QUERY_THROW );
- CPPUNIT_ASSERT ( xDataSeriesContainer.is() );
Sequence< Reference< chart2::XDataSeries > > xSeriesSequence( xDataSeriesContainer->getDataSeries() );
CPPUNIT_ASSERT( xSeriesSequence.getLength() > nDataSeries );
@@ -407,7 +384,6 @@ uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XC
CPPUNIT_ASSERT( xChartDoc->getDataProvider().is() );
uno::Reference<beans::XPropertySet> xProp(xChartDoc->getDataProvider(), uno::UNO_QUERY );
uno::Reference< chart2::XAnyDescriptionAccess > xAnyDescriptionAccess ( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
- CPPUNIT_ASSERT( xAnyDescriptionAccess.is() );
uno::Sequence< OUString > seriesList = xAnyDescriptionAccess->getColumnDescriptions();
return seriesList;
}
@@ -503,7 +479,6 @@ uno::Reference< chart::XChartDocument > ChartTest::getChartDocFromImpress( const
uno::Reference< drawing::XDrawPagesSupplier > xDoc(mxComponent, uno::UNO_QUERY_THROW );
uno::Reference< drawing::XDrawPage > xPage(
xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
- CPPUNIT_ASSERT(xPage.is());
uno::Reference< beans::XPropertySet > xShapeProps(
xPage->getByIndex(0), uno::UNO_QUERY );
CPPUNIT_ASSERT(xShapeProps.is());
@@ -526,8 +501,6 @@ uno::Reference<chart::XChartDocument> ChartTest::getChartDocFromDrawImpress(
uno::Reference<drawing::XDrawPage> xPage(
xPages->getDrawPages()->getByIndex(nPage), uno::UNO_QUERY_THROW);
- if (!xPage.is())
- return xEmpty;
uno::Reference<beans::XPropertySet> xShapeProps(xPage->getByIndex(nShape), uno::UNO_QUERY);
if (!xShapeProps.is())
@@ -566,7 +539,6 @@ uno::Sequence < OUString > ChartTest::getImpressChartColumnDescriptions( const O
{
uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromImpress( pDir, pName );
uno::Reference< chart::XChartDataArray > xChartData ( xChartDoc->getData(), uno::UNO_QUERY_THROW);
- CPPUNIT_ASSERT(xChartData.is());
uno::Sequence < OUString > seriesList = xChartData->getColumnDescriptions();
return seriesList;
}