From 5708534b942c1d0ce384f6a8473da6bb569410e7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 7 Jun 2018 13:03:58 +0200 Subject: 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 Reviewed-by: Tor Lillqvist Reviewed-by: Mike Kaganski --- chart2/qa/extras/chart2_trendcalculators.cxx | 1 - chart2/qa/extras/chart2dump/chart2dump.cxx | 19 --- chart2/qa/extras/chart2export.cxx | 3 - chart2/qa/extras/chart2import.cxx | 12 -- chart2/qa/extras/charttest.hxx | 28 --- .../chartapiwrapper/ChartDocumentWrapper.cxx | 42 ++--- .../source/model/main/ChartModel_Persistence.cxx | 1 - .../source/model/template/StockDataInterpreter.cxx | 1 - chart2/source/tools/AxisHelper.cxx | 75 ++++---- chart2/source/tools/ChartTypeHelper.cxx | 3 +- chart2/source/tools/DiagramHelper.cxx | 2 - chart2/source/view/main/ChartView.cxx | 3 +- comphelper/source/misc/documentinfo.cxx | 1 - connectivity/source/commontools/dbtools.cxx | 15 +- .../source/drivers/component/CDatabaseMetaData.cxx | 1 - connectivity/source/drivers/hsqldb/HConnection.cxx | 3 +- dbaccess/qa/extras/dialog-save.cxx | 9 - dbaccess/qa/extras/empty-stdlib-save.cxx | 9 - dbaccess/qa/extras/nolib-save.cxx | 9 - dbaccess/source/ui/misc/databaseobjectview.cxx | 13 +- dbaccess/source/ui/tabledesign/TableController.cxx | 1 - embeddedobj/source/msole/olepersist.cxx | 3 +- extensions/source/abpilot/datasourcehandling.cxx | 15 +- filter/source/svg/svgwriter.cxx | 189 ++++++++++----------- forms/source/runtime/formoperations.cxx | 1 - framework/source/dispatch/closedispatcher.cxx | 11 +- oox/source/export/chartexport.cxx | 3 +- oox/source/export/drawingml.cxx | 2 +- oox/source/ppt/slidepersist.cxx | 2 +- package/source/xstor/xstorage.cxx | 3 +- pyuno/source/module/pyuno_module.cxx | 1 - reportdesign/source/core/api/FormattedField.cxx | 15 +- reportdesign/source/filter/xml/xmlExport.cxx | 3 - .../source/filter/xml/xmlImportDocumentHandler.cxx | 2 +- reportdesign/source/filter/xml/xmlfilter.cxx | 13 +- reportdesign/source/ui/dlg/Navigator.cxx | 1 - sc/qa/extras/check_data_pilot_field.cxx | 1 - sc/qa/extras/check_data_pilot_table.cxx | 1 - sc/qa/extras/check_xcell_ranges_query.cxx | 1 - sc/qa/extras/new_cond_format.cxx | 1 - sc/qa/extras/regression-test.cxx | 8 - sc/qa/extras/scannotationobj.cxx | 2 - sc/qa/extras/scannotationshapeobj.cxx | 1 - sc/qa/extras/scannotationsobj.cxx | 3 - sc/qa/extras/scarealinkobj.cxx | 1 - sc/qa/extras/scarealinksobj.cxx | 1 - sc/qa/extras/scautoformatobj.cxx | 1 - sc/qa/extras/sccellcursorobj.cxx | 2 - sc/qa/extras/sccellobj.cxx | 1 - sc/qa/extras/sccellrangeobj.cxx | 9 - sc/qa/extras/sccellrangesobj.cxx | 1 - sc/qa/extras/scconsolidationdescriptorobj.cxx | 1 - sc/qa/extras/scdatabaserangeobj.cxx | 1 - sc/qa/extras/scdatabaserangesobj.cxx | 1 - sc/qa/extras/scdatapilotfieldobj.cxx | 4 - sc/qa/extras/scdatapilotitemobj.cxx | 1 - sc/qa/extras/scdatapilottableobj.cxx | 5 - sc/qa/extras/scdatapilottablesobj.cxx | 2 - sc/qa/extras/scddelinkobj.cxx | 1 - sc/qa/extras/scdocumentconfigurationobj.cxx | 2 - sc/qa/extras/scfilterdescriptorbaseobj.cxx | 1 - sc/qa/extras/scfunctiondescriptionobj.cxx | 1 - sc/qa/extras/scfunctionlistobj.cxx | 2 - sc/qa/extras/scheaderfootercontentobj.cxx | 1 - sc/qa/extras/scimportdescriptorbaseobj.cxx | 2 - sc/qa/extras/sclabelrangeobj.cxx | 1 - sc/qa/extras/sclabelrangesobj.cxx | 1 - sc/qa/extras/scmodelobj.cxx | 1 - sc/qa/extras/scoutlineobj.cxx | 1 - sc/qa/extras/screcentfunctionsobj.cxx | 2 - sc/qa/extras/scscenariosobj.cxx | 1 - sc/qa/extras/scshapeobj.cxx | 3 - sc/qa/extras/scsheetlinkobj.cxx | 1 - sc/qa/extras/scsortdescriptorbaseobj.cxx | 2 - sc/qa/extras/scspreadsheetsettings.cxx | 2 - sc/qa/extras/scspreadsheetsettingsobj.cxx | 2 - sc/qa/extras/scsubtotaldescriptorbaseobj.cxx | 1 - sc/qa/extras/scsubtotalfieldobj.cxx | 2 - sc/qa/extras/sctableconditionalentryobj.cxx | 1 - sc/qa/extras/sctableconditionalformatobj.cxx | 1 - sc/qa/extras/sctablesheetobj.cxx | 4 - sc/qa/extras/sctablevalidationobj.cxx | 1 - sc/qa/extras/sctabviewobj.cxx | 2 - sc/qa/extras/scviewpaneobj.cxx | 1 - sc/qa/perf/scperfobj.cxx | 21 --- sc/qa/unit/subsequent_filters-test.cxx | 3 - sc/source/ui/docshell/macromgr.cxx | 15 +- sc/source/ui/vba/vbapagesetup.cxx | 96 ++++------- sc/source/ui/vba/vbarange.cxx | 29 ++-- sc/source/ui/vba/vbastyles.cxx | 9 +- sc/source/ui/vba/vbaworksheet.cxx | 32 ++-- sd/qa/unit/activex-controls-tests.cxx | 35 ---- sd/qa/unit/import-tests.cxx | 1 - sd/qa/unit/sdmodeltestbase.hxx | 4 - sd/source/core/CustomAnimationEffect.cxx | 8 +- sd/source/filter/eppt/pptexanimations.cxx | 2 +- sd/source/ui/animations/CustomAnimationPane.cxx | 9 +- sd/source/ui/presenter/PresenterTextView.cxx | 8 +- sd/source/ui/table/TableDesignPane.cxx | 35 ++-- sd/source/ui/unoidl/unopage.cxx | 33 ++-- sdext/source/minimizer/graphiccollector.cxx | 63 ++++--- sdext/source/presenter/PresenterButton.cxx | 5 +- sdext/source/presenter/PresenterScrollBar.cxx | 5 +- sdext/source/presenter/PresenterSlideShowView.cxx | 8 +- sdext/source/presenter/PresenterSlideSorter.cxx | 3 +- sfx2/source/appl/appmisc.cxx | 8 +- sfx2/source/bastyp/frmhtmlw.cxx | 1 - sfx2/source/doc/SfxDocumentMetaData.cxx | 4 - sfx2/source/doc/docfile.cxx | 3 +- sfx2/source/doc/docinf.cxx | 1 - svx/source/core/graphichelper.cxx | 7 +- svx/source/svdraw/charthelper.cxx | 13 +- svx/source/table/tablecontroller.cxx | 2 +- svx/source/table/tablelayouter.cxx | 2 +- svx/source/xml/xmlxtimp.cxx | 8 +- sw/qa/api/XTextContentTest.hxx | 5 +- sw/qa/core/macros-test.cxx | 5 - sw/source/filter/ww8/docxattributeoutput.cxx | 36 ++-- sw/source/ui/dbui/mmoutputtypepage.cxx | 11 +- sw/source/ui/vba/vbadocuments.cxx | 5 +- sw/source/uibase/sidebar/PageMarginControl.cxx | 7 +- .../uibase/sidebar/PageOrientationControl.cxx | 7 +- test/source/container/xindexaccess.cxx | 2 - test/source/container/xnamereplace.cxx | 1 - test/source/sheet/tableautoformatfield.cxx | 3 - test/source/sheet/xconsolidatable.cxx | 2 - test/source/sheet/xdatabaserange.cxx | 1 - test/source/sheet/xdatapilotdescriptor.cxx | 3 - test/source/sheet/xdatapilottable2.cxx | 1 - test/source/sheet/xdatapilottables.cxx | 1 - test/source/sheet/xdatapilottablessupplier.cxx | 1 - test/source/sheet/xscenariossupplier.cxx | 2 - test/source/sheet/xsheetannotationssupplier.cxx | 1 - test/source/sheet/xspreadsheet.cxx | 2 - test/source/sheet/xspreadsheets2.cxx | 3 - vbahelper/source/vbahelper/vbaapplicationbase.cxx | 32 ++-- vcl/source/bitmap/BitmapTools.cxx | 6 +- vcl/source/gdi/vectorgraphicdata.cxx | 6 +- writerfilter/source/dmapper/DomainMapper.cxx | 3 +- writerfilter/source/dmapper/GraphicImport.cxx | 2 - writerfilter/source/filter/RtfFilter.cxx | 4 - writerfilter/source/filter/WriterFilter.cxx | 2 - xmloff/source/chart/SchXMLExport.cxx | 3 +- xmloff/source/chart/SchXMLSeries2Context.cxx | 11 +- xmloff/source/draw/ximpshap.cxx | 27 +-- xmlscript/source/xmldlg_imexp/imp_share.hxx | 3 +- xmlsecurity/qa/unit/signing/signing.cxx | 2 - 147 files changed, 388 insertions(+), 889 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 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 xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); uno::Reference 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(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 xIndexAccess(xGrid, UNO_QUERY_THROW); uno::Reference 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 xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); uno::Reference 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 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 xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); uno::Reference 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 xDrawPageSupplier(xChartDoc, uno::UNO_QUERY); uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); uno::Reference 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 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 XPoint(XPointContainer->getByIndex(0), UNO_QUERY_THROW); uno::Reference 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 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 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 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 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 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 xIndexAccess(xXAxis, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xIndexAccess.is()); // Check text uno::Reference 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 getTablePivotChartsFromSheet(sal_Int32 nSheet, uno::Reference const & xComponent) { uno::Reference xDoc(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDoc.is()); uno::Reference xIA(xDoc->getSheets(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xIA.is()); uno::Reference xChartSupplier(xIA->getByIndex(nSheet), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xChartSupplier.is()); uno::Reference xTablePivotCharts = xChartSupplier->getPivotCharts(); CPPUNIT_ASSERT(xTablePivotCharts.is()); @@ -239,13 +229,10 @@ Reference getPivotChartCompFromSheet(sal_Int32 nSheet, uno::Re uno::Reference xIACharts(xTablePivotCharts, UNO_QUERY_THROW); uno::Reference xTablePivotChart(xIACharts->getByIndex(0), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xTablePivotChart.is()); uno::Reference xEmbObjectSupplier(xTablePivotChart, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xEmbObjectSupplier.is()); uno::Reference xChartComp(xEmbObjectSupplier->getEmbeddedObject(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xChartComp.is()); return xChartComp; } @@ -253,7 +240,6 @@ Reference getPivotChartCompFromSheet(sal_Int32 nSheet, uno::Re Reference getPivotChartDocFromSheet(sal_Int32 nSheet, uno::Reference const & xComponent) { uno::Reference xChartDoc(getPivotChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xChartDoc.is()); return xChartDoc; } @@ -261,16 +247,12 @@ Reference getPivotChartDocFromSheet(uno::Reference xIACharts(xTablePivotCharts, UNO_QUERY_THROW); uno::Reference xTablePivotChart(xIACharts->getByIndex(nIndex), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xTablePivotChart.is()); uno::Reference xEmbObjectSupplier(xTablePivotChart, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xEmbObjectSupplier.is()); uno::Reference xChartComp(xEmbObjectSupplier->getEmbeddedObject(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xChartComp.is()); uno::Reference 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 getAxisFromDoc( CPPUNIT_ASSERT(xDiagram.is()); Reference xCooSysContainer(xDiagram, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xCooSysContainer.is()); Sequence > xCooSysSequence = xCooSysContainer->getCoordinateSystems(); CPPUNIT_ASSERT(xCooSysSequence.getLength() > nCooSys); @@ -323,7 +302,6 @@ sal_Int32 getNumberOfDataSeries(uno::Reference const & x { Reference xChartType = getChartTypeFromDoc(xChartDoc, nChartType, nCooSys); Reference xDataSeriesContainer(xChartType, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDataSeriesContainer.is()); uno::Sequence> xSeriesSequence(xDataSeriesContainer->getDataSeries()); return xSeriesSequence.getLength(); @@ -335,7 +313,6 @@ Reference< chart2::XDataSeries > getDataSeriesFromDoc(uno::Reference 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 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 ChartTest::getChartDocFromDrawImpress( uno::Reference xPage( xPages->getDrawPages()->getByIndex(nPage), uno::UNO_QUERY_THROW); - if (!xPage.is()) - return xEmpty; uno::Reference 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; } diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index 94d74b0eefe3..5a80655bae99 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -1253,25 +1253,22 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( { Reference< lang::XMultiServiceFactory > xFact( m_spChart2ModelContact->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - if( xFact.is() ) + Reference< lang::XInitialization > xViewInit( xFact->createInstance( + CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY ); + if(xViewInit.is()) { - Reference< lang::XInitialization > xViewInit( xFact->createInstance( - CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY ); - if(xViewInit.is()) + try { - try - { - m_xChartView = xViewInit; - - Sequence< Any > aArguments(2); - aArguments[0] <<= Reference(this); - aArguments[1] <<= true; // bRefreshAddIn - xViewInit->initialize(aArguments); - } - catch (const uno::Exception&) - { - DBG_UNHANDLED_EXCEPTION("chart2"); - } + m_xChartView = xViewInit; + + Sequence< Any > aArguments(2); + aArguments[0] <<= Reference(this); + aArguments[1] <<= true; // bRefreshAddIn + xViewInit->initialize(aArguments); + } + catch (const uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION("chart2"); } } } @@ -1316,14 +1313,11 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance( { Reference< lang::XMultiServiceFactory > xFact( m_spChart2ModelContact->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - if( xFact.is() ) + uno::Reference< util::XRefreshable > xAddIn( + xFact->createInstance( aServiceSpecifier ), uno::UNO_QUERY ); + if( xAddIn.is() ) { - uno::Reference< util::XRefreshable > xAddIn( - xFact->createInstance( aServiceSpecifier ), uno::UNO_QUERY ); - if( xAddIn.is() ) - { - xResult = xAddIn; - } + xResult = xAddIn; } } catch (const uno::Exception&) diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx index cdc0d0338a02..dabde5d32ba4 100644 --- a/chart2/source/model/main/ChartModel_Persistence.cxx +++ b/chart2/source/model/main/ChartModel_Persistence.cxx @@ -129,7 +129,6 @@ Reference< embed::XStorage > lcl_createStorage( aStorageArgs[2] <<= rMediaDescriptor; xStorage.set( xStorageFact->createInstanceWithArguments( aStorageArgs ), uno::UNO_QUERY_THROW ); - OSL_ENSURE( xStorage.is(), "No Storage" ); } catch(const css::ucb::ContentCreationException&) { diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx index f766d41aaed9..a6db346a44ea 100644 --- a/chart2/source/model/template/StockDataInterpreter.cxx +++ b/chart2/source/model/template/StockDataInterpreter.cxx @@ -240,7 +240,6 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource( xSeries.set( new DataSeries ); OSL_ASSERT( xSeries.is() ); Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY_THROW ); - OSL_ASSERT( xSink.is() ); xSink->setData( aSequences[nGroupIndex][nSeriesIdx] ); aResultSeries[nGroupIndex][nSeriesIdx].set( xSeries ); } diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 84c008612332..4a9cf9218641 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -239,52 +239,49 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( try { Reference< XChartTypeContainer > xCTCnt( xCorrespondingCoordinateSystem, uno::UNO_QUERY_THROW ); - if( xCTCnt.is() ) + OUString aRoleToMatch; + if( nDimensionIndex == 0 ) + aRoleToMatch = "values-x"; + Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes()); + for( sal_Int32 nCTIdx=0; nCTIdx > aChartTypes( xCTCnt->getChartTypes()); - for( sal_Int32 nCTIdx=0; nCTIdx xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW ); + Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries()); + for( sal_Int32 nSeriesIdx=0; nSeriesIdx xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW ); - Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries()); - for( sal_Int32 nSeriesIdx=0; nSeriesIdx xDataSeries(aDataSeriesSeq[nSeriesIdx]); - Reference< data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY_THROW ); + Reference< chart2::XDataSeries > xDataSeries(aDataSeriesSeq[nSeriesIdx]); + Reference< data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY_THROW ); - if( nDimensionIndex == 1 ) - { - //only take those series into account that are attached to this axis - sal_Int32 nAttachedAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries); - if( nAttachedAxisIndex != nAxisIndex ) - continue; - } + if( nDimensionIndex == 1 ) + { + //only take those series into account that are attached to this axis + sal_Int32 nAttachedAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries); + if( nAttachedAxisIndex != nAxisIndex ) + continue; + } - Reference< data::XLabeledDataSequence > xLabeledSeq( - DataSeriesHelper::getDataSequenceByRole( xSource, aRoleToMatch ) ); + Reference< data::XLabeledDataSequence > xLabeledSeq( + DataSeriesHelper::getDataSequenceByRole( xSource, aRoleToMatch ) ); - if( !xLabeledSeq.is() && nDimensionIndex==0 ) - { - ScaleData aData = xAxis->getScaleData(); - xLabeledSeq = aData.Categories; - } + if( !xLabeledSeq.is() && nDimensionIndex==0 ) + { + ScaleData aData = xAxis->getScaleData(); + xLabeledSeq = aData.Categories; + } - if( xLabeledSeq.is() ) + if( xLabeledSeq.is() ) + { + Reference< data::XDataSequence > xSeq( xLabeledSeq->getValues()); + if( xSeq.is() ) { - Reference< data::XDataSequence > xSeq( xLabeledSeq->getValues()); - if( xSeq.is() ) - { - sal_Int32 nKey = xSeq->getNumberFormatKeyByIndex( -1 ); - // initialize the value - if( aKeyMap.find( nKey ) == aKeyMap.end()) - aKeyMap[ nKey ] = 0; - // increase frequency - aKeyMap[ nKey ] = (aKeyMap[ nKey ] + 1); - } + sal_Int32 nKey = xSeq->getNumberFormatKeyByIndex( -1 ); + // initialize the value + if( aKeyMap.find( nKey ) == aKeyMap.end()) + aKeyMap[ nKey ] = 0; + // increase frequency + aKeyMap[ nKey ] = (aKeyMap[ nKey ] + 1); } } } diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx index 23aa42efed73..658855d6380b 100644 --- a/chart2/source/tools/ChartTypeHelper.cxx +++ b/chart2/source/tools/ChartTypeHelper.cxx @@ -248,8 +248,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const { bool bDonut = false; uno::Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY_THROW ); - if(xChartTypeProp.is()) - xChartTypeProp->getPropertyValue( "UseRings") >>= bDonut; + xChartTypeProp->getPropertyValue( "UseRings") >>= bDonut; if(!bDonut) { diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 801c40e2ce52..652a4e468841 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -578,8 +578,6 @@ bool DiagramHelper::attachSeriesToAxis( bool bAttachToMainAxis //set property at axis Reference< beans::XPropertySet > xProp( xDataSeries, uno::UNO_QUERY_THROW ); - if( !xProp.is() ) - return bChanged; sal_Int32 nNewAxisIndex = bAttachToMainAxis ? 0 : 1; sal_Int32 nOldAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 22f268b19a4a..259b58ce7779 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -1808,8 +1808,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D bool bPosSizeExcludeAxesProperty = true; uno::Reference< beans::XPropertySet > xDiaProps( xDiagram, uno::UNO_QUERY_THROW ); - if( xDiaProps.is() ) - xDiaProps->getPropertyValue("PosSizeExcludeAxes") >>= bPosSizeExcludeAxesProperty; + xDiaProps->getPropertyValue("PosSizeExcludeAxes") >>= bPosSizeExcludeAxesProperty; if (rParam.mbUseFixedInnerSize || bPosSizeExcludeAxesProperty) { aPos = awt::Point( m_aResultingDiagramRectangleExcludingAxes.X, m_aResultingDiagramRectangleExcludingAxes.Y ); diff --git a/comphelper/source/misc/documentinfo.cxx b/comphelper/source/misc/documentinfo.cxx index b63450590554..a2c0e7140c33 100644 --- a/comphelper/source/misc/documentinfo.cxx +++ b/comphelper/source/misc/documentinfo.cxx @@ -101,7 +101,6 @@ namespace comphelper { { Reference< XDocumentProperties > xDocProps ( xDPS->getDocumentProperties(), UNO_QUERY_THROW ); - OSL_ENSURE(xDocProps.is(), "no DocumentProperties"); sTitle = xDocProps->getTitle(); if ( !sTitle.isEmpty() ) return sTitle; diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 1540b49840e4..3a32d21e5a77 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -485,16 +485,13 @@ Reference< XNameAccess> getPrimaryKeyColumns_throw(const Reference< XPropertySet for(sal_Int32 i = 0;i< nCount;++i) { xProp.set(xKeys->getByIndex(i),UNO_QUERY_THROW); - if ( xProp.is() ) + sal_Int32 nKeyType = 0; + xProp->getPropertyValue(sPropName) >>= nKeyType; + if(KeyType::PRIMARY == nKeyType) { - sal_Int32 nKeyType = 0; - xProp->getPropertyValue(sPropName) >>= nKeyType; - if(KeyType::PRIMARY == nKeyType) - { - const Reference xKeyColsSup(xProp,UNO_QUERY_THROW); - xKeyColumns = xKeyColsSup->getColumns(); - break; - } + const Reference xKeyColsSup(xProp,UNO_QUERY_THROW); + xKeyColumns = xKeyColsSup->getColumns(); + break; } } } diff --git a/connectivity/source/drivers/component/CDatabaseMetaData.cxx b/connectivity/source/drivers/component/CDatabaseMetaData.cxx index 7834e53c18b7..a2edb795fc1e 100644 --- a/connectivity/source/drivers/component/CDatabaseMetaData.cxx +++ b/connectivity/source/drivers/component/CDatabaseMetaData.cxx @@ -152,7 +152,6 @@ Reference< XResultSet > SAL_CALL OComponentDatabaseMetaData::getColumns( if(match(tableNamePattern,*pTabIter,'\0')) { const Reference< XColumnsSupplier> xTable(xNames->getByName(*pTabIter),UNO_QUERY_THROW); - OSL_ENSURE(xTable.is(),"Table not found! Normally a exception had to be thrown here!"); aRow[3] = new ORowSetValueDecorator(*pTabIter); const Reference< XNameAccess> xColumns = xTable->getColumns(); diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx index 04d58a33a1b3..4b43df187eda 100644 --- a/connectivity/source/drivers/hsqldb/HConnection.cxx +++ b/connectivity/source/drivers/hsqldb/HConnection.cxx @@ -247,8 +247,7 @@ namespace connectivity { namespace hsqldb try { Reference< XNameAccess > xTables( impl_getTableContainer_throw(), UNO_QUERY_THROW ); - if ( xTables.is() ) - bDoesExist = xTables->hasByName( _rTableName ); + bDoesExist = xTables->hasByName( _rTableName ); } catch( const Exception& ) { diff --git a/dbaccess/qa/extras/dialog-save.cxx b/dbaccess/qa/extras/dialog-save.cxx index e9194a0e6e7d..eb1095fe4ba7 100644 --- a/dbaccess/qa/extras/dialog-save.cxx +++ b/dbaccess/qa/extras/dialog-save.cxx @@ -72,17 +72,13 @@ void DialogSaveTest::test() uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName); CPPUNIT_ASSERT(xComponent.is()); uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocScr.is()); uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries()); CPPUNIT_ASSERT(xStorBasLib.is()); uno::Reference< script::XLibraryContainer > xBasLib(xStorBasLib, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xBasLib.is()); uno::Reference< script::XStorageBasedLibraryContainer > xStorDlgLib(xDocScr->getDialogLibraries()); CPPUNIT_ASSERT(xStorDlgLib.is()); uno::Reference< script::XLibraryContainer > xDlgLib(xStorDlgLib, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDlgLib.is()); xBasLib->loadLibrary(sStandard); CPPUNIT_ASSERT(xBasLib->isLibraryLoaded(sStandard)); // the whole point of this test is to test the "save" operation @@ -91,12 +87,10 @@ void DialogSaveTest::test() // make some change to enable a save // uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSuppl(xComponent, UNO_QUERY_THROW); - // CPPUNIT_ASSERT(xDocPropSuppl.is()); // uno::Reference< document::XDocumentPropertiesSupplier > xDocProps(xDocPropSuppl->getDocumentProperties()); // CPPUNIT_ASSERT(xDocProps.is()); // xDocProps.setTitle(xDocProps.getTitle() + " suffix"); uno::Reference< util::XModifiable > xDocMod(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocMod.is()); xDocMod->setModified(true); // now save; the code path to exercise in this test is the "store to same location" @@ -105,7 +99,6 @@ void DialogSaveTest::test() // close uno::Reference< util::XCloseable > xDocCloseable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocCloseable.is()); xDocCloseable->close(false); // All our uno::References are (should?) be invalid now -> let them go out of scope @@ -114,9 +107,7 @@ void DialogSaveTest::test() uno::Sequence args(1); args[0] <<= aFileName; Reference xHNA(getMultiServiceFactory()->createInstanceWithArguments("com.sun.star.packages.Package", args), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xHNA.is()); Reference< beans::XPropertySet > xPS(xHNA->getByHierarchicalName("Dialogs/Standard/Dialog1.xml"), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xPS.is()); sal_Int64 nSize = 0; CPPUNIT_ASSERT(xPS->getPropertyValue("Size") >>= nSize); CPPUNIT_ASSERT(nSize != 0); diff --git a/dbaccess/qa/extras/empty-stdlib-save.cxx b/dbaccess/qa/extras/empty-stdlib-save.cxx index 648ffb29a1ef..86f381cf8519 100644 --- a/dbaccess/qa/extras/empty-stdlib-save.cxx +++ b/dbaccess/qa/extras/empty-stdlib-save.cxx @@ -72,17 +72,13 @@ void DialogSaveTest::test() uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName); CPPUNIT_ASSERT(xComponent.is()); uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocScr.is()); uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries()); CPPUNIT_ASSERT(xStorBasLib.is()); uno::Reference< script::XLibraryContainer > xBasLib(xStorBasLib, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xBasLib.is()); uno::Reference< script::XStorageBasedLibraryContainer > xStorDlgLib(xDocScr->getDialogLibraries()); CPPUNIT_ASSERT(xStorDlgLib.is()); uno::Reference< script::XLibraryContainer > xDlgLib(xStorDlgLib, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDlgLib.is()); xBasLib->loadLibrary(sStandard); xDlgLib->loadLibrary(sStandard); CPPUNIT_ASSERT(xBasLib->isLibraryLoaded(sStandard)); @@ -102,15 +98,12 @@ void DialogSaveTest::test() xI->removeByName("Dialog1"); // uno::Reference< util::XModifiable > xDlgMod(xDlgLib, UNO_QUERY_THROW); - // CPPUNIT_ASSERT(xDlgMod.is()); // xDlgMod->setModified(sal_True); // uno::Reference< util::XModifiable > xScrMod(xDocScr, UNO_QUERY_THROW); - // CPPUNIT_ASSERT(xScrMod.is()); // xScrMod->setModified(sal_True); // uno::Reference< util::XModifiable > xDocMod(xComponent, UNO_QUERY_THROW); - // CPPUNIT_ASSERT(xDocMod.is()); // std::cerr << "** Modified: " << static_cast(xDocMod->isModified()) << std::endl; // xDocMod->setModified(sal_True); // std::cerr << "** Modified: " << static_cast(xDocMod->isModified()) << std::endl; @@ -122,7 +115,6 @@ void DialogSaveTest::test() // close uno::Reference< util::XCloseable > xDocCloseable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocCloseable.is()); xDocCloseable->close(false); // All our uno::References are (should?) be invalid now -> let them go out of scope @@ -131,7 +123,6 @@ void DialogSaveTest::test() uno::Sequence args(1); args[0] <<= aFileName; Reference xHNA(getMultiServiceFactory()->createInstanceWithArguments("com.sun.star.packages.Package", args), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xHNA.is()); CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Basic/Standard")); CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Dialogs/Standard")); } diff --git a/dbaccess/qa/extras/nolib-save.cxx b/dbaccess/qa/extras/nolib-save.cxx index e42784c9800d..f5e4ae59b837 100644 --- a/dbaccess/qa/extras/nolib-save.cxx +++ b/dbaccess/qa/extras/nolib-save.cxx @@ -72,17 +72,13 @@ void DialogSaveTest::test() uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName); CPPUNIT_ASSERT(xComponent.is()); uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocScr.is()); uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries()); CPPUNIT_ASSERT(xStorBasLib.is()); uno::Reference< script::XLibraryContainer > xBasLib(xStorBasLib, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xBasLib.is()); uno::Reference< script::XStorageBasedLibraryContainer > xStorDlgLib(xDocScr->getDialogLibraries()); CPPUNIT_ASSERT(xStorDlgLib.is()); uno::Reference< script::XLibraryContainer > xDlgLib(xStorDlgLib, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDlgLib.is()); xBasLib->loadLibrary(sStandard); xDlgLib->loadLibrary(sStandard); CPPUNIT_ASSERT(xBasLib->isLibraryLoaded(sStandard)); @@ -92,15 +88,12 @@ void DialogSaveTest::test() xDlgLib->removeLibrary(sStandard); // uno::Reference< util::XModifiable > xDlgMod(xDlgLib, UNO_QUERY_THROW); - // CPPUNIT_ASSERT(xDlgMod.is()); // xDlgMod->setModified(sal_True); // uno::Reference< util::XModifiable > xScrMod(xDocScr, UNO_QUERY_THROW); - // CPPUNIT_ASSERT(xScrMod.is()); // xScrMod->setModified(sal_True); // uno::Reference< util::XModifiable > xDocMod(xComponent, UNO_QUERY_THROW); - // CPPUNIT_ASSERT(xDocMod.is()); // std::cerr << "** Modified: " << static_cast(xDocMod->isModified()) << std::endl; // xDocMod->setModified(sal_True); // std::cerr << "** Modified: " << static_cast(xDocMod->isModified()) << std::endl; @@ -112,7 +105,6 @@ void DialogSaveTest::test() // close uno::Reference< util::XCloseable > xDocCloseable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocCloseable.is()); xDocCloseable->close(false); // All our uno::References are (should?) be invalid now -> let them go out of scope @@ -121,7 +113,6 @@ void DialogSaveTest::test() uno::Sequence args(1); args[0] <<= aFileName; Reference xHNA(getMultiServiceFactory()->createInstanceWithArguments("com.sun.star.packages.Package", args), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xHNA.is()); CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Basic/Standard")); CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName("Dialogs/Standard")); } diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 676b26cbf92f..e68f17ffd3ca 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -232,16 +232,9 @@ namespace dbaui // try whether the designer is a dialog Reference< XExecutableDialog > xDialog( xDesigner, UNO_QUERY_THROW ); - if ( xDialog.is() ) - { - try { AsyncDialogExecutor::executeModalDialogAsync( xDialog ); } - catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); } - return nullptr; - } - - Reference< XComponent > xDesignerComponent( xDesigner, UNO_QUERY ); - OSL_ENSURE( xDesignerComponent.is(), "TableDesigner::doCreateView: a designer which is no dialog and no component?" ); - return xDesignerComponent; + try { AsyncDialogExecutor::executeModalDialogAsync( xDialog ); } + catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); } + return nullptr; } Reference< XInterface > TableDesigner::impl_getConnectionProvidedDesigner_nothrow( const OUString& _rTableName ) diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 71c6e722fecc..51898df9ff0b 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -961,7 +961,6 @@ bool OTableController::checkColumns(bool _bNew) void OTableController::alterColumns() { Reference xColSup(m_xTable,UNO_QUERY_THROW); - OSL_ENSURE(xColSup.is(),"What happen here?!"); Reference xColumns = xColSup->getColumns(); Reference xIdxColumns(xColumns,UNO_QUERY_THROW); diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index b60c0299a561..73434da6092b 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -372,8 +372,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea uno::UNO_QUERY_THROW ); uno::Reference< io::XSeekable > xCachedSeek( xCachedVisualRepresentation, uno::UNO_QUERY_THROW ); - if ( xCachedSeek.is() ) - xCachedSeek->seek( 0 ); + xCachedSeek->seek( 0 ); uno::Reference < io::XStream > xTempFile( io::TempFile::create(comphelper::getComponentContext(m_xFactory)), diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index eb149ea4b106..0923e9902943 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -203,16 +203,13 @@ namespace abp // create the UNO context m_pImpl->xContext.set( lcl_getDataSourceContext( _rxORB ), UNO_QUERY_THROW ); - if (m_pImpl->xContext.is()) - { - // collect the data source names - Sequence< OUString > aDSNames = m_pImpl->xContext->getElementNames(); - const OUString* pDSNames = aDSNames.getConstArray(); - const OUString* pDSNamesEnd = pDSNames + aDSNames.getLength(); + // collect the data source names + Sequence< OUString > aDSNames = m_pImpl->xContext->getElementNames(); + const OUString* pDSNames = aDSNames.getConstArray(); + const OUString* pDSNamesEnd = pDSNames + aDSNames.getLength(); - for ( ;pDSNames != pDSNamesEnd; ++pDSNames ) - m_pImpl->aDataSourceNames.insert( *pDSNames ); - } + for ( ;pDSNames != pDSNamesEnd; ++pDSNames ) + m_pImpl->aDataSourceNames.insert( *pDSNames ); } catch( const Exception& ) { diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 9cbe2b24e3ee..7f740aa7a0c0 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -948,143 +948,140 @@ bool SVGTextWriter::nextParagraph() if( xTextContent.is() ) { Reference< XServiceInfo > xServiceInfo( xTextContent, UNO_QUERY_THROW ); - if( xServiceInfo.is() ) - { #if OSL_DEBUG_LEVEL > 0 - OUString sInfo; + OUString sInfo; #endif - if( xServiceInfo->supportsService( "com.sun.star.text.Paragraph" ) ) + if( xServiceInfo->supportsService( "com.sun.star.text.Paragraph" ) ) + { + mrCurrentTextParagraph.set( xTextContent ); + Reference< XPropertySet > xPropSet( xTextContent, UNO_QUERY_THROW ); + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if( xPropSetInfo->hasPropertyByName( "NumberingLevel" ) ) { - mrCurrentTextParagraph.set( xTextContent ); - Reference< XPropertySet > xPropSet( xTextContent, UNO_QUERY_THROW ); - Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( "NumberingLevel" ) ) + sal_Int16 nListLevel = 0; + if( xPropSet->getPropertyValue( "NumberingLevel" ) >>= nListLevel ) { - sal_Int16 nListLevel = 0; - if( xPropSet->getPropertyValue( "NumberingLevel" ) >>= nListLevel ) - { - mbIsNewListItem = true; + mbIsNewListItem = true; #if OSL_DEBUG_LEVEL > 0 - sInfo = "NumberingLevel: " + OUString::number( nListLevel ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "style", sInfo ); + sInfo = "NumberingLevel: " + OUString::number( nListLevel ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "style", sInfo ); #endif - Reference< XIndexReplace > xNumRules; - if( xPropSetInfo->hasPropertyByName( "NumberingRules" ) ) - { - xPropSet->getPropertyValue( "NumberingRules" ) >>= xNumRules; - } - if( xNumRules.is() && ( nListLevel < xNumRules->getCount() ) ) + Reference< XIndexReplace > xNumRules; + if( xPropSetInfo->hasPropertyByName( "NumberingRules" ) ) + { + xPropSet->getPropertyValue( "NumberingRules" ) >>= xNumRules; + } + if( xNumRules.is() && ( nListLevel < xNumRules->getCount() ) ) + { + bool bIsNumbered = true; + OUString sNumberingIsNumber("NumberingIsNumber"); + if( xPropSetInfo->hasPropertyByName( sNumberingIsNumber ) ) { - bool bIsNumbered = true; - OUString sNumberingIsNumber("NumberingIsNumber"); - if( xPropSetInfo->hasPropertyByName( sNumberingIsNumber ) ) + if( !(xPropSet->getPropertyValue( sNumberingIsNumber ) >>= bIsNumbered ) ) { - if( !(xPropSet->getPropertyValue( sNumberingIsNumber ) >>= bIsNumbered ) ) - { - OSL_FAIL( "numbered paragraph without number info" ); - bIsNumbered = false; - } + OSL_FAIL( "numbered paragraph without number info" ); + bIsNumbered = false; + } #if OSL_DEBUG_LEVEL > 0 - if( bIsNumbered ) - { - sInfo = "true"; - mrExport.AddAttribute( XML_NAMESPACE_NONE, "is-numbered", sInfo ); - } -#endif + if( bIsNumbered ) + { + sInfo = "true"; + mrExport.AddAttribute( XML_NAMESPACE_NONE, "is-numbered", sInfo ); } - mbIsNewListItem = bIsNumbered; +#endif + } + mbIsNewListItem = bIsNumbered; - if( bIsNumbered ) + if( bIsNumbered ) + { + Sequence aProps; + if( xNumRules->getByIndex( nListLevel ) >>= aProps ) { - Sequence aProps; - if( xNumRules->getByIndex( nListLevel ) >>= aProps ) + sal_Int16 eType = NumberingType::CHAR_SPECIAL; + sal_Unicode cBullet = 0xf095; + const sal_Int32 nCount = aProps.getLength(); + const PropertyValue* pPropArray = aProps.getConstArray(); + for( sal_Int32 i = 0; i < nCount; ++i ) { - sal_Int16 eType = NumberingType::CHAR_SPECIAL; - sal_Unicode cBullet = 0xf095; - const sal_Int32 nCount = aProps.getLength(); - const PropertyValue* pPropArray = aProps.getConstArray(); - for( sal_Int32 i = 0; i < nCount; ++i ) + const PropertyValue& rProp = pPropArray[i]; + if( rProp.Name == "NumberingType" ) { - const PropertyValue& rProp = pPropArray[i]; - if( rProp.Name == "NumberingType" ) - { - rProp.Value >>= eType; - } - else if( rProp.Name == "BulletChar" ) + rProp.Value >>= eType; + } + else if( rProp.Name == "BulletChar" ) + { + OUString sValue; + rProp.Value >>= sValue; + if( !sValue.isEmpty() ) { - OUString sValue; - rProp.Value >>= sValue; - if( !sValue.isEmpty() ) - { - cBullet = sValue[0]; - } + cBullet = sValue[0]; } } - meNumberingType = eType; - mbIsListLevelStyleImage = ( NumberingType::BITMAP == meNumberingType ); - if( NumberingType::CHAR_SPECIAL == meNumberingType ) + } + meNumberingType = eType; + mbIsListLevelStyleImage = ( NumberingType::BITMAP == meNumberingType ); + if( NumberingType::CHAR_SPECIAL == meNumberingType ) + { + if( cBullet ) { - if( cBullet ) + if( cBullet < ' ' ) { - if( cBullet < ' ' ) - { - cBullet = 0xF000 + 149; - } - mcBulletChar = cBullet; + cBullet = 0xF000 + 149; + } + mcBulletChar = cBullet; #if OSL_DEBUG_LEVEL > 0 - sInfo = OUString::number( static_cast(cBullet) ); - mrExport.AddAttribute( XML_NAMESPACE_NONE, "bullet-char", sInfo ); + sInfo = OUString::number( static_cast(cBullet) ); + mrExport.AddAttribute( XML_NAMESPACE_NONE, "bullet-char", sInfo ); #endif - } - } + } } } - } - } - Reference< XEnumerationAccess > xEnumerationAccess( xTextContent, UNO_QUERY_THROW ); - Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY_THROW ); - if( xEnumeration.is() && xEnumeration->hasMoreElements() ) - { - mrTextPortionEnumeration.set( xEnumeration ); } -#if OSL_DEBUG_LEVEL > 0 - sInfo = "Paragraph"; -#endif } - else if( xServiceInfo->supportsService( "com.sun.star.text.Table" ) ) + + Reference< XEnumerationAccess > xEnumerationAccess( xTextContent, UNO_QUERY_THROW ); + Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY_THROW ); + if( xEnumeration.is() && xEnumeration->hasMoreElements() ) { - OSL_FAIL( "SVGTextWriter::nextParagraph: text tables are not handled." ); + mrTextPortionEnumeration.set( xEnumeration ); + } #if OSL_DEBUG_LEVEL > 0 - sInfo = "Table"; + sInfo = "Paragraph"; #endif - } - else - { - OSL_FAIL( "SVGTextWriter::nextParagraph: Unknown text content." ); - return false; - } + } + else if( xServiceInfo->supportsService( "com.sun.star.text.Table" ) ) + { + OSL_FAIL( "SVGTextWriter::nextParagraph: text tables are not handled." ); #if OSL_DEBUG_LEVEL > 0 - mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", sInfo ); - SvXMLElementExport aParaElem( mrExport, XML_NAMESPACE_NONE, "desc", mbIWS, mbIWS ); + sInfo = "Table"; #endif } else { - OSL_FAIL( "SVGTextWriter::nextParagraph: no XServiceInfo interface available for text content." ); + OSL_FAIL( "SVGTextWriter::nextParagraph: Unknown text content." ); return false; } +#if OSL_DEBUG_LEVEL > 0 + mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", sInfo ); + SvXMLElementExport aParaElem( mrExport, XML_NAMESPACE_NONE, "desc", mbIWS, mbIWS ); +#endif + } + else + { + OSL_FAIL( "SVGTextWriter::nextParagraph: no XServiceInfo interface available for text content." ); + return false; + } - const OUString& rParagraphId = implGetValidIDFromInterface( Reference(xTextContent, UNO_QUERY) ); - if( !rParagraphId.isEmpty() ) - { - mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", rParagraphId ); - } - return true; + const OUString& rParagraphId = implGetValidIDFromInterface( Reference(xTextContent, UNO_QUERY) ); + if( !rParagraphId.isEmpty() ) + { + mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", rParagraphId ); } + return true; } return false; diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index 0bd7486952ac..525aa803f83f 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -522,7 +522,6 @@ namespace frm // No control... do what we can with the models bool shouldCommit(true); Reference< XIndexAccess > xFormComps(xFrm, UNO_QUERY_THROW); - assert( xFormComps.is() ); const sal_Int32 cnt = xFormComps->getCount(); for(int i=0; i < cnt; ++i) diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index ed79058194ab..b986b9a9467f 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -381,13 +381,10 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void) try { css::uno::Reference< css::beans::XFastPropertySet > xSet( xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_QUICKLAUNCHER, xContext), css::uno::UNO_QUERY_THROW ); - if( xSet.is() ) - { - css::uno::Any aVal( xSet->getFastPropertyValue( 0 ) ); - bool bState = false; - if( aVal >>= bState ) - bQuickstarterRunning = bState; - } + css::uno::Any aVal( xSet->getFastPropertyValue( 0 ) ); + bool bState = false; + if( aVal >>= bState ) + bQuickstarterRunning = bState; } catch( const css::uno::Exception& ) { diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index d12827629794..c6f30fb5600a 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -230,8 +230,7 @@ bool lcl_isSeriesAttachedToFirstAxis( { sal_Int32 nAxisIndex = 0; Reference< beans::XPropertySet > xProp( xDataSeries, uno::UNO_QUERY_THROW ); - if( xProp.is() ) - xProp->getPropertyValue("AttachedAxisIndex") >>= nAxisIndex; + xProp->getPropertyValue("AttachedAxisIndex") >>= nAxisIndex; bResult = (0==nAxisIndex); } catch( const uno::Exception & ) diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 25ea475b2ac4..a7657c67d394 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1393,7 +1393,7 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa nRotation = nRotation * -1 + 36000; uno::Reference xServiceInfo(rXShape, uno::UNO_QUERY_THROW); - bool bIsGroupShape = (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")); + bool bIsGroupShape = xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"); WriteTransformation(tools::Rectangle(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)), nXmlNamespace, bFlipHWrite, bFlipVWrite, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), bIsGroupShape); diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 8d6abaab47e1..4f337500761c 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -205,7 +205,7 @@ void SlidePersist::applyTextStyles( const XmlFilterBase& rFilterBase ) Reference< container::XNameAccess > aXNameAccess( aXStyleFamiliesSupplier->getStyleFamilies() ); Reference< container::XNamed > aXNamed( mxPage, UNO_QUERY_THROW ); - if ( aXNameAccess.is() && aXNamed.is() ) + if ( aXNameAccess.is() ) { oox::drawingml::TextListStylePtr pTextListStylePtr; OUString aStyle; diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 0a43a07869f9..2796976ea872 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -1743,8 +1743,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain if ( m_xRelStorage->hasElements() ) { uno::Reference< embed::XTransactedObject > xTrans( m_xRelStorage, uno::UNO_QUERY_THROW ); - if ( xTrans.is() ) - xTrans->commit(); + xTrans->commit(); } if ( xNewPackageFolder.is() && xNewPackageFolder->hasByName( aRelsStorName ) ) diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx index bd04097f01af..a50ca379cf9a 100644 --- a/pyuno/source/module/pyuno_module.cxx +++ b/pyuno/source/module/pyuno_module.cxx @@ -336,7 +336,6 @@ static PyObject* initTestEnvironment( Reference const xMSF( xContext->getServiceManager(), css::uno::UNO_QUERY_THROW); - if (!xMSF.is()) { abort(); } char *const testlib = getenv("TEST_LIB"); if (!testlib) { abort(); } OString const libname = OString(testlib, strlen(testlib)) diff --git a/reportdesign/source/core/api/FormattedField.cxx b/reportdesign/source/core/api/FormattedField.cxx index 72a300e8876d..80068d54bd8b 100644 --- a/reportdesign/source/core/api/FormattedField.cxx +++ b/reportdesign/source/core/api/FormattedField.cxx @@ -216,16 +216,13 @@ uno::Reference< util::XCloneable > SAL_CALL OFormattedField::createClone( ) uno::Reference< report::XReportComponent> xSource = this; uno::Reference< report::XFormattedField> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FORMATTEDFIELD),uno::UNO_QUERY_THROW); - if ( xSet.is() ) + ::std::vector< uno::Reference< report::XFormatCondition> >::const_iterator aIter = m_aProps.m_aFormatConditions.begin(); + ::std::vector< uno::Reference< report::XFormatCondition> >::const_iterator aEnd = m_aProps.m_aFormatConditions.end(); + for (sal_Int32 i = 0; aIter != aEnd; ++aIter,++i) { - ::std::vector< uno::Reference< report::XFormatCondition> >::const_iterator aIter = m_aProps.m_aFormatConditions.begin(); - ::std::vector< uno::Reference< report::XFormatCondition> >::const_iterator aEnd = m_aProps.m_aFormatConditions.end(); - for (sal_Int32 i = 0; aIter != aEnd; ++aIter,++i) - { - uno::Reference< report::XFormatCondition > xCond = xSet->createFormatCondition(); - ::comphelper::copyProperties(aIter->get(),xCond.get()); - xSet->insertByIndex(i,uno::makeAny(xCond)); - } + uno::Reference< report::XFormatCondition > xCond = xSet->createFormatCondition(); + ::comphelper::copyProperties(aIter->get(),xCond.get()); + xSet->insertByIndex(i,uno::makeAny(xCond)); } return xSet.get(); } diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 29028f1459af..80f25884cf28 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -328,7 +328,6 @@ void ORptExport::exportFunctions(const Reference& _xFunctions) for (sal_Int32 i = 0; i< nCount; ++i) { uno::Reference< report::XFunction> xFunction(_xFunctions->getByIndex(i),uno::UNO_QUERY_THROW); - OSL_ENSURE(xFunction.is(),"Function object is NULL!"); exportFunction(xFunction); } } @@ -1346,8 +1345,6 @@ SvXMLAutoStylePoolP* ORptExport::CreateAutoStylePool() void SAL_CALL ORptExport::setSourceDocument( const Reference< XComponent >& xDoc ) { m_xReportDefinition.set(xDoc,UNO_QUERY_THROW); - OSL_ENSURE(m_xReportDefinition.is(),"DataSource is NULL!"); - SvXMLExport::setSourceDocument(xDoc); } diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index af3b1787360f..63b8b2f94133 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -108,7 +108,7 @@ void SAL_CALL ImportDocumentHandler::endDocument() { m_xDelegatee->endDocument(); uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW); - if ( xReceiver.is() && m_bImportedChart ) + if ( m_bImportedChart ) { // this fills the chart again ::comphelper::NamedValueCollection aArgs; diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 2e2bc8f07ed2..e49748177b70 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -443,9 +443,6 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) if ( bRet ) { m_xReportDefinition.set(GetModel(),UNO_QUERY_THROW); - OSL_ENSURE(m_xReportDefinition.is(),"ReportDefinition is NULL!"); - if ( !m_xReportDefinition.is() ) - return false; #if OSL_DEBUG_LEVEL > 1 uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY ); @@ -1077,14 +1074,10 @@ const OUString& ORptFilter::convertFormula(const OUString& _sFormula) void SAL_CALL ORptFilter::startDocument() { m_xReportDefinition.set(GetModel(),UNO_QUERY_THROW); - OSL_ENSURE(m_xReportDefinition.is(),"ReportDefinition is NULL!"); - if ( m_xReportDefinition.is() ) - { - m_pReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition); - OSL_ENSURE(m_pReportModel,"Report model is NULL!"); + m_pReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition); + OSL_ENSURE(m_pReportModel,"Report model is NULL!"); - SvXMLImport::startDocument(); - } + SvXMLImport::startDocument(); } void ORptFilter::endDocument() diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 66bf2ec329a5..79ceeb9da8c3 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -537,7 +537,6 @@ void NavigatorTree::traverseSection(const uno::Reference< report::XSection>& _xS for (sal_Int32 i = 0; i < nCount; ++i) { uno::Reference< report::XReportComponent> xElement(_xSection->getByIndex(i),uno::UNO_QUERY_THROW); - OSL_ENSURE(xElement.is(),"Found report element which is NULL!"); insertEntry(lcl_getName(xElement.get()),pSection,lcl_getImageId(xElement),TREELIST_APPEND,new UserData(this,xElement)); uno::Reference< report::XReportDefinition> xSubReport(xElement,uno::UNO_QUERY); if ( xSubReport.is() ) diff --git a/sc/qa/extras/check_data_pilot_field.cxx b/sc/qa/extras/check_data_pilot_field.cxx index f5a4163e74c3..a132788e2b8b 100644 --- a/sc/qa/extras/check_data_pilot_field.cxx +++ b/sc/qa/extras/check_data_pilot_field.cxx @@ -89,7 +89,6 @@ uno::Reference< uno::XInterface > CheckDataPilotField::init() return mxObject; uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is()); // the cell range table::CellRangeAddress sCellRangeAdress; diff --git a/sc/qa/extras/check_data_pilot_table.cxx b/sc/qa/extras/check_data_pilot_table.cxx index 1a4e6e4c2410..586fe72b0af3 100644 --- a/sc/qa/extras/check_data_pilot_table.cxx +++ b/sc/qa/extras/check_data_pilot_table.cxx @@ -86,7 +86,6 @@ uno::Reference< uno::XInterface > CheckDataPilotTable::init() return mxObject; uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is()); // the cell range table::CellRangeAddress sCellRangeAdress; diff --git a/sc/qa/extras/check_xcell_ranges_query.cxx b/sc/qa/extras/check_xcell_ranges_query.cxx index ec5d44cb3d2d..c5ebef7ef4e9 100644 --- a/sc/qa/extras/check_xcell_ranges_query.cxx +++ b/sc/qa/extras/check_xcell_ranges_query.cxx @@ -64,7 +64,6 @@ uno::Reference< uno::XInterface > CheckXCellRangesQuery::init() mxComponent = loadFromDesktop("private:factory/scalc"); uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is()); // Getting spreadsheet uno::Reference< sheet::XSpreadsheets > oSheets = xSheetDoc->getSheets(); diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index e3bf1e2a44ad..60c27979477e 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -71,7 +71,6 @@ uno::Reference< uno::XInterface > ScConditionalFormatTest::init(sal_Int32 nIndex { // get the first sheet uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(nIndex), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/regression-test.cxx b/sc/qa/extras/regression-test.cxx index 1ac0b9387b03..27b85ece8a48 100644 --- a/sc/qa/extras/regression-test.cxx +++ b/sc/qa/extras/regression-test.cxx @@ -79,32 +79,24 @@ void ScChartRegressionTest::test() CPPUNIT_ASSERT(xComponent.is()); 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(0), 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()); uno::Reference< chart2::XChartDocument > xChartDoc ( xChartComp, UNO_QUERY_THROW ); - CPPUNIT_ASSERT(xChartDoc.is()); uno::Reference< qa::XDumper > xDumper( xChartDoc, UNO_QUERY_THROW ); - CPPUNIT_ASSERT(xDumper.is()); OUString aDump = xDumper->dump(); std::cout << aDump; diff --git a/sc/qa/extras/scannotationobj.cxx b/sc/qa/extras/scannotationobj.cxx index 18beb9dabb48..7d6d10890c12 100644 --- a/sc/qa/extras/scannotationobj.cxx +++ b/sc/qa/extras/scannotationobj.cxx @@ -75,8 +75,6 @@ uno::Reference< sheet::XSheetAnnotation> ScAnnontationObj::getAnnotation(table:: uno::Reference< sheet::XSheetAnnotationAnchor > xAnnotationAnchor(xCell, UNO_QUERY_THROW); uno::Reference< sheet::XSheetAnnotation > xSheetAnnotation( xAnnotationAnchor->getAnnotation(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xSheetAnnotation.is()); - return xSheetAnnotation; } diff --git a/sc/qa/extras/scannotationshapeobj.cxx b/sc/qa/extras/scannotationshapeobj.cxx index 795a0fdb9b35..77fce301ce1f 100644 --- a/sc/qa/extras/scannotationshapeobj.cxx +++ b/sc/qa/extras/scannotationshapeobj.cxx @@ -72,7 +72,6 @@ void ScAnnotationShapeObj::tearDown() uno::Reference ScAnnotationShapeObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xIA(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xSheet(xIA->getByIndex(0), UNO_QUERY_THROW); diff --git a/sc/qa/extras/scannotationsobj.cxx b/sc/qa/extras/scannotationsobj.cxx index b9f230316b71..31f94c3e3196 100644 --- a/sc/qa/extras/scannotationsobj.cxx +++ b/sc/qa/extras/scannotationsobj.cxx @@ -56,7 +56,6 @@ uno::Reference< sheet::XSheetAnnotations> ScAnnontationsObj::getAnnotations(long { // get the sheet uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(nIndex), UNO_QUERY_THROW); @@ -65,8 +64,6 @@ uno::Reference< sheet::XSheetAnnotations> ScAnnontationsObj::getAnnotations(long uno::Reference< sheet::XSheetAnnotationsSupplier > xAnnotationSupplier(xSheet, UNO_QUERY_THROW); uno::Reference< sheet::XSheetAnnotations > xSheetAnnotations( xAnnotationSupplier->getAnnotations(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xSheetAnnotations.is()); - return xSheetAnnotations; } diff --git a/sc/qa/extras/scarealinkobj.cxx b/sc/qa/extras/scarealinkobj.cxx index c0c8c6c9b188..0183515071c9 100644 --- a/sc/qa/extras/scarealinkobj.cxx +++ b/sc/qa/extras/scarealinkobj.cxx @@ -66,7 +66,6 @@ ScAreaLinkObj::ScAreaLinkObj() uno::Reference< uno::XInterface > ScAreaLinkObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< beans::XPropertySet > xPropSet(xDoc, uno::UNO_QUERY_THROW); uno::Reference< sheet::XAreaLinks > xLinks(xPropSet->getPropertyValue("AreaLinks"), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scarealinksobj.cxx b/sc/qa/extras/scarealinksobj.cxx index df65526c8d0f..352efd65d20b 100644 --- a/sc/qa/extras/scarealinksobj.cxx +++ b/sc/qa/extras/scarealinksobj.cxx @@ -52,7 +52,6 @@ ScAreaLinksObj::ScAreaLinksObj() uno::Reference< uno::XInterface > ScAreaLinksObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< beans::XPropertySet > xPropSet(xDoc, uno::UNO_QUERY_THROW); uno::Reference< sheet::XAreaLinks > xLinks(xPropSet->getPropertyValue("AreaLinks"), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scautoformatobj.cxx b/sc/qa/extras/scautoformatobj.cxx index ca2b55cf200d..851f6dce34ac 100644 --- a/sc/qa/extras/scautoformatobj.cxx +++ b/sc/qa/extras/scautoformatobj.cxx @@ -53,7 +53,6 @@ ScAutoFormatObj::ScAutoFormatObj() uno::Reference ScAutoFormatObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xMSF(xDoc, UNO_QUERY_THROW); uno::Reference xIA( diff --git a/sc/qa/extras/sccellcursorobj.cxx b/sc/qa/extras/sccellcursorobj.cxx index 8e3b0ca43b08..61e564215787 100644 --- a/sc/qa/extras/sccellcursorobj.cxx +++ b/sc/qa/extras/sccellcursorobj.cxx @@ -119,7 +119,6 @@ ScCellCursorObj::ScCellCursorObj(): uno::Reference< uno::XInterface > ScCellCursorObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xSheet(xIndex->getByIndex(0), UNO_QUERY_THROW); @@ -134,7 +133,6 @@ uno::Reference< uno::XInterface > ScCellCursorObj::init() uno::Reference< uno::XInterface > ScCellCursorObj::getXSpreadsheet() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW); diff --git a/sc/qa/extras/sccellobj.cxx b/sc/qa/extras/sccellobj.cxx index 996d8a9f4268..0db73b287500 100644 --- a/sc/qa/extras/sccellobj.cxx +++ b/sc/qa/extras/sccellobj.cxx @@ -63,7 +63,6 @@ ScCellObj::ScCellObj() uno::Reference< uno::XInterface > ScCellObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xSheetDoc.is()); uno::Reference xSheets (xSheetDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIndex(xSheets, UNO_QUERY_THROW); diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx index 80ae6f8b664b..78670eef364c 100644 --- a/sc/qa/extras/sccellrangeobj.cxx +++ b/sc/qa/extras/sccellrangeobj.cxx @@ -167,23 +167,18 @@ ScCellRangeObj::ScCellRangeObj(): uno::Reference< uno::XInterface > ScCellRangeObj::init() { uno::Reference< sheet::XSpreadsheetDocument> xDoc (mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document!", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Could not create interface of type XSpreadsheet", xSheet.is()); - uno::Reference xReturn(xSheet->getCellRangeByPosition(0,0,4,4), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Could not create object of type XCellRangesQuery", xReturn.is()); return xReturn; } uno::Reference< uno::XInterface > ScCellRangeObj::getXSpreadsheet() { uno::Reference< sheet::XSpreadsheetDocument> xDoc (mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document!", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), UNO_QUERY_THROW); @@ -194,16 +189,12 @@ uno::Reference< uno::XInterface > ScCellRangeObj::getXSpreadsheet() uno::Reference< uno::XInterface > ScCellRangeObj::getXCellRangeData() { uno::Reference< sheet::XSpreadsheetDocument> xDoc (mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document!", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(1), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Could not create interface of type XSpreadsheet", xSheet.is()); - uno::Reference xReturn(xSheet->getCellRangeByPosition(0,0,3,3), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Could not create object of type XCellRangesQuery", xReturn.is()); return xReturn; } diff --git a/sc/qa/extras/sccellrangesobj.cxx b/sc/qa/extras/sccellrangesobj.cxx index 5a0c5e90139c..0dd8a7520715 100644 --- a/sc/qa/extras/sccellrangesobj.cxx +++ b/sc/qa/extras/sccellrangesobj.cxx @@ -74,7 +74,6 @@ ScCellRangesObj::ScCellRangesObj(): uno::Reference< uno::XInterface > ScCellRangesObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndexAccess(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scconsolidationdescriptorobj.cxx b/sc/qa/extras/scconsolidationdescriptorobj.cxx index a68f5fe0ef5b..e229ade7e5a8 100644 --- a/sc/qa/extras/scconsolidationdescriptorobj.cxx +++ b/sc/qa/extras/scconsolidationdescriptorobj.cxx @@ -62,7 +62,6 @@ ScConsolidationDescriptorObj::ScConsolidationDescriptorObj() uno::Reference ScConsolidationDescriptorObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xConsolidatable(xDoc, UNO_QUERY_THROW); return xConsolidatable->createConsolidationDescriptor(true); diff --git a/sc/qa/extras/scdatabaserangeobj.cxx b/sc/qa/extras/scdatabaserangeobj.cxx index ba8e8efbf4ef..fed4a8dd7d5e 100644 --- a/sc/qa/extras/scdatabaserangeobj.cxx +++ b/sc/qa/extras/scdatabaserangeobj.cxx @@ -67,7 +67,6 @@ ScDatabaseRangeObj::ScDatabaseRangeObj() uno::Reference< uno::XInterface > ScDatabaseRangeObj::init( const OUString& rDBName ) { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< beans::XPropertySet > xPropSet(xDoc, UNO_QUERY_THROW); uno::Reference< container::XNameAccess > xNameAccess( xPropSet->getPropertyValue("DatabaseRanges"), UNO_QUERY_THROW); diff --git a/sc/qa/extras/scdatabaserangesobj.cxx b/sc/qa/extras/scdatabaserangesobj.cxx index 9df20f8a57b6..a2f2c42308cf 100644 --- a/sc/qa/extras/scdatabaserangesobj.cxx +++ b/sc/qa/extras/scdatabaserangesobj.cxx @@ -53,7 +53,6 @@ ScDatabaseRangesObj::ScDatabaseRangesObj() uno::Reference ScDatabaseRangesObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xPropSet(xDoc, UNO_QUERY_THROW); uno::Reference xDbRanges(xPropSet->getPropertyValue("DatabaseRanges"), diff --git a/sc/qa/extras/scdatapilotfieldobj.cxx b/sc/qa/extras/scdatapilotfieldobj.cxx index 94c725ad8ce1..1b9ea1a65c42 100644 --- a/sc/qa/extras/scdatapilotfieldobj.cxx +++ b/sc/qa/extras/scdatapilotfieldobj.cxx @@ -66,24 +66,20 @@ ScDataPilotFieldObj::ScDataPilotFieldObj() uno::Reference< uno::XInterface > ScDataPilotFieldObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(1), UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("Could not create interface of type XSpreadsheet", xSheet.is()); uno::Reference< sheet::XDataPilotTablesSupplier > xDPTS(xSheet, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDPTS.is()); uno::Reference< sheet::XDataPilotTables > xDPT = xDPTS->getDataPilotTables(); CPPUNIT_ASSERT(xDPT.is()); uno::Sequence aElementNames = xDPT->getElementNames(); (void) aElementNames; uno::Reference< sheet::XDataPilotDescriptor > xDPDsc(xDPT->getByName("DataPilot1"),UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDPDsc.is()); uno::Reference< container::XIndexAccess > xIA( xDPDsc->getDataPilotFields(), UNO_QUERY_THROW); uno::Reference< uno::XInterface > xReturnValue( xIA->getByIndex(0), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xReturnValue.is()); return xReturnValue; } diff --git a/sc/qa/extras/scdatapilotitemobj.cxx b/sc/qa/extras/scdatapilotitemobj.cxx index ab2d44338b80..5d182624c00f 100644 --- a/sc/qa/extras/scdatapilotitemobj.cxx +++ b/sc/qa/extras/scdatapilotitemobj.cxx @@ -65,7 +65,6 @@ uno::Reference< uno::XInterface > ScDataPilotItemObj::init() table::CellAddress sCellAddress(0, 7, 8); uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); // we need to sheets uno::Reference< sheet::XSpreadsheets > xSheets(xDoc->getSheets(), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scdatapilottableobj.cxx b/sc/qa/extras/scdatapilottableobj.cxx index ebc14b04191b..b9896862fa73 100644 --- a/sc/qa/extras/scdatapilottableobj.cxx +++ b/sc/qa/extras/scdatapilottableobj.cxx @@ -82,7 +82,6 @@ ScDataPilotTableObj::ScDataPilotTableObj() uno::Reference< uno::XInterface > ScDataPilotTableObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW); @@ -95,13 +94,11 @@ uno::Reference< uno::XInterface > ScDataPilotTableObj::init() CPPUNIT_ASSERT_MESSAGE("Could not create interface of type XSpreadsheet", xSheet.is()); uno::Reference< sheet::XDataPilotTablesSupplier > xDPTS(xSheet, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDPTS.is()); uno::Reference< sheet::XDataPilotTables > xDPT = xDPTS->getDataPilotTables(); CPPUNIT_ASSERT(xDPT.is()); uno::Reference< sheet::XDataPilotTable > xDPTable(xDPT->getByName("DataPilotTable"),UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDPTable.is()); return xDPTable; } @@ -126,13 +123,11 @@ uno::Reference< uno::XInterface > ScDataPilotTableObj::initDP2() CPPUNIT_ASSERT_MESSAGE("Could not create interface of type XSpreadsheet", xSheet.is()); uno::Reference< sheet::XDataPilotTablesSupplier > xDPTS(xSheet, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDPTS.is()); uno::Reference< sheet::XDataPilotTables > xDPT = xDPTS->getDataPilotTables(); CPPUNIT_ASSERT(xDPT.is()); uno::Reference< sheet::XDataPilotTable > xDPTable(xDPT->getByName("DataPilotTable2"),UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDPTable.is()); return xDPTable; } diff --git a/sc/qa/extras/scdatapilottablesobj.cxx b/sc/qa/extras/scdatapilottablesobj.cxx index 0f44daa60fb5..7a86605852e7 100644 --- a/sc/qa/extras/scdatapilottablesobj.cxx +++ b/sc/qa/extras/scdatapilottablesobj.cxx @@ -59,7 +59,6 @@ ScDataPilotTablesObj::ScDataPilotTablesObj() uno::Reference ScDataPilotTablesObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIndex(xDoc->getSheets(), UNO_QUERY_THROW); @@ -84,7 +83,6 @@ uno::Reference ScDataPilotTablesObj::init() uno::Reference ScDataPilotTablesObj::getXSpreadsheet() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIndex(xDoc->getSheets(), UNO_QUERY_THROW); diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx index 91899ceef78a..a9b7358e54da 100644 --- a/sc/qa/extras/scddelinkobj.cxx +++ b/sc/qa/extras/scddelinkobj.cxx @@ -59,7 +59,6 @@ ScDDELinkObj::ScDDELinkObj() uno::Reference ScDDELinkObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIA(xSheets, UNO_QUERY_THROW); diff --git a/sc/qa/extras/scdocumentconfigurationobj.cxx b/sc/qa/extras/scdocumentconfigurationobj.cxx index fd3527f6c3a7..132e9b79287d 100644 --- a/sc/qa/extras/scdocumentconfigurationobj.cxx +++ b/sc/qa/extras/scdocumentconfigurationobj.cxx @@ -52,8 +52,6 @@ ScDocumentConfigurationObj::ScDocumentConfigurationObj() uno::Reference ScDocumentConfigurationObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - uno::Reference xMSF(xDoc, UNO_QUERY_THROW); return xMSF->createInstance("com.sun.star.sheet.DocumentSettings"); } diff --git a/sc/qa/extras/scfilterdescriptorbaseobj.cxx b/sc/qa/extras/scfilterdescriptorbaseobj.cxx index 35fca71f62d5..5a0fd35ec5b3 100644 --- a/sc/qa/extras/scfilterdescriptorbaseobj.cxx +++ b/sc/qa/extras/scfilterdescriptorbaseobj.cxx @@ -57,7 +57,6 @@ ScFilterDescriptorBaseObj::ScFilterDescriptorBaseObj(): uno::Reference< uno::XInterface > ScFilterDescriptorBaseObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndexAccess(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scfunctiondescriptionobj.cxx b/sc/qa/extras/scfunctiondescriptionobj.cxx index 1e62a9e1935f..90446072835a 100644 --- a/sc/qa/extras/scfunctiondescriptionobj.cxx +++ b/sc/qa/extras/scfunctiondescriptionobj.cxx @@ -56,7 +56,6 @@ ScFunctionDescriptionObj::ScFunctionDescriptionObj() uno::Sequence ScFunctionDescriptionObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xMSF(xDoc, UNO_QUERY_THROW); uno::Reference xFDs( diff --git a/sc/qa/extras/scfunctionlistobj.cxx b/sc/qa/extras/scfunctionlistobj.cxx index 91ab22b59f66..59e4baf2d4c0 100644 --- a/sc/qa/extras/scfunctionlistobj.cxx +++ b/sc/qa/extras/scfunctionlistobj.cxx @@ -50,8 +50,6 @@ ScFunctionListObj::ScFunctionListObj() uno::Reference ScFunctionListObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - uno::Reference xMSF(xDoc, UNO_QUERY_THROW); return xMSF->createInstance("com.sun.star.sheet.FunctionDescriptions"); } diff --git a/sc/qa/extras/scheaderfootercontentobj.cxx b/sc/qa/extras/scheaderfootercontentobj.cxx index cb416f910835..3c3b9aeea971 100644 --- a/sc/qa/extras/scheaderfootercontentobj.cxx +++ b/sc/qa/extras/scheaderfootercontentobj.cxx @@ -57,7 +57,6 @@ ScHeaderFooterContentObj::ScHeaderFooterContentObj() uno::Reference ScHeaderFooterContentObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xStyleFamSupp(xDoc, UNO_QUERY_THROW); uno::Reference xStyleFamiliesNames(xStyleFamSupp->getStyleFamilies(), diff --git a/sc/qa/extras/scimportdescriptorbaseobj.cxx b/sc/qa/extras/scimportdescriptorbaseobj.cxx index fbb8b623d7c3..eb7fc83e8dea 100644 --- a/sc/qa/extras/scimportdescriptorbaseobj.cxx +++ b/sc/qa/extras/scimportdescriptorbaseobj.cxx @@ -56,7 +56,6 @@ ScImportDescriptorBaseObj::ScImportDescriptorBaseObj() uno::Reference ScImportDescriptorBaseObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIA(xSheets, UNO_QUERY_THROW); @@ -68,7 +67,6 @@ uno::Reference ScImportDescriptorBaseObj::init() uno::Reference ScImportDescriptorBaseObj::getXImportable() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIA(xSheets, UNO_QUERY_THROW); diff --git a/sc/qa/extras/sclabelrangeobj.cxx b/sc/qa/extras/sclabelrangeobj.cxx index 4cbbac83f776..15b7ee494ba7 100644 --- a/sc/qa/extras/sclabelrangeobj.cxx +++ b/sc/qa/extras/sclabelrangeobj.cxx @@ -55,7 +55,6 @@ ScLabelRangeObj::ScLabelRangeObj() uno::Reference ScLabelRangeObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xProp(xDoc, uno::UNO_QUERY_THROW); uno::Reference xLabelRanges(xProp->getPropertyValue("ColumnLabelRanges"), diff --git a/sc/qa/extras/sclabelrangesobj.cxx b/sc/qa/extras/sclabelrangesobj.cxx index e10554dae405..5a654b5ce727 100644 --- a/sc/qa/extras/sclabelrangesobj.cxx +++ b/sc/qa/extras/sclabelrangesobj.cxx @@ -54,7 +54,6 @@ ScLabelRangesObj::ScLabelRangesObj() uno::Reference ScLabelRangesObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xProp(xDoc, uno::UNO_QUERY_THROW); uno::Reference xLabelRanges(xProp->getPropertyValue("ColumnLabelRanges"), diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx index 2927f2f9d9c2..79f44080f7a7 100644 --- a/sc/qa/extras/scmodelobj.cxx +++ b/sc/qa/extras/scmodelobj.cxx @@ -75,7 +75,6 @@ ScModelObj::ScModelObj() uno::Reference< uno::XInterface > ScModelObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xModel(xDoc, UNO_QUERY_THROW); diff --git a/sc/qa/extras/scoutlineobj.cxx b/sc/qa/extras/scoutlineobj.cxx index 167cab94ad6a..fba63ff98a65 100644 --- a/sc/qa/extras/scoutlineobj.cxx +++ b/sc/qa/extras/scoutlineobj.cxx @@ -55,7 +55,6 @@ uno::Reference< uno::XInterface > ScOutlineObj::init() { // get the first sheet uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW); diff --git a/sc/qa/extras/screcentfunctionsobj.cxx b/sc/qa/extras/screcentfunctionsobj.cxx index 4dc32b67b0bd..6981826af126 100644 --- a/sc/qa/extras/screcentfunctionsobj.cxx +++ b/sc/qa/extras/screcentfunctionsobj.cxx @@ -54,8 +54,6 @@ ScRecentFunctionsObj::ScRecentFunctionsObj() uno::Reference ScRecentFunctionsObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - uno::Reference xMSF(xDoc, UNO_QUERY_THROW); return xMSF->createInstance("com.sun.star.sheet.RecentFunctions"); } diff --git a/sc/qa/extras/scscenariosobj.cxx b/sc/qa/extras/scscenariosobj.cxx index 27524fda7083..ebd8ce82155d 100644 --- a/sc/qa/extras/scscenariosobj.cxx +++ b/sc/qa/extras/scscenariosobj.cxx @@ -61,7 +61,6 @@ ScScenariosObj::ScScenariosObj() uno::Reference ScScenariosObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scshapeobj.cxx b/sc/qa/extras/scshapeobj.cxx index 4b8c6069302e..2fa84d7a926f 100644 --- a/sc/qa/extras/scshapeobj.cxx +++ b/sc/qa/extras/scshapeobj.cxx @@ -59,7 +59,6 @@ ScShapeObj::ScShapeObj() uno::Reference ScShapeObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xMSF(xDoc, UNO_QUERY_THROW); uno::Reference xShape( @@ -86,8 +85,6 @@ uno::Reference ScShapeObj::init() uno::Reference ScShapeObj::getXSheetDocument() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - return xDoc; } diff --git a/sc/qa/extras/scsheetlinkobj.cxx b/sc/qa/extras/scsheetlinkobj.cxx index ff707ac60aed..fbad33a9f18c 100644 --- a/sc/qa/extras/scsheetlinkobj.cxx +++ b/sc/qa/extras/scsheetlinkobj.cxx @@ -58,7 +58,6 @@ ScSheetLinkObj::ScSheetLinkObj() uno::Reference ScSheetLinkObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIA(xSheets, UNO_QUERY_THROW); diff --git a/sc/qa/extras/scsortdescriptorbaseobj.cxx b/sc/qa/extras/scsortdescriptorbaseobj.cxx index 6933ca8be769..3ca49b8541c4 100644 --- a/sc/qa/extras/scsortdescriptorbaseobj.cxx +++ b/sc/qa/extras/scsortdescriptorbaseobj.cxx @@ -55,8 +55,6 @@ ScSortDescriptorBaseObj::ScSortDescriptorBaseObj() uno::Reference ScSortDescriptorBaseObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIA(xSheets, UNO_QUERY_THROW); diff --git a/sc/qa/extras/scspreadsheetsettings.cxx b/sc/qa/extras/scspreadsheetsettings.cxx index 48dfb48beb16..4efd21102624 100644 --- a/sc/qa/extras/scspreadsheetsettings.cxx +++ b/sc/qa/extras/scspreadsheetsettings.cxx @@ -51,8 +51,6 @@ ScSpreadsheetSettings::ScSpreadsheetSettings() uno::Reference ScSpreadsheetSettings::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - uno::Reference xMSF(xDoc, UNO_QUERY_THROW); return xMSF->createInstance("com.sun.star.sheet.GlobalSheetSettings"); } diff --git a/sc/qa/extras/scspreadsheetsettingsobj.cxx b/sc/qa/extras/scspreadsheetsettingsobj.cxx index b7ba068d5274..fa79cc610995 100644 --- a/sc/qa/extras/scspreadsheetsettingsobj.cxx +++ b/sc/qa/extras/scspreadsheetsettingsobj.cxx @@ -51,8 +51,6 @@ ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj() uno::Reference ScSpreadsheetSettingsObj::init() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); - return xDoc; } diff --git a/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx b/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx index 519bb78ee4ea..62ce0c69564a 100644 --- a/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx +++ b/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx @@ -65,7 +65,6 @@ ScSubTotalDescriptorBaseObj::ScSubTotalDescriptorBaseObj() uno::Reference< uno::XInterface > ScSubTotalDescriptorBaseObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scsubtotalfieldobj.cxx b/sc/qa/extras/scsubtotalfieldobj.cxx index 50e55745a756..c0a487801e68 100644 --- a/sc/qa/extras/scsubtotalfieldobj.cxx +++ b/sc/qa/extras/scsubtotalfieldobj.cxx @@ -61,7 +61,6 @@ ScSubTotalFieldObj::ScSubTotalFieldObj() uno::Reference< uno::XInterface > ScSubTotalFieldObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference< container::XIndexAccess > xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); @@ -78,7 +77,6 @@ uno::Reference< uno::XInterface > ScSubTotalFieldObj::init() uno::Reference< container::XIndexAccess > xDescIndex(xSubTotalDesc, uno::UNO_QUERY_THROW); uno::Reference< sheet::XSubTotalField > xSTF(xDescIndex->getByIndex(0), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xSTF.is()); return xSTF; } diff --git a/sc/qa/extras/sctableconditionalentryobj.cxx b/sc/qa/extras/sctableconditionalentryobj.cxx index bec1a3dde562..e1c37711571c 100644 --- a/sc/qa/extras/sctableconditionalentryobj.cxx +++ b/sc/qa/extras/sctableconditionalentryobj.cxx @@ -71,7 +71,6 @@ ScTableConditionalEntryObj::ScTableConditionalEntryObj() uno::Reference ScTableConditionalEntryObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/sctableconditionalformatobj.cxx b/sc/qa/extras/sctableconditionalformatobj.cxx index 0d83f94ff33f..f245189c9ccd 100644 --- a/sc/qa/extras/sctableconditionalformatobj.cxx +++ b/sc/qa/extras/sctableconditionalformatobj.cxx @@ -65,7 +65,6 @@ ScTableConditionalFormatObj::ScTableConditionalFormatObj() uno::Reference ScTableConditionalFormatObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx index 2194a710da55..475bf9a7b95f 100644 --- a/sc/qa/extras/sctablesheetobj.cxx +++ b/sc/qa/extras/sctablesheetobj.cxx @@ -221,7 +221,6 @@ ScTableSheetObj::ScTableSheetObj(): uno::Reference< uno::XInterface > ScTableSheetObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIndex (xDoc->getSheets(), UNO_QUERY_THROW); @@ -249,14 +248,12 @@ uno::Reference< uno::XInterface > ScTableSheetObj::init() uno::Reference ScTableSheetObj::getXSpreadsheetDocument() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); return xDoc; } uno::Reference ScTableSheetObj::getScenarioSpreadsheet() { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference xIndex (xDoc->getSheets(), UNO_QUERY_THROW); @@ -284,7 +281,6 @@ uno::Reference ScTableSheetObj::getScenarioSpreadsheet() uno::Reference< uno::XInterface > ScTableSheetObj::getXSpreadsheet() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW); diff --git a/sc/qa/extras/sctablevalidationobj.cxx b/sc/qa/extras/sctablevalidationobj.cxx index 0968b8042893..8de69c907549 100644 --- a/sc/qa/extras/sctablevalidationobj.cxx +++ b/sc/qa/extras/sctablevalidationobj.cxx @@ -65,7 +65,6 @@ ScTableValidationObj::ScTableValidationObj() uno::Reference ScTableValidationObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/sctabviewobj.cxx b/sc/qa/extras/sctabviewobj.cxx index 6f3f3b01ae16..106e13617c29 100644 --- a/sc/qa/extras/sctabviewobj.cxx +++ b/sc/qa/extras/sctabviewobj.cxx @@ -75,7 +75,6 @@ ScTabViewObj::ScTabViewObj() uno::Reference< uno::XInterface > ScTabViewObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xModel(xDoc, uno::UNO_QUERY_THROW); @@ -85,7 +84,6 @@ uno::Reference< uno::XInterface > ScTabViewObj::init() uno::Reference ScTabViewObj::getXSpreadsheet(const sal_Int16 nNumber) { uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); uno::Reference xSheets(xDoc->getSheets(), UNO_QUERY_THROW); xSheets->insertNewByName("Sheet2", 2); diff --git a/sc/qa/extras/scviewpaneobj.cxx b/sc/qa/extras/scviewpaneobj.cxx index 6e74fa8a4434..f999edd7b35d 100644 --- a/sc/qa/extras/scviewpaneobj.cxx +++ b/sc/qa/extras/scviewpaneobj.cxx @@ -53,7 +53,6 @@ ScViewPaneObj::ScViewPaneObj() uno::Reference< uno::XInterface > ScViewPaneObj::init() { uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is()); uno::Reference< frame::XModel > xModel(xSheetDoc, uno::UNO_QUERY_THROW); uno::Reference< frame::XController > xController = xModel->getCurrentController(); diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx index f8e8229dab51..433985360323 100644 --- a/sc/qa/perf/scperfobj.cxx +++ b/sc/qa/perf/scperfobj.cxx @@ -245,11 +245,8 @@ void ScPerfObj::testSheetFindAll() uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scBigFile.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); - // get sheet uno::Reference< container::XIndexAccess > xSheetIndex (xDoc->getSheets(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in xSheetIndex" , xSheetIndex.is()); uno::Reference< sheet::XSpreadsheet > xSheet( xSheetIndex->getByIndex(0), UNO_QUERY_THROW); @@ -310,7 +307,6 @@ void ScPerfObj::testSheetNamedRanges() // get sheet - named ranges are defined in sheet #1 uno::Reference< container::XIndexAccess > xSheetIndex (xDoc->getSheets(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in xSheetIndex" , xSheetIndex.is()); uno::Reference< sheet::XSpreadsheet > xSheet( xSheetIndex->getByIndex(1), UNO_QUERY_THROW); // test removeByName @@ -348,8 +344,6 @@ void ScPerfObj::testSheets() uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scBigFile.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); - // get getSheets uno::Reference< sheet::XSpreadsheets > xSheets (xDoc->getSheets(), UNO_QUERY_THROW); @@ -378,7 +372,6 @@ void ScPerfObj::testSum() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -417,7 +410,6 @@ void ScPerfObj::testFTest() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -441,7 +433,6 @@ void ScPerfObj::testChiTest() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -465,7 +456,6 @@ void ScPerfObj::testSumX2PY2Test() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions2.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -489,7 +479,6 @@ void ScPerfObj::testTTest() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions2.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -513,7 +502,6 @@ void ScPerfObj::testLcm() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions2.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -537,7 +525,6 @@ void ScPerfObj::testGcd() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions2.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -561,7 +548,6 @@ void ScPerfObj::testPearson() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions2.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -585,7 +571,6 @@ void ScPerfObj::testSubTotalWithFormulas() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scBigSingleSheet200.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -622,7 +607,6 @@ void ScPerfObj::testSubTotalWithoutFormulas() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scBigSingleSheet200.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -659,7 +643,6 @@ void ScPerfObj::testLoadingFileWithSingleBigSheet() { callgrindStart(); uno::Reference< sheet::XSpreadsheetDocument > xDoc1(init("scBigSingleSheet2000.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc1.is()); uno::Reference< sheet::XCalculatable > xCalculatable1(xDoc1, UNO_QUERY_THROW); callgrindDump("sc:loadingFileWithSingleBigSheetdoSubTotal_2000lines"); } @@ -695,8 +678,6 @@ void ScPerfObj::testFixedSum() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions3.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , xDoc.is()); - uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); setupBlockFormula(xDoc, "FixedSumSheet", "B1:B1000", "=SUM(A$1:A$1000)"); @@ -750,7 +731,6 @@ void ScPerfObj::testMatConcatSmall() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("empty.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets @@ -778,7 +758,6 @@ void ScPerfObj::testMatConcatLarge() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("empty.ods"), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDoc.is()); uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); // get getSheets diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 3252d9143fc8..d65a82b5878b 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1630,7 +1630,6 @@ void ScFiltersTest::testControlImport() uno::Reference< container::XIndexAccess > xIA_DrawPage(xDrawPageSupplier->getDrawPage(), UNO_QUERY_THROW); uno::Reference< drawing::XControlShape > xControlShape(xIA_DrawPage->getByIndex(0), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xDocSh->DoClose(); } @@ -3496,7 +3495,6 @@ void ScFiltersTest::testTdf83672XLSX() xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW ); uno::Reference< drawing::XShape > xShape( xPage->getByIndex(0), uno::UNO_QUERY_THROW ); - CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() ); uno::Reference< beans::XPropertySet > xShapeProperties( xShape, uno::UNO_QUERY ); sal_Int32 nRotate = 0; @@ -3992,7 +3990,6 @@ void ScFiltersTest::testActiveXCheckboxXLSX() uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier(xIA->getByIndex(0), UNO_QUERY_THROW); uno::Reference< container::XIndexAccess > xIA_DrawPage(xDrawPageSupplier->getDrawPage(), UNO_QUERY_THROW); uno::Reference< drawing::XControlShape > xControlShape(xIA_DrawPage->getByIndex(0), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); // Check control type uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); diff --git a/sc/source/ui/docshell/macromgr.cxx b/sc/source/ui/docshell/macromgr.cxx index 716a2de7aeca..bbe31344c73b 100644 --- a/sc/source/ui/docshell/macromgr.cxx +++ b/sc/source/ui/docshell/macromgr.cxx @@ -142,15 +142,12 @@ void ScMacroManager::InitUserFuncData() Reference< script::XLibraryContainer > xLibraries( pShell->GetBasicContainer(), uno::UNO_QUERY_THROW ); xModuleContainer.set( xLibraries->getByName( sProjectName ), uno::UNO_QUERY_THROW ); - if ( xModuleContainer.is() ) - { - // remove old listener ( if there was one ) - if ( mxContainerListener.is() ) - xModuleContainer->removeContainerListener( mxContainerListener ); - // Create listener - mxContainerListener = new VBAProjectListener( this ); - xModuleContainer->addContainerListener( mxContainerListener ); - } + // remove old listener ( if there was one ) + if ( mxContainerListener.is() ) + xModuleContainer->removeContainerListener( mxContainerListener ); + // Create listener + mxContainerListener = new VBAProjectListener( this ); + xModuleContainer->addContainerListener( mxContainerListener ); } catch (const uno::Exception&) { diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx index a86c013d3ab8..b82cc3cf8b01 100644 --- a/sc/source/ui/vba/vbapagesetup.cxx +++ b/sc/source/ui/vba/vbapagesetup.cxx @@ -236,11 +236,8 @@ OUString SAL_CALL ScVbaPageSetup::getLeftHeader() try { uno::Reference xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW); - if( xHeaderContent.is() ) - { - uno::Reference< text::XText > xText = xHeaderContent->getLeftText(); - leftHeader = xText->getString(); - } + uno::Reference< text::XText > xText = xHeaderContent->getLeftText(); + leftHeader = xText->getString(); } catch( uno::Exception& ) { @@ -254,12 +251,9 @@ void SAL_CALL ScVbaPageSetup::setLeftHeader( const OUString& leftHeader) try { uno::Reference xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW); - if( xHeaderContent.is() ) - { - uno::Reference< text::XText > xText = xHeaderContent->getLeftText(); - xText->setString( leftHeader ); - mxPageProps->setPropertyValue("RightPageHeaderContent", uno::makeAny(xHeaderContent) ); - } + uno::Reference< text::XText > xText = xHeaderContent->getLeftText(); + xText->setString( leftHeader ); + mxPageProps->setPropertyValue("RightPageHeaderContent", uno::makeAny(xHeaderContent) ); } catch( uno::Exception& ) { @@ -272,11 +266,8 @@ OUString SAL_CALL ScVbaPageSetup::getCenterHeader() try { uno::Reference xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW); - if( xHeaderContent.is() ) - { - uno::Reference< text::XText > xText = xHeaderContent->getCenterText(); - centerHeader = xText->getString(); - } + uno::Reference< text::XText > xText = xHeaderContent->getCenterText(); + centerHeader = xText->getString(); } catch( uno::Exception& ) { @@ -290,12 +281,9 @@ void SAL_CALL ScVbaPageSetup::setCenterHeader( const OUString& centerHeader) try { uno::Reference xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW); - if( xHeaderContent.is() ) - { - uno::Reference< text::XText > xText = xHeaderContent->getCenterText(); - xText->setString( centerHeader ); - mxPageProps->setPropertyValue("RightPageHeaderContent", uno::makeAny(xHeaderContent) ); - } + uno::Reference< text::XText > xText = xHeaderContent->getCenterText(); + xText->setString( centerHeader ); + mxPageProps->setPropertyValue("RightPageHeaderContent", uno::makeAny(xHeaderContent) ); } catch( uno::Exception& ) { @@ -308,11 +296,8 @@ OUString SAL_CALL ScVbaPageSetup::getRightHeader() try { uno::Reference xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW); - if( xHeaderContent.is() ) - { - uno::Reference< text::XText > xText = xHeaderContent->getRightText(); - rightHeader = xText->getString(); - } + uno::Reference< text::XText > xText = xHeaderContent->getRightText(); + rightHeader = xText->getString(); } catch( uno::Exception& ) { @@ -326,12 +311,9 @@ void SAL_CALL ScVbaPageSetup::setRightHeader( const OUString& rightHeader) try { uno::Reference xHeaderContent( mxPageProps->getPropertyValue("RightPageHeaderContent"), uno::UNO_QUERY_THROW); - if( xHeaderContent.is() ) - { - uno::Reference< text::XText > xText = xHeaderContent->getRightText(); - xText->setString( rightHeader ); - mxPageProps->setPropertyValue("RightPageHeaderContent", uno::makeAny(xHeaderContent) ); - } + uno::Reference< text::XText > xText = xHeaderContent->getRightText(); + xText->setString( rightHeader ); + mxPageProps->setPropertyValue("RightPageHeaderContent", uno::makeAny(xHeaderContent) ); } catch( uno::Exception& ) { @@ -344,11 +326,8 @@ OUString SAL_CALL ScVbaPageSetup::getLeftFooter() try { uno::Reference xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW); - if( xFooterContent.is() ) - { - uno::Reference< text::XText > xText = xFooterContent->getLeftText(); - leftFooter = xText->getString(); - } + uno::Reference< text::XText > xText = xFooterContent->getLeftText(); + leftFooter = xText->getString(); } catch( uno::Exception& ) { @@ -362,12 +341,9 @@ void SAL_CALL ScVbaPageSetup::setLeftFooter( const OUString& leftFooter) try { uno::Reference xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW); - if( xFooterContent.is() ) - { - uno::Reference< text::XText > xText = xFooterContent->getLeftText(); - xText->setString( leftFooter ); - mxPageProps->setPropertyValue("RightPageFooterContent", uno::makeAny(xFooterContent) ); - } + uno::Reference< text::XText > xText = xFooterContent->getLeftText(); + xText->setString( leftFooter ); + mxPageProps->setPropertyValue("RightPageFooterContent", uno::makeAny(xFooterContent) ); } catch( uno::Exception& ) { @@ -380,11 +356,8 @@ OUString SAL_CALL ScVbaPageSetup::getCenterFooter() try { uno::Reference xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW); - if( xFooterContent.is() ) - { - uno::Reference< text::XText > xText = xFooterContent->getCenterText(); - centerFooter = xText->getString(); - } + uno::Reference< text::XText > xText = xFooterContent->getCenterText(); + centerFooter = xText->getString(); } catch( uno::Exception& ) { @@ -398,12 +371,9 @@ void SAL_CALL ScVbaPageSetup::setCenterFooter( const OUString& centerFooter) try { uno::Reference xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW); - if( xFooterContent.is() ) - { - uno::Reference< text::XText > xText = xFooterContent->getCenterText(); - xText->setString( centerFooter ); - mxPageProps->setPropertyValue("RightPageFooterContent", uno::makeAny(xFooterContent) ); - } + uno::Reference< text::XText > xText = xFooterContent->getCenterText(); + xText->setString( centerFooter ); + mxPageProps->setPropertyValue("RightPageFooterContent", uno::makeAny(xFooterContent) ); } catch( uno::Exception& ) { @@ -417,11 +387,8 @@ OUString SAL_CALL ScVbaPageSetup::getRightFooter() try { uno::Reference xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW); - if( xFooterContent.is() ) - { - uno::Reference< text::XText > xText = xFooterContent->getRightText(); - rightFooter = xText->getString(); - } + uno::Reference< text::XText > xText = xFooterContent->getRightText(); + rightFooter = xText->getString(); } catch( uno::Exception& ) { @@ -435,12 +402,9 @@ void SAL_CALL ScVbaPageSetup::setRightFooter( const OUString& rightFooter) try { uno::Reference xFooterContent( mxPageProps->getPropertyValue("RightPageFooterContent"), uno::UNO_QUERY_THROW); - if( xFooterContent.is() ) - { - uno::Reference< text::XText > xText = xFooterContent->getRightText(); - xText->setString( rightFooter ); - mxPageProps->setPropertyValue("RightPageFooterContent", uno::makeAny(xFooterContent) ); - } + uno::Reference< text::XText > xText = xFooterContent->getRightText(); + xText->setString( rightFooter ); + mxPageProps->setPropertyValue("RightPageFooterContent", uno::makeAny(xFooterContent) ); } catch( uno::Exception& ) { diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 05c758261dae..120451ec7f83 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1954,7 +1954,7 @@ ScVbaRange::getFormulaArray() // that is what the doc says ( but I am not even sure how to detect that ) // for the moment any tests we have pass uno::Reference< sheet::XArrayFormulaRange> xFormulaArray( mxRange, uno::UNO_QUERY_THROW ); - if ( xFormulaArray.is() && !xFormulaArray->getArrayFormula().isEmpty() ) + if ( !xFormulaArray->getArrayFormula().isEmpty() ) return uno::makeAny( xFormulaArray->getArrayFormula() ); uno::Reference< sheet::XCellRangeFormula> xCellRangeFormula( mxRange, uno::UNO_QUERY_THROW ); @@ -4939,21 +4939,18 @@ ScVbaRange::MergeArea() { xMergeSheetCursor->collapseToMergedArea(); uno::Reference xMergeCellAddress(xMergeSheetCursor, uno::UNO_QUERY_THROW); - if( xMergeCellAddress.is() ) + table::CellRangeAddress aCellAddress = xMergeCellAddress->getRangeAddress(); + if( aCellAddress.StartColumn ==0 && aCellAddress.EndColumn==0 && + aCellAddress.StartRow==0 && aCellAddress.EndRow==0) { - table::CellRangeAddress aCellAddress = xMergeCellAddress->getRangeAddress(); - if( aCellAddress.StartColumn ==0 && aCellAddress.EndColumn==0 && - aCellAddress.StartRow==0 && aCellAddress.EndRow==0) - { - return new ScVbaRange( mxParent,mxContext,mxRange ); - } - else - { - ScRange refRange( static_cast< SCCOL >( aCellAddress.StartColumn ), static_cast< SCROW >( aCellAddress.StartRow ), static_cast< SCTAB >( aCellAddress.Sheet ), - static_cast< SCCOL >( aCellAddress.EndColumn ), static_cast< SCROW >( aCellAddress.EndRow ), static_cast< SCTAB >( aCellAddress.Sheet ) ); - uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell() , refRange ) ); - return new ScVbaRange( mxParent, mxContext,xRange ); - } + return new ScVbaRange( mxParent,mxContext,mxRange ); + } + else + { + ScRange refRange( static_cast< SCCOL >( aCellAddress.StartColumn ), static_cast< SCROW >( aCellAddress.StartRow ), static_cast< SCTAB >( aCellAddress.Sheet ), + static_cast< SCCOL >( aCellAddress.EndColumn ), static_cast< SCROW >( aCellAddress.EndRow ), static_cast< SCTAB >( aCellAddress.Sheet ) ); + uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell() , refRange ) ); + return new ScVbaRange( mxParent, mxContext,xRange ); } } return new ScVbaRange( mxParent, mxContext, mxRange ); @@ -5308,7 +5305,7 @@ ScVbaRange::setStyle( const uno::Any& _style ) uno::Reference< beans::XPropertySet > xProps( mxRange, uno::UNO_QUERY_THROW ); uno::Reference< excel::XStyle > xStyle; _style >>= xStyle; - if ( xProps.is() && xStyle.is() ) + if ( xStyle.is() ) xProps->setPropertyValue( CELLSTYLE, uno::makeAny( xStyle->getName() ) ); } diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index a4bb3452f884..77ce226cf089 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -137,14 +137,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn ) if ( _aBasedOn >>= oRange) { uno::Reference< excel::XStyle > oStyle( oRange->getStyle(), uno::UNO_QUERY_THROW ); - if ( oStyle.is() ) - { - sParentCellStyleName = oStyle->getName(); - } - else - { - DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, OUString() ); - } + sParentCellStyleName = oStyle->getName(); } else { diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 427c5b8eecf5..a531cf5844e2 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -128,18 +128,12 @@ static void removeAllSheets( const uno::Reference & { uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(i), uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW ); - if (xNamed.is()) - { - xNameContainer->removeByName(xNamed->getName()); - } + xNameContainer->removeByName(xNamed->getName()); } uno::Reference< sheet::XSpreadsheet > xSheet(xIndex->getByIndex(0), uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW ); - if (xNamed.is()) - { - xNamed->setName(aSheetName); - } + xNamed->setName(aSheetName); } } @@ -159,10 +153,7 @@ openNewDoc(const OUString& aSheetName ) "_blank", 0, uno::Sequence < css::beans::PropertyValue >() ) ); uno::Reference xSpreadDoc( xComponent, uno::UNO_QUERY_THROW ); - if ( xSpreadDoc.is() ) - { - removeAllSheets(xSpreadDoc,aSheetName); - } + removeAllSheets(xSpreadDoc,aSheetName); xModel.set(xSpreadDoc,uno::UNO_QUERY_THROW); } catch ( uno::Exception & /*e*/ ) @@ -604,18 +595,15 @@ ScVbaWorksheet::Delete() { uno::Reference xSpreadDoc( getModel(), uno::UNO_QUERY_THROW ); OUString aSheetName = getName(); - if ( xSpreadDoc.is() ) + SCTAB nTab = 0; + if (!ScVbaWorksheets::nameExists(xSpreadDoc, aSheetName, nTab )) { - SCTAB nTab = 0; - if (!ScVbaWorksheets::nameExists(xSpreadDoc, aSheetName, nTab )) - { - return; - } - uno::Reference xSheets = xSpreadDoc->getSheets(); - uno::Reference xNameContainer(xSheets,uno::UNO_QUERY_THROW); - xNameContainer->removeByName(aSheetName); - mxSheet.clear(); + return; } + uno::Reference xSheets = xSpreadDoc->getSheets(); + uno::Reference xNameContainer(xSheets,uno::UNO_QUERY_THROW); + xNameContainer->removeByName(aSheetName); + mxSheet.clear(); } uno::Reference< excel::XWorksheet > diff --git a/sd/qa/unit/activex-controls-tests.cxx b/sd/qa/unit/activex-controls-tests.cxx index 186d9a737624..677db75a0a6c 100644 --- a/sd/qa/unit/activex-controls-tests.cxx +++ b/sd/qa/unit/activex-controls-tests.cxx @@ -97,7 +97,6 @@ void SdActiveXControlsTest::testBackgroundColor() for (size_t i = 0; i < vBackgroundColors.size(); ++i) { uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(i, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); sal_Int32 nColor; @@ -115,7 +114,6 @@ void SdActiveXControlsTest::testLabelProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OUString sLabel; @@ -151,7 +149,6 @@ void SdActiveXControlsTest::testLabelProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Label") >>= sLabel; @@ -184,7 +181,6 @@ void SdActiveXControlsTest::testLabelProperties() // Third control has transparent background xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(false, xPropertySet->getPropertyValue("BackgroundColor") >>= nColor); @@ -198,7 +194,6 @@ void SdActiveXControlsTest::testTextBoxProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OUString sText; @@ -257,7 +252,6 @@ void SdActiveXControlsTest::testTextBoxProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Text") >>= sText; @@ -303,7 +297,6 @@ void SdActiveXControlsTest::testTextBoxProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); // Transparent background @@ -320,7 +313,6 @@ void SdActiveXControlsTest::testTextBoxProperties() // Fourth shape has both scroll bar xControlShape.set(getShapeFromPage(3, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("HScroll") >>= bHScroll; @@ -338,7 +330,6 @@ void SdActiveXControlsTest::testSpinButtonProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); bool bEnabled; @@ -383,7 +374,6 @@ void SdActiveXControlsTest::testSpinButtonProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Enabled") >>= bEnabled; @@ -418,7 +408,6 @@ void SdActiveXControlsTest::testSpinButtonProperties() // Third control has horizontal orientation xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Orientation") >>= nOrientation; @@ -433,7 +422,6 @@ void SdActiveXControlsTest::testCommandButtonProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OUString sLabel; @@ -465,7 +453,6 @@ void SdActiveXControlsTest::testCommandButtonProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Label") >>= sLabel; @@ -491,7 +478,6 @@ void SdActiveXControlsTest::testCommandButtonProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); // Transparent background @@ -507,7 +493,6 @@ void SdActiveXControlsTest::testScrollBarProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); bool bEnabled; @@ -559,7 +544,6 @@ void SdActiveXControlsTest::testScrollBarProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Enabled") >>= bEnabled; @@ -600,7 +584,6 @@ void SdActiveXControlsTest::testScrollBarProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Orientation") >>= nOrientation; @@ -618,7 +601,6 @@ void SdActiveXControlsTest::testCheckBoxProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OUString sLabel; @@ -658,7 +640,6 @@ void SdActiveXControlsTest::testCheckBoxProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Label") >>= sLabel; @@ -690,7 +671,6 @@ void SdActiveXControlsTest::testCheckBoxProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("TriState") >>= bTriState; @@ -714,7 +694,6 @@ void SdActiveXControlsTest::testOptionButtonProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OUString sLabel; @@ -750,7 +729,6 @@ void SdActiveXControlsTest::testOptionButtonProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Label") >>= sLabel; @@ -779,7 +757,6 @@ void SdActiveXControlsTest::testOptionButtonProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("State") >>= nState; @@ -800,7 +777,6 @@ void SdActiveXControlsTest::testComboBoxProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); bool bEnabled; @@ -852,7 +828,6 @@ void SdActiveXControlsTest::testComboBoxProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Enabled") >>= bEnabled; @@ -893,7 +868,6 @@ void SdActiveXControlsTest::testComboBoxProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Autocomplete") >>= bAutocomplete; @@ -917,7 +891,6 @@ void SdActiveXControlsTest::testListBoxProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); bool bEnabled; @@ -961,7 +934,6 @@ void SdActiveXControlsTest::testListBoxProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Enabled") >>= bEnabled; @@ -990,7 +962,6 @@ void SdActiveXControlsTest::testListBoxProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("MultiSelection") >>= bMultiSelection; @@ -1008,7 +979,6 @@ void SdActiveXControlsTest::testToggleButtonProperties() // First control has default properties uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OUString sLabel; @@ -1044,7 +1014,6 @@ void SdActiveXControlsTest::testToggleButtonProperties() // Second control has custom properties xControlShape.set(getShapeFromPage(1, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("Label") >>= sLabel; @@ -1073,7 +1042,6 @@ void SdActiveXControlsTest::testToggleButtonProperties() // Third shape has some other custom properties xControlShape.set(getShapeFromPage(2, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY); xPropertySet->getPropertyValue("State") >>= nState; @@ -1116,7 +1084,6 @@ void SdActiveXControlsTest::testPictureProperties() for (size_t i = 0; i < vImagePositions.size(); ++i) { uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(i, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); uno::Reference xGraphic; @@ -1133,7 +1100,6 @@ void SdActiveXControlsTest::testPictureProperties() for (size_t i = 0; i < 4; ++i) { uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(vImagePositions.size() + i, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OString sMessage = "The wrong control's index is: " + OString::number(i); @@ -1170,7 +1136,6 @@ void SdActiveXControlsTest::testFontProperties() for (size_t i = 0; i < 8; ++i) { uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(i, 0, xDocShRef), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xControlShape.is()); uno::Reference xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); OString sMessage = "The wrong control's index is: " + OString::number(i); diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 5fdb232625ef..9e07f8be4774 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1236,7 +1236,6 @@ void SdImportTest::testPDFImportSkipImages() CPPUNIT_ASSERT_EQUAL_MESSAGE( "no exactly one shape", static_cast(1), xPage->getCount() ); uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW ); - CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() ); uno::Reference xText = uno::Reference(xShape, uno::UNO_QUERY)->getText(); CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() ); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index a51bc3c260a1..6a6af6ea7cdf 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -237,9 +237,7 @@ protected: CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() ); uno::Reference xTempModel(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xTempModel.is()); uno::Reference xDrawPagesSupplier (xTempModel, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDrawPagesSupplier.is()); uno::Reference< drawing::XDrawPages > xDrawPages = xDrawPagesSupplier->getDrawPages(); CPPUNIT_ASSERT(xDrawPages.is()); @@ -282,7 +280,6 @@ protected: { uno::Reference< drawing::XDrawPagesSupplier > xDoc ( xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); - CPPUNIT_ASSERT_MESSAGE( "no document", xDoc.is() ); return xDoc; } @@ -290,7 +287,6 @@ protected: { uno::Reference< drawing::XDrawPagesSupplier > xDoc( getDoc( xDocShRef ) ); uno::Reference< drawing::XDrawPage > xPage( xDoc->getDrawPages()->getByIndex( nPage ), uno::UNO_QUERY_THROW ); - CPPUNIT_ASSERT_MESSAGE( "no page", xPage.is() ); return xPage; } diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 0b18595be1de..bba621dbab1e 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -2021,12 +2021,8 @@ void stl_process_after_effect_node_func(AfterEffectNode const & rNode) xNextContainer.set( ParallelTimeContainer::create( xContext ), UNO_QUERY_THROW ); - DBG_ASSERT( xNextContainer.is(), "ppt::stl_process_after_effect_node_func::operator(), could not create container!" ); - if( xNextContainer.is() ) - { - xNextContainer->setBegin( makeAny( 0.0 ) ); - xNewClickContainer->appendChild( xNextContainer ); - } + xNextContainer->setBegin( makeAny( 0.0 ) ); + xNewClickContainer->appendChild( xNextContainer ); } if( xNextContainer.is() ) diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index a861b162f32c..169dc83c202e 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -1275,7 +1275,7 @@ void AnimationExporter::exportAnimEvent( SvStream& rStrm, const Reference< XAnim // taking the first child Reference< XEnumerationAccess > xEA( xNode, UNO_QUERY_THROW ); Reference< XEnumeration > xE( xEA->createEnumeration(), UNO_QUERY_THROW ); - if ( xE.is() && xE->hasMoreElements() ) + if ( xE->hasMoreElements() ) { Reference< XAnimationNode > xClickNode( xE->nextElement(), UNO_QUERY ); aAny = xClickNode->getBegin(); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index e7f8c553d6a2..cca48273915f 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -859,12 +859,9 @@ void CustomAnimationPane::onSelectionChanged() if( mxView.is() ) try { Reference< XSelectionSupplier > xSel( mxView, UNO_QUERY_THROW ); - if (xSel.is()) - { - maViewSelection = xSel->getSelection(); - mpCustomAnimationList->onSelectionChanged( maViewSelection ); - updateControls(); - } + maViewSelection = xSel->getSelection(); + mpCustomAnimationList->onSelectionChanged( maViewSelection ); + updateControls(); } catch( Exception& ) { diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 42406d994f55..a1b7ca35ba8f 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -123,12 +123,8 @@ void SAL_CALL PresenterTextView::initialize (const Sequence& rArguments) } Reference xCanvas (rArguments[0], UNO_QUERY_THROW); - if (xCanvas.is()) - { - mpImplementation->SetCanvas( - cppcanvas::VCLFactory::createCanvas(xCanvas)); - } - + mpImplementation->SetCanvas( + cppcanvas::VCLFactory::createCanvas(xCanvas)); } Any PresenterTextView::GetPropertyValue (const OUString& rsPropertyName) diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 23a8dd2499e4..a752b7407a70 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -246,27 +246,24 @@ void TableDesignWidget::onSelectionChanged() if( mxView.is() ) try { Reference< XSelectionSupplier > xSel( mxView, UNO_QUERY_THROW ); - if (xSel.is()) + Any aSel( xSel->getSelection() ); + Sequence< XShape > xShapeSeq; + if( aSel >>= xShapeSeq ) { - Any aSel( xSel->getSelection() ); - Sequence< XShape > xShapeSeq; - if( aSel >>= xShapeSeq ) - { - if( xShapeSeq.getLength() == 1 ) - aSel <<= xShapeSeq[0]; - } - else - { - Reference< XShapes > xShapes( aSel, UNO_QUERY ); - if( xShapes.is() && (xShapes->getCount() == 1) ) - aSel = xShapes->getByIndex(0); - } + if( xShapeSeq.getLength() == 1 ) + aSel <<= xShapeSeq[0]; + } + else + { + Reference< XShapes > xShapes( aSel, UNO_QUERY ); + if( xShapes.is() && (xShapes->getCount() == 1) ) + aSel = xShapes->getByIndex(0); + } - Reference< XShapeDescriptor > xDesc( aSel, UNO_QUERY ); - if( xDesc.is() && ( xDesc->getShapeType() == "com.sun.star.drawing.TableShape" || xDesc->getShapeType() == "com.sun.star.presentation.TableShape" ) ) - { - xNewSelection.set( xDesc, UNO_QUERY ); - } + Reference< XShapeDescriptor > xDesc( aSel, UNO_QUERY ); + if( xDesc.is() && ( xDesc->getShapeType() == "com.sun.star.drawing.TableShape" || xDesc->getShapeType() == "com.sun.star.presentation.TableShape" ) ) + { + xNewSelection.set( xDesc, UNO_QUERY ); } } catch( Exception& ) diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index b612cc66ce46..8749fa94d287 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2809,29 +2809,26 @@ void SdMasterPage::setBackground( const Any& rValue ) { Reference< container::XNameAccess > xFamilies( GetModel()->getStyleFamilies(), UNO_QUERY_THROW ); Reference< container::XNameAccess > xFamily( xFamilies->getByName( getName() ), UNO_QUERY_THROW ) ; - if( xFamily.is() ) - { - OUString aStyleName(sUNO_PseudoSheet_Background); + OUString aStyleName(sUNO_PseudoSheet_Background); - Reference< beans::XPropertySet > xStyleSet( xFamily->getByName( aStyleName ), UNO_QUERY_THROW ); + Reference< beans::XPropertySet > xStyleSet( xFamily->getByName( aStyleName ), UNO_QUERY_THROW ); - Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_QUERY_THROW ); - Reference< beans::XPropertyState > xSetStates( xInputSet, UNO_QUERY ); + Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_QUERY_THROW ); + Reference< beans::XPropertyState > xSetStates( xInputSet, UNO_QUERY ); - PropertyEntryVector_t aBackgroundProperties = ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries(); - PropertyEntryVector_t::const_iterator aIt = aBackgroundProperties.begin(); - while( aIt != aBackgroundProperties.end() ) + PropertyEntryVector_t aBackgroundProperties = ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries(); + PropertyEntryVector_t::const_iterator aIt = aBackgroundProperties.begin(); + while( aIt != aBackgroundProperties.end() ) + { + if( xSetInfo->hasPropertyByName( aIt->sName ) ) { - if( xSetInfo->hasPropertyByName( aIt->sName ) ) - { - if( !xSetStates.is() || xSetStates->getPropertyState( aIt->sName ) == beans::PropertyState_DIRECT_VALUE ) - xStyleSet->setPropertyValue( aIt->sName, xInputSet->getPropertyValue( aIt->sName ) ); - else - xSetStates->setPropertyToDefault( aIt->sName ); - } - - ++aIt; + if( !xSetStates.is() || xSetStates->getPropertyState( aIt->sName ) == beans::PropertyState_DIRECT_VALUE ) + xStyleSet->setPropertyValue( aIt->sName, xInputSet->getPropertyValue( aIt->sName ) ); + else + xSetStates->setPropertyToDefault( aIt->sName ); } + + ++aIt; } } else diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx index 34e7964049d6..2e8c129082f9 100644 --- a/sdext/source/minimizer/graphiccollector.cxx +++ b/sdext/source/minimizer/graphiccollector.cxx @@ -135,54 +135,51 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const if ( rxPropertySet->getPropertyValue( "FillBitmap" ) >>= xFillBitmap ) { Reference< XGraphic > xGraphic( xFillBitmap, UNO_QUERY_THROW ); - if ( xGraphic.is() ) + awt::Size aLogicalSize( rLogicalSize ); + Reference< XPropertySetInfo > axPropSetInfo( rxPropertySet->getPropertySetInfo() ); + if ( axPropSetInfo.is() ) { - awt::Size aLogicalSize( rLogicalSize ); - Reference< XPropertySetInfo > axPropSetInfo( rxPropertySet->getPropertySetInfo() ); - if ( axPropSetInfo.is() ) + if ( axPropSetInfo->hasPropertyByName( "FillBitmapMode" ) ) { - if ( axPropSetInfo->hasPropertyByName( "FillBitmapMode" ) ) + BitmapMode eBitmapMode; + if ( rxPropertySet->getPropertyValue( "FillBitmapMode" ) >>= eBitmapMode ) { - BitmapMode eBitmapMode; - if ( rxPropertySet->getPropertyValue( "FillBitmapMode" ) >>= eBitmapMode ) + if ( ( eBitmapMode == BitmapMode_REPEAT ) || ( eBitmapMode == BitmapMode_NO_REPEAT ) ) { - if ( ( eBitmapMode == BitmapMode_REPEAT ) || ( eBitmapMode == BitmapMode_NO_REPEAT ) ) + bool bLogicalSize = false; + awt::Size aSize( 0, 0 ); + if ( ( rxPropertySet->getPropertyValue( "FillBitmapLogicalSize" ) >>= bLogicalSize ) + && ( rxPropertySet->getPropertyValue( "FillBitmapSizeX" ) >>= aSize.Width ) + && ( rxPropertySet->getPropertyValue( "FillBitmapSizeY" ) >>= aSize.Height ) ) { - bool bLogicalSize = false; - awt::Size aSize( 0, 0 ); - if ( ( rxPropertySet->getPropertyValue( "FillBitmapLogicalSize" ) >>= bLogicalSize ) - && ( rxPropertySet->getPropertyValue( "FillBitmapSizeX" ) >>= aSize.Width ) - && ( rxPropertySet->getPropertyValue( "FillBitmapSizeY" ) >>= aSize.Height ) ) + if ( bLogicalSize ) { - if ( bLogicalSize ) + if ( !aSize.Width || !aSize.Height ) { - if ( !aSize.Width || !aSize.Height ) - { - awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) ); - if ( aSize100thMM.Width && aSize100thMM.Height ) - aLogicalSize = aSize100thMM; - } - else - aLogicalSize = aSize; + awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) ); + if ( aSize100thMM.Width && aSize100thMM.Height ) + aLogicalSize = aSize100thMM; } else - { - aLogicalSize.Width = sal::static_int_cast< sal_Int32 >( ( static_cast< double >( aLogicalSize.Width ) * aSize.Width ) / -100.0 ); - aLogicalSize.Height = sal::static_int_cast< sal_Int32 >( ( static_cast< double >( aLogicalSize.Height ) * aSize.Height ) / -100.0 ); - } + aLogicalSize = aSize; + } + else + { + aLogicalSize.Width = sal::static_int_cast< sal_Int32 >( ( static_cast< double >( aLogicalSize.Width ) * aSize.Width ) / -100.0 ); + aLogicalSize.Height = sal::static_int_cast< sal_Int32 >( ( static_cast< double >( aLogicalSize.Height ) * aSize.Height ) / -100.0 ); } } } } } - GraphicCollector::GraphicUser aUser; - aUser.mxPropertySet = rxPropertySet; - aUser.mxGraphic = xGraphic; - aUser.mbFillBitmap = true; - aUser.maLogicalSize = aLogicalSize; - aUser.mxPagePropertySet = rxPagePropertySet; - ImpAddEntity( rGraphicEntities, rGraphicSettings, aUser ); } + GraphicCollector::GraphicUser aUser; + aUser.mxPropertySet = rxPropertySet; + aUser.mxGraphic = xGraphic; + aUser.mbFillBitmap = true; + aUser.maLogicalSize = aLogicalSize; + aUser.mxPagePropertySet = rxPagePropertySet; + ImpAddEntity( rGraphicEntities, rGraphicSettings, aUser ); } } } diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx index 70f9c493981c..7b7232b04e1a 100644 --- a/sdext/source/presenter/PresenterButton.cxx +++ b/sdext/source/presenter/PresenterButton.cxx @@ -127,10 +127,7 @@ PresenterButton::PresenterButton ( // Make the background transparent. Reference xPeer (mxWindow, UNO_QUERY_THROW); - if (xPeer.is()) - { - xPeer->setBackground(0xff000000); - } + xPeer->setBackground(0xff000000); mxWindow->setVisible(true); mxWindow->addWindowListener(this); diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx index 5cc42ef5e64f..da089fb335ce 100644 --- a/sdext/source/presenter/PresenterScrollBar.cxx +++ b/sdext/source/presenter/PresenterScrollBar.cxx @@ -122,10 +122,7 @@ PresenterScrollBar::PresenterScrollBar ( // Make the background transparent. The slide show paints its own background. Reference xPeer (mxWindow, UNO_QUERY_THROW); - if (xPeer.is()) - { - xPeer->setBackground(0xff000000); - } + xPeer->setBackground(0xff000000); mxWindow->setVisible(true); mxWindow->addWindowListener(this); diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index 88c60b1625a3..c4368fa3eb9b 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -94,8 +94,7 @@ void PresenterSlideShowView::LateInit() { mxSlideShow.set( mxSlideShowController->getSlideShow(), UNO_QUERY_THROW); Reference xSlideShowComponent (mxSlideShow, UNO_QUERY); - if (xSlideShowComponent.is()) - xSlideShowComponent->addEventListener(static_cast(this)); + xSlideShowComponent->addEventListener(static_cast(this)); Reference xFactory ( mxComponentContext->getServiceManager(), UNO_QUERY_THROW); @@ -819,10 +818,7 @@ Reference PresenterSlideShowView::CreateViewWindow ( // Make the background transparent. The slide show paints its own background. Reference xPeer (xViewWindow, UNO_QUERY_THROW); - if (xPeer.is()) - { - xPeer->setBackground(0xff000000); - } + xPeer->setBackground(0xff000000); xViewWindow->setVisible(true); } diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index cc1f98358a3b..210b74087407 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -701,8 +701,7 @@ geometry::RealRectangle2D PresenterSlideSorter::PlaceScrollBars ( mpLayout->Update(rUpperBox, GetSlideAspectRatio()); bool bIsScrollBarNeeded (false); Reference xSlides (mxSlideShowController, UNO_QUERY_THROW); - if (xSlides.is()) - bIsScrollBarNeeded = mpLayout->IsScrollBarNeeded(xSlides->getCount()); + bIsScrollBarNeeded = mpLayout->IsScrollBarNeeded(xSlides->getCount()); if (mpVerticalScrollBar.get() != nullptr) { if (bIsScrollBarNeeded) diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index c5608c8e0e30..c9b6da55d3ea 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -183,12 +183,8 @@ bool SfxApplication::loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWid if(xBitmap.is()) { const uno::Reference< rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW); - - if(xIntBmp.is()) - { - rBitmap = vcl::unotools::bitmapExFromXBitmap(xIntBmp); - return true; - } + rBitmap = vcl::unotools::bitmapExFromXBitmap(xIntBmp); + return true; } } catch(const uno::Exception&) diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index be31957eafdd..970c9ced8938 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -202,7 +202,6 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL, ::comphelper::getProcessComponentContext() ) ); uno::Reference xUserDefinedProps( i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); - DBG_ASSERT(xUserDefinedProps.is(), "UserDefinedProperties is null"); uno::Reference xPropInfo = xUserDefinedProps->getPropertySetInfo(); DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null"); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 1d808f67c5c3..f61f2a09e682 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1764,10 +1764,6 @@ SfxDocumentMetaData::loadFromStorage( xMsf->createInstanceWithArgumentsAndContext( OUString::createFromAscii(pServiceName), args, m_xContext), css::uno::UNO_QUERY_THROW); - if (!xDocHandler.is()) - throw css::uno::RuntimeException( - "SfxDocumentMetaData::loadFromStorage:" - " cannot create XMLOasisMetaImporter service", *this); css::uno::Reference xImp (xDocHandler, css::uno::UNO_QUERY_THROW); xImp->setTargetDocument(css::uno::Reference(this)); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 57536a51ddc1..d6ea0e8f6c54 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -4025,8 +4025,7 @@ bool SfxMedium::SwitchDocumentToFile( const OUString& aURL ) try { uno::Reference< io::XTruncate > xTruncate( pImpl->xStream, uno::UNO_QUERY_THROW ); - if ( xTruncate.is() ) - xTruncate->truncate(); + xTruncate->truncate(); if ( xOptStorage.is() ) xOptStorage->writeAndAttachToStream( pImpl->xStream ); pImpl->xStorage = xStorage; diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index e387526d33ce..41d4c380254f 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -270,7 +270,6 @@ bool SaveOlePropertySet( uno::Reference xUserDefinedProps( i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); - DBG_ASSERT(xUserDefinedProps.is(), "UserDefinedProperties is null"); uno::Reference xPropInfo = xUserDefinedProps->getPropertySetInfo(); DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null"); diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx index 4c01c13191ac..296d0045b11d 100644 --- a/svx/source/core/graphichelper.cxx +++ b/svx/source/core/graphichelper.cxx @@ -410,11 +410,8 @@ void GraphicHelper::SaveShapeAsGraphic(weld::Window* pParent, const Reference< aDescriptor[1].Value <<= sPath; Reference< XComponent > xSourceDocument( xShape, UNO_QUERY_THROW ); - if ( xSourceDocument.is() ) - { - xGraphicExporter->setSourceDocument( xSourceDocument ); - xGraphicExporter->filter( aDescriptor ); - } + xGraphicExporter->setSourceDocument( xSourceDocument ); + xGraphicExporter->filter( aDescriptor ); } } } diff --git a/svx/source/svdraw/charthelper.cxx b/svx/source/svdraw/charthelper.cxx index 255c0c03832b..4e1d0a698318 100644 --- a/svx/source/svdraw/charthelper.cxx +++ b/svx/source/svdraw/charthelper.cxx @@ -78,13 +78,10 @@ void ChartHelper::updateChart( const uno::Reference< ::frame::XModel >& rXModel, const uno::Reference< lang::XUnoTunnel > xChartView(xChartFact->createInstance("com.sun.star.chart2.ChartView"), uno::UNO_QUERY_THROW); const uno::Reference xUpdatable(xChartView, uno::UNO_QUERY_THROW); - if (xUpdatable.is()) - { - if (bHardUpdate) - xUpdatable->updateHard(); - else - xUpdatable->updateSoft(); - } + if (bHardUpdate) + xUpdatable->updateHard(); + else + xUpdatable->updateSoft(); } catch(uno::Exception&) { @@ -108,7 +105,7 @@ drawinglayer::primitive2d::Primitive2DContainer ChartHelper::tryToGetChartConten const uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier(rXModel, uno::UNO_QUERY_THROW); const uno::Reference< container::XIndexAccess > xShapeAccess(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW); - if(xShapeAccess.is() && xShapeAccess->getCount()) + if(xShapeAccess->getCount()) { const sal_Int32 nShapeCount(xShapeAccess->getCount()); const uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 284493ac78fd..efa76097a420 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -1857,7 +1857,7 @@ void SvxTableController::findMergeOrigin( CellPos& rPos ) if( mxTable.is() ) try { Reference< XMergeableCell > xCell( mxTable->getCellByPosition( rPos.mnCol, rPos.mnRow ), UNO_QUERY_THROW ); - if( xCell.is() && xCell->isMerged() ) + if( xCell->isMerged() ) { ::findMergeOrigin( mxTable, rPos.mnCol, rPos.mnRow, rPos.mnCol, rPos.mnRow ); } diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index ea648273ffd4..10857ba30b52 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -324,7 +324,7 @@ bool findMergeOrigin( const TableModelRef& xTable, sal_Int32 nMergedX, sal_Int32 { // check if this cell already the origin or not merged at all Reference< XMergeableCell > xCell( xTable->getCellByPosition( nMergedX, nMergedY ), UNO_QUERY_THROW ); - if( !xCell.is() || !xCell->isMerged() ) + if( !xCell->isMerged() ) return true; bool bCheckVert = true; diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index f41eda3854d3..a45f14bf0a78 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -324,13 +324,7 @@ static void openStorageStream( xml::sax::InputSource *pParserInput, rtl::Reference& rxGraphicHelper, const uno::Reference < embed::XStorage >& xStorage ) { - uno::Reference < io::XStream > xIStm; - xIStm.set( xStorage->openStreamElement( "Content.xml", embed::ElementModes::READ ), uno::UNO_QUERY_THROW ); - if( !xIStm.is() ) - { - OSL_FAIL( "could not open Content stream" ); - return; - } + uno::Reference < io::XStream > xIStm( xStorage->openStreamElement( "Content.xml", embed::ElementModes::READ ), uno::UNO_QUERY_THROW ); pParserInput->aInputStream = xIStm->getInputStream(); rxGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Read ); } diff --git a/sw/qa/api/XTextContentTest.hxx b/sw/qa/api/XTextContentTest.hxx index 4cb52d29db9b..f3227a5c2204 100644 --- a/sw/qa/api/XTextContentTest.hxx +++ b/sw/qa/api/XTextContentTest.hxx @@ -41,10 +41,7 @@ public: css::uno::Reference xTextRange(map["text::XTextRange"], css::uno::UNO_QUERY_THROW); - if (xTextContent.is()) - { - xTextContent->attach(xTextRange); - } + xTextContent->attach(xTextRange); } void testGetAnchor() diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index d15bdfdab62e..2f9f8beff3c8 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -406,7 +406,6 @@ void SwMacrosTest::testFdo68983() CPPUNIT_ASSERT_MESSAGE("Failed to load fdo68983.odt", xComponent.is()); Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); utl::TempFile aTempFile; aTempFile.EnableKillingFile(); @@ -459,8 +458,6 @@ void SwMacrosTest::testFdo87530() xBasLibPwd->changeLibraryPassword("BarLibrary", "", "foo"); Reference xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); - xDocStorable->storeAsURL(aTempFile.GetURL(), desc); } @@ -491,8 +488,6 @@ void SwMacrosTest::testFdo87530() // store again Reference xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); - xDocStorable->store(); } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b7373bfa5235..e3cfea969113 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2351,30 +2351,26 @@ void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj) if (pSdrObj) { uno::Reference xShape(const_cast(pSdrObj)->getUnoShape(), uno::UNO_QUERY_THROW); - if( xShape.is() ) + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); + if( xPropSet.is() ) { - uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); - uno::Reference< beans::XPropertySetInfo > xPropSetInfo; - if( xPropSet.is() ) + uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + uno::Sequence< beans::PropertyValue > aGrabBag; + if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) { - xPropSetInfo = xPropSet->getPropertySetInfo(); - uno::Sequence< beans::PropertyValue > aGrabBag; - if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) - { - xPropSet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; - } - else if(xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("InteropGrabBag")) - { - xPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; - } + xPropSet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + } + else if(xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("InteropGrabBag")) + { + xPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + } - for (sal_Int32 nProp=0; nProp < aGrabBag.getLength(); ++nProp) + for (sal_Int32 nProp=0; nProp < aGrabBag.getLength(); ++nProp) + { + if ("SdtEndBefore" == aGrabBag[nProp].Name && m_bStartedCharSdt && !m_bEndCharSdt) { - if ("SdtEndBefore" == aGrabBag[nProp].Name && m_bStartedCharSdt && !m_bEndCharSdt) - { - aGrabBag[nProp].Value >>= m_bEndCharSdt; - break; - } + aGrabBag[nProp].Value >>= m_bEndCharSdt; + break; } } } diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 7f841e2ba7ae..d66ba8126a94 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -198,13 +198,10 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa try { uno::Reference< beans::XPropertySet > xTransferableProperties( aAttachments[nFile].Data, uno::UNO_QUERY_THROW); - if( xTransferableProperties.is() ) - { - OUString sURL; - xTransferableProperties->getPropertyValue("URL") >>= sURL; - if(!sURL.isEmpty()) - SWUnoHelper::UCB_DeleteFile( sURL ); - } + OUString sURL; + xTransferableProperties->getPropertyValue("URL") >>= sURL; + if(!sURL.isEmpty()) + SWUnoHelper::UCB_DeleteFile( sURL ); } catch (const uno::Exception&) { diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx index 7cada2510f34..c2f2dfb8d701 100644 --- a/sw/source/ui/vba/vbadocuments.cxx +++ b/sw/source/ui/vba/vbadocuments.cxx @@ -102,10 +102,7 @@ SwVbaDocuments::Add( const uno::Any& Template, const uno::Any& /*NewTemplate*/, return Open( sFileName, uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any()); } uno::Reference xTextDoc( createDocument() , uno::UNO_QUERY_THROW ); - - if( xTextDoc.is() ) - return getDocument( mxContext, xTextDoc, Application() ); - return uno::Any(); + return getDocument( mxContext, xTextDoc, Application() ); } // #TODO# #FIXME# can any of the unused params below be used? diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 84ed8c5dddab..ad6d3c5860e7 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -80,11 +80,8 @@ namespace if ( xModel.is() ) { const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW ); - if ( xSuppUndo.is() ) - { - const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); - return xUndoManager; - } + const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); + return xUndoManager; } } diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index 1812a572ceef..a5ff79bab38e 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -38,11 +38,8 @@ namespace { if ( xModel.is() ) { const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW ); - if ( xSuppUndo.is() ) - { - const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); - return xUndoManager; - } + const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); + return xUndoManager; } } diff --git a/test/source/container/xindexaccess.cxx b/test/source/container/xindexaccess.cxx index c17942507fe5..3791e2b76393 100644 --- a/test/source/container/xindexaccess.cxx +++ b/test/source/container/xindexaccess.cxx @@ -48,8 +48,6 @@ void XIndexAccess::testGetByIndex() void XIndexAccess::testGetByIndexException() { uno::Reference< container::XIndexAccess > xIndexAccess(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xIndexAccess.is()); - xIndexAccess->getByIndex(mnItems); } diff --git a/test/source/container/xnamereplace.cxx b/test/source/container/xnamereplace.cxx index 77badb46a0c2..cd2a05ae8f9a 100644 --- a/test/source/container/xnamereplace.cxx +++ b/test/source/container/xnamereplace.cxx @@ -22,7 +22,6 @@ void XNameReplace::testReplaceByName() xNameReplace->replaceByName(maTestReplacementName, getAnyElementForNameReplace()); Any aAny = xNameReplace->getByName( maTestReplacementName ); uno::Reference< uno::XInterface > xElement(aAny, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xElement.is()); } } diff --git a/test/source/sheet/tableautoformatfield.cxx b/test/source/sheet/tableautoformatfield.cxx index ebcc50d26c89..63387e5e388c 100644 --- a/test/source/sheet/tableautoformatfield.cxx +++ b/test/source/sheet/tableautoformatfield.cxx @@ -19,11 +19,8 @@ namespace apitest { uno::Reference< beans::XPropertySet > TableAutoFormatField::initTest() { uno::Reference< container::XIndexAccess > xAutoFormatFields( getServiceFactory()->createInstance("com.sun.star.sheet.TableAutoFormats"), UNO_QUERY_THROW ); - CPPUNIT_ASSERT(xAutoFormatFields.is()); uno::Reference< container::XIndexAccess > xIndex( xAutoFormatFields->getByIndex(0), UNO_QUERY_THROW ); - CPPUNIT_ASSERT(xIndex.is()); uno::Reference< beans::XPropertySet > xReturn( xIndex->getByIndex(0), UNO_QUERY_THROW ); - CPPUNIT_ASSERT_MESSAGE("could not create table auto formats", xReturn.is()); return xReturn; } diff --git a/test/source/sheet/xconsolidatable.cxx b/test/source/sheet/xconsolidatable.cxx index f5616e78c43e..77f6943bc008 100644 --- a/test/source/sheet/xconsolidatable.cxx +++ b/test/source/sheet/xconsolidatable.cxx @@ -27,8 +27,6 @@ void XConsolidatable::testCreateConsolidationDescriptor() uno::Reference xConsolidationDescriptor( xConsolidatable->createConsolidationDescriptor(true), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Unable to create ConsolidationDescriptor", - xConsolidationDescriptor.is()); } void XConsolidatable::testConsolidate() diff --git a/test/source/sheet/xdatabaserange.cxx b/test/source/sheet/xdatabaserange.cxx index 94caccec9374..d00631820647 100644 --- a/test/source/sheet/xdatabaserange.cxx +++ b/test/source/sheet/xdatabaserange.cxx @@ -130,7 +130,6 @@ void XDatabaseRange::testGetFilterDescriptor() { uno::Reference< sheet::XDatabaseRange > xDBRange( init("FilterDescriptor"), UNO_QUERY_THROW); uno::Reference< uno::XInterface > xFilterDescr( xDBRange->getFilterDescriptor(), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xFilterDescr.is()); } void XDatabaseRange::testGetImportDescriptor() diff --git a/test/source/sheet/xdatapilotdescriptor.cxx b/test/source/sheet/xdatapilotdescriptor.cxx index 33557a72fa99..eb3b69636315 100644 --- a/test/source/sheet/xdatapilotdescriptor.cxx +++ b/test/source/sheet/xdatapilotdescriptor.cxx @@ -70,7 +70,6 @@ void XDataPilotDescriptor::testGetFilterDescriptor() void XDataPilotDescriptor::testGetDataPilotFields_Impl( uno::Reference< sheet::XDataPilotDescriptor > const & xDescr) { uno::Reference< container::XIndexAccess > xIndex(xDescr->getDataPilotFields(), UNO_QUERY_THROW); - CPPUNIT_ASSERT( xIndex.is()); sal_Int32 nCount = xIndex->getCount(); @@ -78,13 +77,11 @@ void XDataPilotDescriptor::testGetDataPilotFields_Impl( uno::Reference< sheet::X for (sal_Int32 i = 0; i < nCount && i < 5; ++i) { uno::Reference< container::XNamed > xNamed( xIndex->getByIndex( i ), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xNamed.is()); OUString aName = xNamed->getName(); maFieldNames.push_back(aName); CPPUNIT_ASSERT( aName != "Data" ); uno::Reference< beans::XPropertySet > xPropSet( xNamed, UNO_QUERY_THROW); - CPPUNIT_ASSERT( xPropSet.is() ); switch ( i % 5 ) { diff --git a/test/source/sheet/xdatapilottable2.cxx b/test/source/sheet/xdatapilottable2.cxx index 471996627d28..5d49871bc620 100644 --- a/test/source/sheet/xdatapilottable2.cxx +++ b/test/source/sheet/xdatapilottable2.cxx @@ -161,7 +161,6 @@ void XDataPilotTable2::testInsertDrillDownSheet() { CPPUNIT_ASSERT(aData.getLength() >= 2); uno::Reference< sheet::XSpreadsheet > xSheet(xIA->getByIndex(aAddr.Sheet),UNO_QUERY_THROW); - CPPUNIT_ASSERT(xSheet.is()); checkDrillDownSheetContent(xSheet, aData); diff --git a/test/source/sheet/xdatapilottables.cxx b/test/source/sheet/xdatapilottables.cxx index e99bbea4c893..543bf48d6db4 100644 --- a/test/source/sheet/xdatapilottables.cxx +++ b/test/source/sheet/xdatapilottables.cxx @@ -30,7 +30,6 @@ void XDataPilotTables::testXDataPilotTables() uno::Reference xDPD(xDPT->createDataPilotDescriptor(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Unable to create DataPilotDescriptor", xDPD.is()); xDPT->insertNewByName("XDataPilotTables", table::CellAddress(0, 9, 8), xDPD); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to insert new DataPilotTable", OUString("Filter"), diff --git a/test/source/sheet/xdatapilottablessupplier.cxx b/test/source/sheet/xdatapilottablessupplier.cxx index 5a761d98d65c..b9ea30d3d173 100644 --- a/test/source/sheet/xdatapilottablessupplier.cxx +++ b/test/source/sheet/xdatapilottablessupplier.cxx @@ -25,7 +25,6 @@ void XDataPilotTablesSupplier::testGetDataPilotTables() uno::Reference xDPTS(init(), UNO_QUERY_THROW); uno::Reference xDPT(xDPTS->getDataPilotTables(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Unable to get XDataPilotTables", xDPT.is()); } } diff --git a/test/source/sheet/xscenariossupplier.cxx b/test/source/sheet/xscenariossupplier.cxx index c9819d5e8389..e54c923e3438 100644 --- a/test/source/sheet/xscenariossupplier.cxx +++ b/test/source/sheet/xscenariossupplier.cxx @@ -23,9 +23,7 @@ namespace apitest void XScenariosSupplier::testGetScenarios() { uno::Reference xSupplier(init(), UNO_QUERY_THROW); - uno::Reference xScenarios(xSupplier->getScenarios(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Unable to get XScenarios", xScenarios.is()); } } diff --git a/test/source/sheet/xsheetannotationssupplier.cxx b/test/source/sheet/xsheetannotationssupplier.cxx index 82e4bb41e6c9..622ea2bc202a 100644 --- a/test/source/sheet/xsheetannotationssupplier.cxx +++ b/test/source/sheet/xsheetannotationssupplier.cxx @@ -26,7 +26,6 @@ void XSheetAnnotationsSupplier::testGetAnnotations() uno::Reference xAnnotations(xSupplier->getAnnotations(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Unable to get XSheetAnnotations", xAnnotations.is()); } } diff --git a/test/source/sheet/xspreadsheet.cxx b/test/source/sheet/xspreadsheet.cxx index 2b6d0a0fec27..d1df8a690ddc 100644 --- a/test/source/sheet/xspreadsheet.cxx +++ b/test/source/sheet/xspreadsheet.cxx @@ -27,7 +27,6 @@ void XSpreadsheet::testCreateCursor() uno::Reference< sheet::XSpreadsheet > xSheet(init(), UNO_QUERY_THROW); uno::Reference< sheet::XSheetCellCursor > xCursor(xSheet->createCursor(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Unable to create XSheetCellCursor", xCursor.is()); } void XSpreadsheet::testCreateCursorByRange() @@ -36,7 +35,6 @@ void XSpreadsheet::testCreateCursorByRange() uno::Reference< sheet::XSheetCellRange > xCellRange(xSheet->getCellRangeByPosition(1, 1, 2, 3), UNO_QUERY_THROW); uno::Reference< sheet::XSheetCellCursor > xCursor(xSheet->createCursorByRange(xCellRange), UNO_QUERY_THROW); - CPPUNIT_ASSERT_MESSAGE("Unable to create XSheetCellCursor", xCursor.is()); } } diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx index 5171d0a04291..162198b00fad 100644 --- a/test/source/sheet/xspreadsheets2.cxx +++ b/test/source/sheet/xspreadsheets2.cxx @@ -285,7 +285,6 @@ uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUStri CPPUNIT_ASSERT(xComp.is()); uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComp, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDoc.is()); return xDoc; } @@ -293,8 +292,6 @@ uno::Reference< sheet::XNamedRanges> XSpreadsheets2::getNamedRanges(uno::Referen { uno::Reference< beans::XPropertySet > xPropSet (xDoc, UNO_QUERY_THROW); uno::Reference< sheet::XNamedRanges > xNamedRanges(xPropSet->getPropertyValue("NamedRanges"), UNO_QUERY_THROW); - CPPUNIT_ASSERT(xNamedRanges.is()); - return xNamedRanges; } diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index c1b780c54985..84b193ee9c1f 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -202,11 +202,9 @@ VbaApplicationBase::getDisplayStatusBar() uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); - if( xProps.is() ){ - uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager"), uno::UNO_QUERY_THROW ); - if( xLayoutManager.is() && xLayoutManager->isElementVisible( "private:resource/statusbar/statusbar" ) ){ - return true; - } + uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager"), uno::UNO_QUERY_THROW ); + if( xLayoutManager->isElementVisible( "private:resource/statusbar/statusbar" ) ){ + return true; } return false; } @@ -218,20 +216,16 @@ VbaApplicationBase::setDisplayStatusBar(sal_Bool bDisplayStatusBar) uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); - if( xProps.is() ){ - uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager" ), uno::UNO_QUERY_THROW ); - OUString url( "private:resource/statusbar/statusbar" ); - if( xLayoutManager.is() ){ - if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){ - if( !xLayoutManager->showElement( url ) ) - xLayoutManager->createElement( url ); - return; - } - else if( !bDisplayStatusBar && xLayoutManager->isElementVisible( url ) ){ - xLayoutManager->hideElement( url ); - return; - } - } + uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( "LayoutManager" ), uno::UNO_QUERY_THROW ); + OUString url( "private:resource/statusbar/statusbar" ); + if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){ + if( !xLayoutManager->showElement( url ) ) + xLayoutManager->createElement( url ); + return; + } + else if( !bDisplayStatusBar && xLayoutManager->isElementVisible( url ) ){ + xLayoutManager->hideElement( url ); + return; } } diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index eab36e467ac5..40f6c3d7258b 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -102,11 +102,7 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, if (xBitmap.is()) { const css::uno::Reference xIntBmp(xBitmap, uno::UNO_QUERY_THROW); - - if (xIntBmp.is()) - { - rBitmapEx = vcl::unotools::bitmapExFromXBitmap(xIntBmp); - } + rBitmapEx = vcl::unotools::bitmapExFromXBitmap(xIntBmp); } } diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx index 24aea9c34ffc..434736526294 100644 --- a/vcl/source/gdi/vectorgraphicdata.cxx +++ b/vcl/source/gdi/vectorgraphicdata.cxx @@ -73,11 +73,7 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( if(xBitmap.is()) { const uno::Reference< rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW); - - if(xIntBmp.is()) - { - aRetval = vcl::unotools::bitmapExFromXBitmap(xIntBmp); - } + aRetval = vcl::unotools::bitmapExFromXBitmap(xIntBmp); } } catch (const uno::Exception& e) diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index a203dc9d3312..40455d5beed5 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2059,8 +2059,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) if (xTextColumns.is()) { uno::Reference< beans::XPropertySet > xColumnPropSet( xTextColumns, uno::UNO_QUERY_THROW ); - if ( xColumnPropSet.is() ) - xColumnPropSet->setPropertyValue( getPropertyName( PROP_AUTOMATIC_DISTANCE ), uno::makeAny( pSectHdl->GetSpace() )); + xColumnPropSet->setPropertyValue( getPropertyName( PROP_AUTOMATIC_DISTANCE ), uno::makeAny( pSectHdl->GetSpace() )); xTOC->setPropertyValue( getPropertyName( PROP_TEXT_COLUMNS ), uno::makeAny( xTextColumns ) ); } } diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 57390765f134..bca23419fb28 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -453,8 +453,6 @@ void GraphicImport::putPropertyToFrameGrabBag( const OUString& sPropertyName, co return; uno::Reference< beans::XPropertySet > xSet(m_xShape, uno::UNO_QUERY_THROW); - if (!xSet.is()) - return; uno::Reference< beans::XPropertySetInfo > xSetInfo(xSet->getPropertySetInfo()); if (!xSetInfo.is()) diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index f12d95bc2968..8cb92e7f6624 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -87,12 +87,8 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& rDescrip { uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); uno::Reference< uno::XInterface > xIfc(xMSF->createInstance("com.sun.star.comp.Writer.RtfExport"), uno::UNO_QUERY_THROW); - if (!xIfc.is()) - return false; uno::Reference< document::XExporter > xExporter(xIfc, uno::UNO_QUERY_THROW); uno::Reference< document::XFilter > xFilter(xIfc, uno::UNO_QUERY_THROW); - if (!xExporter.is() || !xFilter.is()) - return false; xExporter->setSourceDocument(m_xSrcDoc); return xFilter->filter(rDescriptor); } diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index a78518522ae0..431fc2e8015d 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -139,8 +139,6 @@ sal_Bool WriterFilter::filter(const uno::Sequence< beans::PropertyValue >& rDesc } uno::Reference< document::XExporter > xExprtr(xIfc, uno::UNO_QUERY_THROW); uno::Reference< document::XFilter > xFltr(xIfc, uno::UNO_QUERY_THROW); - if (!xExprtr.is() || !xFltr.is()) - return false; xExprtr->setSourceDocument(m_xSrcDoc); return xFltr->filter(rDescriptor); } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 848416b8a2fe..5b9dea65ff5f 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -447,8 +447,7 @@ bool lcl_isSeriesAttachedToFirstAxis( { sal_Int32 nAxisIndex = 0; Reference< beans::XPropertySet > xProp( xDataSeries, uno::UNO_QUERY_THROW ); - if( xProp.is() ) - xProp->getPropertyValue("AttachedAxisIndex") >>= nAxisIndex; + xProp->getPropertyValue("AttachedAxisIndex") >>= nAxisIndex; bResult = (0==nAxisIndex); } catch( const uno::Exception & ) diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index b646a2e891f5..332597235dcb 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -909,14 +909,11 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( Reference< chart2::XRegressionCurve > xRegCurve( xMSF->createInstance( aServiceName ), uno::UNO_QUERY_THROW ); Reference< chart2::XRegressionCurveContainer > xRegCurveCont( regressionStyle.m_xSeries, uno::UNO_QUERY_THROW ); - if( xRegCurve.is()) - { - Reference< beans::XPropertySet > xCurveProperties( xRegCurve, uno::UNO_QUERY ); - if( pPropStyleContext != nullptr) - pPropStyleContext->FillPropertySet( xCurveProperties ); + Reference< beans::XPropertySet > xCurveProperties( xRegCurve, uno::UNO_QUERY ); + if( pPropStyleContext != nullptr) + pPropStyleContext->FillPropertySet( xCurveProperties ); - xRegCurve->setEquationProperties( regressionStyle.m_xEquationProperties ); - } + xRegCurve->setEquationProperties( regressionStyle.m_xEquationProperties ); xRegCurveCont->addRegressionCurve( xRegCurve ); } diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 3d74d57f0853..5d2bad9e303b 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3331,23 +3331,17 @@ void SdXMLFrameShapeContext::removeGraphicFromImportContext(const SvXMLImportCon { uno::Reference< container::XChild > xChild(pSdXMLGraphicObjectShapeContext->getShape(), uno::UNO_QUERY_THROW); - if(xChild.is()) - { - uno::Reference< drawing::XShapes > xParent(xChild->getParent(), uno::UNO_QUERY_THROW); + uno::Reference< drawing::XShapes > xParent(xChild->getParent(), uno::UNO_QUERY_THROW); - if(xParent.is()) - { - // remove from parent - xParent->remove(pSdXMLGraphicObjectShapeContext->getShape()); + // remove from parent + xParent->remove(pSdXMLGraphicObjectShapeContext->getShape()); - // dispose - uno::Reference< lang::XComponent > xComp(pSdXMLGraphicObjectShapeContext->getShape(), UNO_QUERY); + // dispose + uno::Reference< lang::XComponent > xComp(pSdXMLGraphicObjectShapeContext->getShape(), UNO_QUERY); - if(xComp.is()) - { - xComp->dispose(); - } - } + if(xComp.is()) + { + xComp->dispose(); } } catch( uno::Exception& ) @@ -3403,10 +3397,7 @@ OUString SdXMLFrameShapeContext::getGraphicPackageURLFromImportContext(const SvX { const uno::Reference< beans::XPropertySet > xPropSet(pSdXMLGraphicObjectShapeContext->getShape(), uno::UNO_QUERY_THROW); - if (xPropSet.is()) - { - xPropSet->getPropertyValue("GraphicStreamURL") >>= aRetval; - } + xPropSet->getPropertyValue("GraphicStreamURL") >>= aRetval; } catch( uno::Exception& ) { diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index c93bd905d363..89ec490d46d5 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -163,8 +163,7 @@ public: , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ) , XMLNS_DIALOGS_UID( 0 ) , XMLNS_SCRIPT_UID( 0 ) - { OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() && - _xContext.is() ); } + { OSL_ASSERT( _xDialogModel.is() && _xContext.is() ); } DialogImport( const DialogImport& rOther ) : ::cppu::WeakImplHelper< css::xml::input::XRoot >() , _xContext( rOther._xContext ) diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 99f70172c27a..d899024f5b0e 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -656,7 +656,6 @@ void SigningTest::test96097Calc() uno::Reference xDocStorable(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); // Save a copy utl::TempFile aTempFileSaveCopy; @@ -705,7 +704,6 @@ void SigningTest::test96097Doc() uno::Reference xDocStorable(mxComponent, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); // Save a copy utl::TempFile aTempFileSaveCopy; -- cgit v1.2.3