From fe6cce01c88d045a1fcf09acf049c34c22299b02 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 26 May 2020 20:42:08 +0200 Subject: Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr ...where the get member function is defined on a std::__shared_ptr base class, so loplugin:simplifypointertobool used to miss those until now. (While e.g. using libc++ on macOS found those cases.) 366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool" was mistaken in breaking isSmartPointerType(const clang::Type* t) out of isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had introduced that indivisible two-step algorithm on purpose. The amount of additional hits (on Linux) apparently asked for turning loplugin:simplifypointertobool into a rewriting plugin. Which in turn showed that the naive adivce to just "drop the get()" is not sufficient in places that are not contextually converted to bool, as those places need to be wrapped in a bool(...) functional cast now. If the expression was already wrapped in parentheses, those could be reused as part of the functional cast, but implementing that showed that such cases are not yet found at all by the existing loplugin:simplifypointertobool. Lets leave that TODO for another commit. Besides the changes to compilerplugins/ itself, this change has been generated fully automatically with the rewriting plugin on Linux. Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94888 Reviewed-by: Noel Grandin Reviewed-by: Stephan Bergmann Tested-by: Jenkins --- basic/source/classes/sbunoobj.cxx | 6 +- canvas/source/vcl/canvasbitmaphelper.cxx | 2 +- canvas/source/vcl/canvashelper.cxx | 10 +- canvas/source/vcl/canvashelper_texturefill.cxx | 2 +- canvas/source/vcl/impltools.hxx | 2 +- .../WrappedSeriesOrDiagramProperty.hxx | 4 +- .../chartapiwrapper/WrappedStatisticProperties.cxx | 2 +- .../chartapiwrapper/WrappedSymbolProperties.cxx | 2 +- chart2/source/controller/dialogs/DataBrowser.cxx | 10 +- chart2/source/controller/dialogs/DialogModel.cxx | 2 +- chart2/source/controller/main/ChartController.cxx | 4 +- chart2/source/view/main/ChartView.cxx | 6 +- compilerplugins/clang/plugin.cxx | 6 +- compilerplugins/clang/plugin.hxx | 1 - .../clang/sharedvisitor/dummyplugin.hxx | 7 + compilerplugins/clang/simplifypointertobool.cxx | 334 ++++++++++++++++++++- .../clang/test/simplifypointertobool.cxx | 15 +- connectivity/source/commontools/TTableHelper.cxx | 6 +- .../source/drivers/hsqldb/HStorageAccess.cxx | 18 +- .../drivers/hsqldb/StorageNativeInputStream.cxx | 6 +- .../drivers/hsqldb/StorageNativeOutputStream.cxx | 4 +- connectivity/source/parse/sqliterator.cxx | 4 +- cppcanvas/source/mtfrenderer/implrenderer.cxx | 2 +- dbaccess/source/core/dataaccess/ModelImpl.cxx | 4 +- .../source/sdbtools/connection/objectnames.cxx | 2 +- dbaccess/source/ui/control/ColumnControlWindow.cxx | 2 +- dbaccess/source/ui/control/FieldDescControl.cxx | 8 +- dbaccess/source/ui/control/RelationControl.cxx | 2 +- dbaccess/source/ui/misc/HtmlReader.cxx | 4 +- dbaccess/source/ui/misc/UITools.cxx | 6 +- dbaccess/source/ui/misc/WCPage.cxx | 2 +- dbaccess/source/ui/misc/WCopyTable.cxx | 10 +- dbaccess/source/ui/misc/WNameMatch.cxx | 2 +- .../source/ui/tabledesign/FieldDescriptions.cxx | 8 +- dbaccess/source/ui/tabledesign/TEditControl.cxx | 4 +- dbaccess/source/ui/tabledesign/TableController.cxx | 4 +- dbaccess/source/ui/tabledesign/TableRow.cxx | 2 +- dbaccess/source/ui/uno/ColumnPeer.cxx | 2 +- .../source/primitive2d/graphicprimitive2d.cxx | 2 +- .../primitive2d/graphicprimitivehelper2d.cxx | 2 +- .../primitive2d/modifiedcolorprimitive2d.cxx | 2 +- .../primitive3d/modifiedcolorprimitive3d.cxx | 2 +- drawinglayer/source/processor2d/vclprocessor2d.cxx | 2 +- .../source/processor3d/defaultprocessor3d.cxx | 2 +- .../source/processor3d/zbufferprocessor3d.cxx | 10 +- filter/source/msfilter/mstoolbar.cxx | 6 +- formula/source/core/api/FormulaCompiler.cxx | 2 +- formula/source/ui/dlg/formula.cxx | 2 +- include/oox/dump/dumperbase.hxx | 6 +- .../sdr/attribute/sdrallfillattributeshelper.hxx | 2 +- oox/source/core/filterbase.cxx | 4 +- .../drawingml/chart/chartdrawingfragment.cxx | 6 +- oox/source/drawingml/chart/objectformatter.cxx | 6 +- oox/source/drawingml/chart/seriesconverter.cxx | 2 +- oox/source/drawingml/shape.cxx | 12 +- oox/source/drawingml/shapecontext.cxx | 2 +- oox/source/drawingml/shapegroupcontext.cxx | 2 +- oox/source/drawingml/table/tablecell.cxx | 6 +- oox/source/drawingml/textbody.cxx | 4 +- oox/source/drawingml/textparagraph.cxx | 4 +- .../drawingml/textparagraphpropertiescontext.cxx | 2 +- oox/source/drawingml/themeelementscontext.cxx | 6 +- oox/source/dump/dumperbase.cxx | 22 +- oox/source/dump/oledumper.cxx | 2 +- oox/source/helper/storagebase.cxx | 10 +- oox/source/ole/axcontrol.cxx | 6 +- oox/source/ole/olestorage.cxx | 4 +- oox/source/ole/vbacontrol.cxx | 28 +- oox/source/ole/vbaproject.cxx | 2 +- oox/source/ppt/pptgraphicshapecontext.cxx | 8 +- oox/source/ppt/pptshape.cxx | 62 ++-- oox/source/ppt/pptshapecontext.cxx | 4 +- oox/source/ppt/presentationfragmenthandler.cxx | 6 +- oox/source/ppt/slidefragmenthandler.cxx | 2 +- oox/source/shape/ShapeFilterBase.cxx | 2 +- sc/qa/unit/ucalc_formula.cxx | 2 +- sc/source/core/data/postit.cxx | 10 +- sc/source/core/tool/compiler.cxx | 2 +- sc/source/core/tool/interpr1.cxx | 2 +- sc/source/filter/excel/excimp8.cxx | 2 +- sc/source/filter/excel/xecontent.cxx | 22 +- sc/source/filter/excel/xeformula.cxx | 6 +- sc/source/filter/excel/xelink.cxx | 2 +- sc/source/filter/excel/xihelper.cxx | 8 +- sc/source/filter/excel/xistyle.cxx | 2 +- sc/source/filter/excel/xlroot.cxx | 6 +- sc/source/filter/excel/xltoolbar.cxx | 2 +- sc/source/filter/oox/autofilterbuffer.cxx | 4 +- sc/source/filter/oox/commentsbuffer.cxx | 2 +- sc/source/filter/oox/commentsfragment.cxx | 4 +- sc/source/filter/oox/condformatbuffer.cxx | 6 +- sc/source/filter/oox/condformatcontext.cxx | 10 +- sc/source/filter/oox/drawingfragment.cxx | 2 +- sc/source/filter/oox/excelfilter.cxx | 2 +- sc/source/filter/oox/externallinkfragment.cxx | 16 +- sc/source/filter/oox/formulaparser.cxx | 4 +- sc/source/filter/oox/pivotcachefragment.cxx | 2 +- sc/source/filter/oox/querytablebuffer.cxx | 4 +- sc/source/filter/oox/richstring.cxx | 8 +- sc/source/filter/oox/richstringcontext.cxx | 6 +- sc/source/filter/oox/sheetdatabuffer.cxx | 2 +- sc/source/filter/oox/sheetdatacontext.cxx | 2 +- sc/source/filter/oox/stylesbuffer.cxx | 28 +- sc/source/filter/oox/stylesfragment.cxx | 16 +- sc/source/filter/oox/workbookfragment.cxx | 4 +- sc/source/filter/oox/workbookhelper.cxx | 2 +- sc/source/filter/oox/worksheethelper.cxx | 4 +- sc/source/filter/xml/xmlexprt.cxx | 2 +- sc/source/ui/docshell/externalrefmgr.cxx | 18 +- sc/source/ui/miscdlgs/retypepassdlg.cxx | 4 +- sc/source/ui/undo/undocell.cxx | 2 +- sc/source/ui/unoobj/tokenuno.cxx | 4 +- sd/source/core/CustomAnimationEffect.cxx | 24 +- sd/source/core/CustomAnimationPreset.cxx | 14 +- sd/source/core/EffectMigration.cxx | 18 +- sd/source/core/sdpage_animations.cxx | 2 +- sd/source/core/undoanim.cxx | 10 +- sd/source/filter/ppt/ppt97animations.cxx | 4 +- sd/source/filter/ppt/pptin.cxx | 4 +- sd/source/ui/animations/CustomAnimationDialog.cxx | 2 +- sd/source/ui/animations/CustomAnimationList.cxx | 20 +- sd/source/ui/animations/CustomAnimationPane.cxx | 44 +-- sd/source/ui/annotations/annotationmanager.cxx | 6 +- sd/source/ui/docshell/docshell.cxx | 2 +- sd/source/ui/func/fuconbez.cxx | 2 +- sd/source/ui/func/fuformatpaintbrush.cxx | 4 +- sd/source/ui/slideshow/slideshow.cxx | 10 +- sd/source/ui/slideshow/slideshowimpl.cxx | 40 +-- sd/source/ui/slideshow/slideshowviewimpl.cxx | 4 +- sd/source/ui/table/TableDesignPane.cxx | 18 +- sd/source/ui/view/OutlinerIterator.cxx | 6 +- sd/source/ui/view/viewoverlaymanager.cxx | 2 +- sfx2/source/doc/docinf.cxx | 6 +- sfx2/source/doc/oleprops.cxx | 4 +- sfx2/source/doc/sfxbasemodel.cxx | 4 +- .../sessioninstall/SyncDbusSessionHelper.cxx | 2 +- .../source/engine/animationnodes/generateevent.cxx | 8 +- slideshow/source/engine/slideshowimpl.cxx | 2 +- .../engine/transitions/slidetransitionfactory.cxx | 2 +- svgio/source/svgreader/svgimagenode.cxx | 2 +- svtools/source/dialogs/PlaceEditDialog.cxx | 6 +- svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 +- svx/source/dialog/imapwnd.cxx | 2 +- svx/source/dialog/pagectrl.cxx | 2 +- .../sdr/attribute/sdrallfillattributeshelper.cxx | 14 +- svx/source/svdraw/svdograf.cxx | 2 +- svx/source/table/tablertfimporter.cxx | 2 +- sw/source/core/attr/format.cxx | 8 +- sw/source/core/doc/number.cxx | 4 +- sw/source/core/doc/swstylemanager.cxx | 6 +- sw/source/core/docnode/ndnotxt.cxx | 2 +- sw/source/core/docnode/node.cxx | 2 +- sw/source/core/layout/atrfrm.cxx | 6 +- sw/source/core/layout/fly.cxx | 2 +- sw/source/core/layout/flylay.cxx | 2 +- sw/source/core/layout/frmtool.cxx | 2 +- sw/source/core/layout/paintfrm.cxx | 14 +- sw/source/core/text/txtfld.cxx | 2 +- sw/source/core/txtnode/fntcache.cxx | 2 +- sw/source/core/txtnode/ndtxt.cxx | 8 +- sw/source/core/txtnode/thints.cxx | 2 +- sw/source/core/txtnode/txtedt.cxx | 8 +- sw/source/core/undo/docundo.cxx | 2 +- sw/source/core/unocore/unoobj.cxx | 2 +- sw/source/core/unocore/unostyle.cxx | 6 +- sw/source/filter/html/htmlatr.cxx | 2 +- sw/source/filter/html/htmltab.cxx | 2 +- sw/source/filter/html/swhtml.cxx | 4 +- sw/source/filter/ww8/docxattributeoutput.cxx | 4 +- sw/source/filter/ww8/ww8par.cxx | 2 +- sw/source/filter/ww8/ww8toolbar.cxx | 10 +- sw/source/ui/vba/vbadocumentproperties.cxx | 6 +- sw/source/uibase/app/apphdl.cxx | 2 +- sw/source/uibase/docvw/edtwin.cxx | 4 +- sw/source/uibase/frmdlg/colex.cxx | 2 +- toolkit/source/awt/vclxprinter.cxx | 6 +- unoxml/source/rdf/librdf_repository.cxx | 6 +- vcl/opengl/salbmp.cxx | 2 +- vcl/qa/cppunit/graphicfilter/filters-test.cxx | 2 +- vcl/source/gdi/impgraph.cxx | 34 +-- vcl/source/gdi/pdfextoutdevdata.cxx | 4 +- vcl/source/gdi/pdfwriter_impl.cxx | 6 +- vcl/source/gdi/region.cxx | 2 +- vcl/source/graphic/UnoGraphicProvider.cxx | 2 +- writerfilter/source/filter/WriterFilter.cxx | 2 +- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 +- xmloff/source/core/RDFaImportHelper.cxx | 4 +- xmloff/source/table/XMLTableExport.cxx | 6 +- xmloff/source/table/XMLTableImport.cxx | 2 +- 189 files changed, 912 insertions(+), 577 deletions(-) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index dc3e97619c73..3f5da99a6d5f 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -2044,7 +2044,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { try { - if ( maStructInfo.get() ) + if ( maStructInfo ) { StructRefInfo aMember = maStructInfo->getStructMember( pProp->GetName() ); if ( aMember.isEmpty() ) @@ -2121,7 +2121,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) StarBASIC::Error( ERRCODE_BASIC_PROP_READONLY ); return; } - if ( maStructInfo.get() ) + if ( maStructInfo ) { StructRefInfo aMember = maStructInfo->getStructMember( pProp->GetName() ); if ( aMember.isEmpty() ) @@ -2840,7 +2840,7 @@ Any SbUnoObject::getUnoAny() { Any aRetAny; if( bNeedIntrospection ) doIntrospection(); - if ( maStructInfo.get() ) + if ( maStructInfo ) aRetAny = maTmpUnoObj; else if( mxMaterialHolder.is() ) aRetAny = mxMaterialHolder->getMaterial(); diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index 43fed2754430..336c12b83047 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.cxx @@ -155,7 +155,7 @@ namespace vclcanvas rendering::IntegerBitmapLayout CanvasBitmapHelper::getMemoryLayout() const { - if( !mpOutDevProvider.get() ) + if( !mpOutDevProvider ) return rendering::IntegerBitmapLayout(); // we're disposed rendering::IntegerBitmapLayout aBitmapLayout( ::canvas::tools::getStdMemoryLayout(getSize()) ); diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 17930a1a758d..07dc45574e64 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -867,7 +867,7 @@ namespace vclcanvas geometry::IntegerSize2D CanvasHelper::getSize() { - if( !mpOutDevProvider.get() ) + if( !mpOutDevProvider ) return geometry::IntegerSize2D(); // we're disposed return vcl::unotools::integerSize2DFromSize( mpOutDevProvider->getOutDev().GetOutputSizePixel() ); @@ -876,7 +876,7 @@ namespace vclcanvas uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize, bool beFast ) { - if( !mpOutDevProvider.get() || !mpDevice ) + if( !mpOutDevProvider || !mpDevice ) return uno::Reference< rendering::XBitmap >(); // we're disposed OutputDevice& rOutDev( mpOutDevProvider->getOutDev() ); @@ -901,7 +901,7 @@ namespace vclcanvas uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& rLayout, const geometry::IntegerRectangle2D& rect ) { - if( !mpOutDevProvider.get() ) + if( !mpOutDevProvider ) return uno::Sequence< sal_Int8 >(); // we're disposed rLayout = getMemoryLayout(); @@ -951,7 +951,7 @@ namespace vclcanvas uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& rLayout, const geometry::IntegerPoint2D& pos ) { - if( !mpOutDevProvider.get() ) + if( !mpOutDevProvider ) return uno::Sequence< sal_Int8 >(); // we're disposed rLayout = getMemoryLayout(); @@ -980,7 +980,7 @@ namespace vclcanvas rendering::IntegerBitmapLayout CanvasHelper::getMemoryLayout() { - if( !mpOutDevProvider.get() ) + if( !mpOutDevProvider ) return rendering::IntegerBitmapLayout(); // we're disposed rendering::IntegerBitmapLayout aBitmapLayout( ::canvas::tools::getStdMemoryLayout(getSize()) ); diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx index 646cef28aac6..9cb8dd8abd99 100644 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -608,7 +608,7 @@ namespace vclcanvas // TODO(E1): Return value // TODO(F1): FillRule gradientFill( mpOutDevProvider->getOutDev(), - mp2ndOutDevProvider.get() ? &mp2ndOutDevProvider->getOutDev() : nullptr, + mp2ndOutDevProvider ? &mp2ndOutDevProvider->getOutDev() : nullptr, rValues, aColors, aPolyPoly, diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx index eb4918c68459..f20b052d5534 100644 --- a/canvas/source/vcl/impltools.hxx +++ b/canvas/source/vcl/impltools.hxx @@ -127,7 +127,7 @@ namespace vclcanvas } explicit OutDevStateKeeper( const OutDevProviderSharedPtr& rOutDev ) : - mpOutDev( rOutDev.get() ? &(rOutDev->getOutDev()) : nullptr ), + mpOutDev( rOutDev ? &(rOutDev->getOutDev()) : nullptr ), mbMappingWasEnabled( mpOutDev && mpOutDev->IsMapModeEnabled() ), mnAntiAliasing( mpOutDev ? mpOutDev->GetAntialiasing() : AntialiasingFlags::NONE ) { diff --git a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx index 84c477678a28..26c260ffc0b3 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx @@ -64,7 +64,7 @@ public: bool bHasDetectableInnerValue = false; rHasAmbiguousValue = false; if( m_ePropertyType == DIAGRAM && - m_spChart2ModelContact.get() ) + m_spChart2ModelContact ) { std::vector< css::uno::Reference< css::chart2::XDataSeries > > aSeriesVector( ::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getChart2Diagram() ) ); @@ -91,7 +91,7 @@ public: void setInnerValue( PROPERTYTYPE aNewValue ) const { if( m_ePropertyType == DIAGRAM && - m_spChart2ModelContact.get() ) + m_spChart2ModelContact ) { std::vector< css::uno::Reference< css::chart2::XDataSeries > > aSeriesVector( ::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getChart2Diagram() ) ); diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx index abcbc1f016ec..6e12bea50e0a 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx @@ -124,7 +124,7 @@ uno::Reference< chart2::data::XDataProvider > lcl_getDataProviderFromContact( const std::shared_ptr< Chart2ModelContact >& spChart2ModelContact ) { uno::Reference< chart2::data::XDataProvider > xResult; - if( spChart2ModelContact.get()) + if( spChart2ModelContact) { uno::Reference< chart2::XChartDocument > xChartDoc( spChart2ModelContact->getChart2Document()); diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx index 95759509c563..4dfabee4836f 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx @@ -283,7 +283,7 @@ beans::PropertyState WrappedSymbolTypeProperty::getPropertyState( const Referenc //so we need to return PropertyState_DIRECT_VALUE for more cases if( m_ePropertyType == DATA_SERIES && //single series or point - m_spChart2ModelContact.get()) + m_spChart2ModelContact) { Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() ); Reference< chart2::XDataSeries > xSeries( xInnerPropertyState, uno::UNO_QUERY ); diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 785a1d16528c..0aaccdea65cf 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -711,7 +711,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const Color nLabelColor; if( ! std::isnan( fData ) && - m_spNumberFormatterWrapper.get() ) + m_spNumberFormatterWrapper ) { bool bColorChanged = false; aResult = m_spNumberFormatterWrapper->getFormattedString( @@ -728,7 +728,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const aResult = aText; else if( aAny>>=fDouble ) { - if( ! std::isnan( fDouble ) && m_spNumberFormatterWrapper.get() ) + if( ! std::isnan( fDouble ) && m_spNumberFormatterWrapper ) { // If a numberformat was available here we could directly // obtain the corresponding edit format in @@ -831,7 +831,7 @@ bool DataBrowser::IsDataValid() const OUString aText( m_aNumberEditField->GetText()); if( !aText.isEmpty() && - m_spNumberFormatterWrapper.get() && + m_spNumberFormatterWrapper && m_spNumberFormatterWrapper->getSvNumberFormatter() && ! m_spNumberFormatterWrapper->getSvNumberFormatter()->IsNumberFormat( aText, nDummy, fDummy )) @@ -1165,7 +1165,7 @@ sal_uInt32 DataBrowser::GetNumberFormatKey( sal_uInt16 nCol ) const bool DataBrowser::isDateTimeString( const OUString& aInputString, double& fOutDateTimeValue ) { sal_uInt32 nNumberFormat=0; - SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : nullptr; + SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper ? m_spNumberFormatterWrapper->getSvNumberFormatter() : nullptr; if( !aInputString.isEmpty() && pSvNumberFormatter && pSvNumberFormatter->IsNumberFormat( aInputString, nNumberFormat, fOutDateTimeValue ) ) { SvNumFormatType nType = pSvNumberFormatter->GetType( nNumberFormat); @@ -1186,7 +1186,7 @@ bool DataBrowser::SaveModified() OSL_ENSURE( nRow >= 0 || nCol >= 0, "This cell should not be modified!" ); - SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : nullptr; + SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper ? m_spNumberFormatterWrapper->getSvNumberFormatter() : nullptr; switch( m_apDataBrowserModel->getCellType( nCol )) { case DataBrowserModel::NUMBER: diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 5c8678bc9f5b..b4bdbae6501e 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -393,7 +393,7 @@ void DialogModel::setTemplate( std::shared_ptr< RangeSelectionHelper > const & DialogModel::getRangeSelectionHelper() const { - if( ! m_spRangeSelectionHelper.get()) + if( ! m_spRangeSelectionHelper) m_spRangeSelectionHelper = std::make_shared( m_xChartDocument ); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index ad6e94ee1f0c..f81b261182fa 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1460,12 +1460,12 @@ void ChartController::NotifyUndoActionHdl( std::unique_ptr pUndoA DrawModelWrapper* ChartController::GetDrawModelWrapper() { - if( !m_pDrawModelWrapper.get() ) + if( !m_pDrawModelWrapper ) { ExplicitValueProvider* pProvider = comphelper::getUnoTunnelImplementation( m_xChartView ); if( pProvider ) m_pDrawModelWrapper = pProvider->getDrawModelWrapper(); - if ( m_pDrawModelWrapper.get() ) + if ( m_pDrawModelWrapper ) { m_pDrawModelWrapper->getSdrModel().SetNotifyUndoActionHdl( std::bind(&ChartController::NotifyUndoActionHdl, this, std::placeholders::_1) ); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index d3b0e8832e36..f168e7e0b2df 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -1064,7 +1064,7 @@ ChartView::ChartView( void ChartView::init() { - if( !m_pDrawModelWrapper.get() ) + if( !m_pDrawModelWrapper ) { SolarMutexGuard aSolarGuard; m_pDrawModelWrapper = std::make_shared< DrawModelWrapper >(); @@ -1088,7 +1088,7 @@ ChartView::~ChartView() if ( xComp.is() ) xComp->dispose(); - if( m_pDrawModelWrapper.get() ) + if( m_pDrawModelWrapper ) { SolarMutexGuard aSolarGuard; EndListening( m_pDrawModelWrapper->getSdrModel() ); @@ -1395,7 +1395,7 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw } if( nWritingMode != -1 && nWritingMode != text::WritingMode2::PAGE ) { - if( pDrawModelWrapper.get() ) + if( pDrawModelWrapper ) pDrawModelWrapper->GetItemPool().SetPoolDefaultItem(SvxFrameDirectionItem(static_cast(nWritingMode), EE_PARA_WRITINGDIR) ); } } diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx index 0ffab3ba36bd..5248927e5d84 100644 --- a/compilerplugins/clang/plugin.cxx +++ b/compilerplugins/clang/plugin.cxx @@ -837,17 +837,13 @@ bool isSmartPointerType(const Expr* e) if (tc1.ClassOrStruct("unique_ptr").StdNamespace() || tc1.ClassOrStruct("shared_ptr").StdNamespace()) return true; - return isSmartPointerType(e->getType().getTypePtr()); -} -bool isSmartPointerType(const clang::Type* t) -{ // Then check the object type coerced to the type of the get member function, in // case the type-as-written is derived from one of these types (tools::SvRef is // final, but the rest are not; but note that this will fail when the type-as- // written is derived from std::unique_ptr or std::shared_ptr for which the get // member function is declared at a base class): - auto const tc2 = loplugin::TypeCheck(t); + auto const tc2 = loplugin::TypeCheck(e->getType()); if (tc2.ClassOrStruct("unique_ptr").StdNamespace() || tc2.ClassOrStruct("shared_ptr").StdNamespace() || tc2.Class("Reference").Namespace("uno").Namespace("star") diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx index 2d43371feede..66d22adf97d6 100644 --- a/compilerplugins/clang/plugin.hxx +++ b/compilerplugins/clang/plugin.hxx @@ -319,7 +319,6 @@ int derivedFromCount(const CXXRecordDecl* subtypeRecord, const CXXRecordDecl* ba // if it contained the 'extern' specifier: bool hasExternalLinkage(VarDecl const * decl); -bool isSmartPointerType(const clang::Type*); bool isSmartPointerType(const Expr*); } // namespace diff --git a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx index ce5b352384b1..b24157965df2 100644 --- a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx +++ b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx @@ -37,8 +37,15 @@ public: bool TraverseDecl( Decl* ) { return complain(); } bool TraverseLinkageSpecDecl( LinkageSpecDecl* ) { return complain(); } bool TraverseStmt( Stmt* ) { return complain(); } + bool TraverseIfStmt( IfStmt* ) { return complain(); } + bool TraverseWhileStmt( WhileStmt* ) { return complain(); } + bool TraverseDoStmt( DoStmt* ) { return complain(); } + bool TraverseForStmt( ForStmt* ) { return complain(); } + bool TraverseParenExpr( ParenExpr* ) { return complain(); } bool TraverseUnaryLNot( UnaryOperator* ) { return complain(); } bool TraverseBinLAnd( BinaryOperator* ) { return complain(); } + bool TraverseBinLOr( BinaryOperator* ) { return complain(); } + bool TraverseConditionalOperator( ConditionalOperator* ) { return complain(); } bool TraverseCXXCatchStmt( CXXCatchStmt* ) { return complain(); } bool TraverseCXXDestructorDecl( CXXDestructorDecl* ) { return complain(); } bool TraverseFunctionDecl( FunctionDecl* ) { return complain(); } diff --git a/compilerplugins/clang/simplifypointertobool.cxx b/compilerplugins/clang/simplifypointertobool.cxx index da6581915a1e..4fc4901c3efe 100644 --- a/compilerplugins/clang/simplifypointertobool.cxx +++ b/compilerplugins/clang/simplifypointertobool.cxx @@ -7,7 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include #include +#include +#include #include #include #include @@ -16,6 +19,7 @@ #include #include "plugin.hxx" #include "check.hxx" +#include "compat.hxx" /** Simplify boolean expressions involving smart pointers e.g. @@ -27,11 +31,11 @@ namespace { -class SimplifyPointerToBool : public loplugin::FilteringPlugin +class SimplifyPointerToBool : public loplugin::FilteringRewritePlugin { public: explicit SimplifyPointerToBool(loplugin::InstantiationData const& data) - : FilteringPlugin(data) + : FilteringRewritePlugin(data) { } @@ -42,6 +46,280 @@ public: } bool VisitImplicitCastExpr(ImplicitCastExpr const*); + + bool PreTraverseUnaryLNot(UnaryOperator* expr) + { + contextuallyConvertedExprs_.push_back(expr->getSubExpr()->IgnoreParenImpCasts()); + return true; + } + + bool PostTraverseUnaryLNot(UnaryOperator*, bool) + { + assert(!contextuallyConvertedExprs_.empty()); + contextuallyConvertedExprs_.pop_back(); + return true; + } + + bool TraverseUnaryLNot(UnaryOperator* expr) + { + auto res = PreTraverseUnaryLNot(expr); + assert(res); + res = FilteringRewritePlugin::TraverseUnaryLNot(expr); + PostTraverseUnaryLNot(expr, res); + return res; + } + + bool PreTraverseBinLAnd(BinaryOperator* expr) + { + contextuallyConvertedExprs_.push_back(expr->getLHS()->IgnoreParenImpCasts()); + contextuallyConvertedExprs_.push_back(expr->getRHS()->IgnoreParenImpCasts()); + return true; + } + + bool PostTraverseBinLAnd(BinaryOperator*, bool) + { + assert(contextuallyConvertedExprs_.size() >= 2); + contextuallyConvertedExprs_.pop_back(); + contextuallyConvertedExprs_.pop_back(); + return true; + } + + bool TraverseBinLAnd(BinaryOperator* expr) + { + auto res = PreTraverseBinLAnd(expr); + assert(res); + res = FilteringRewritePlugin::TraverseBinLAnd(expr); + PostTraverseBinLAnd(expr, res); + return res; + } + + bool PreTraverseBinLOr(BinaryOperator* expr) + { + contextuallyConvertedExprs_.push_back(expr->getLHS()->IgnoreParenImpCasts()); + contextuallyConvertedExprs_.push_back(expr->getRHS()->IgnoreParenImpCasts()); + return true; + } + + bool PostTraverseBinLOr(BinaryOperator*, bool) + { + assert(contextuallyConvertedExprs_.size() >= 2); + contextuallyConvertedExprs_.pop_back(); + contextuallyConvertedExprs_.pop_back(); + return true; + } + + bool TraverseBinLOr(BinaryOperator* expr) + { + auto res = PreTraverseBinLOr(expr); + assert(res); + res = FilteringRewritePlugin::TraverseBinLOr(expr); + PostTraverseBinLOr(expr, res); + return res; + } + + bool PreTraverseConditionalOperator(ConditionalOperator* expr) + { + contextuallyConvertedExprs_.push_back(expr->getCond()->IgnoreParenImpCasts()); + return true; + } + + bool PostTraverseConditionalOperator(ConditionalOperator*, bool) + { + assert(!contextuallyConvertedExprs_.empty()); + contextuallyConvertedExprs_.pop_back(); + return true; + } + + bool TraverseConditionalOperator(ConditionalOperator* expr) + { + auto res = PreTraverseConditionalOperator(expr); + assert(res); + res = FilteringRewritePlugin::TraverseConditionalOperator(expr); + PostTraverseConditionalOperator(expr, res); + return res; + } + + bool PreTraverseIfStmt(IfStmt* stmt) + { + contextuallyConvertedExprs_.push_back(stmt->getCond()->IgnoreParenImpCasts()); + return true; + } + + bool PostTraverseIfStmt(IfStmt*, bool) + { + assert(!contextuallyConvertedExprs_.empty()); + contextuallyConvertedExprs_.pop_back(); + return true; + } + + bool TraverseIfStmt(IfStmt* stmt) + { + auto res = PreTraverseIfStmt(stmt); + assert(res); + res = FilteringRewritePlugin::TraverseIfStmt(stmt); + PostTraverseIfStmt(stmt, res); + return res; + } + + bool PreTraverseWhileStmt(WhileStmt* stmt) + { + contextuallyConvertedExprs_.push_back(stmt->getCond()->IgnoreParenImpCasts()); + return true; + } + + bool PostTraverseWhileStmt(WhileStmt*, bool) + { + assert(!contextuallyConvertedExprs_.empty()); + contextuallyConvertedExprs_.pop_back(); + return true; + } + + bool TraverseWhileStmt(WhileStmt* stmt) + { + auto res = PreTraverseWhileStmt(stmt); + assert(res); + res = FilteringRewritePlugin::TraverseWhileStmt(stmt); + PostTraverseWhileStmt(stmt, res); + return res; + } + + bool PreTraverseDoStmt(DoStmt* stmt) + { + contextuallyConvertedExprs_.push_back(stmt->getCond()->IgnoreParenImpCasts()); + return true; + } + + bool PostTraverseDoStmt(DoStmt*, bool) + { + assert(!contextuallyConvertedExprs_.empty()); + contextuallyConvertedExprs_.pop_back(); + return true; + } + + bool TraverseDoStmt(DoStmt* stmt) + { + auto res = PreTraverseDoStmt(stmt); + assert(res); + res = FilteringRewritePlugin::TraverseDoStmt(stmt); + PostTraverseDoStmt(stmt, res); + return res; + } + + bool PreTraverseForStmt(ForStmt* stmt) + { + auto const e = stmt->getCond(); + if (e != nullptr) + { + contextuallyConvertedExprs_.push_back(e->IgnoreParenImpCasts()); + } + return true; + } + + bool PostTraverseForStmt(ForStmt* stmt, bool) + { + if (stmt->getCond() != nullptr) + { + assert(!contextuallyConvertedExprs_.empty()); + contextuallyConvertedExprs_.pop_back(); + } + return true; + } + + bool TraverseForStmt(ForStmt* stmt) + { + auto res = PreTraverseForStmt(stmt); + assert(res); + res = FilteringRewritePlugin::TraverseForStmt(stmt); + PostTraverseForStmt(stmt, res); + return res; + } + + bool PreTraverseParenExpr(ParenExpr* expr) + { + parenExprs_.push(expr); + return true; + } + + bool PostTraverseParenExpr(ParenExpr*, bool) + { + assert(!parenExprs_.empty()); + parenExprs_.pop(); + return true; + } + + bool TraverseParenExpr(ParenExpr* expr) + { + auto res = PreTraverseParenExpr(expr); + assert(res); + res = FilteringRewritePlugin::TraverseParenExpr(expr); + PostTraverseParenExpr(expr, res); + return res; + } + +private: + bool isContextuallyConverted(Expr const* expr) const + { + return std::find(contextuallyConvertedExprs_.begin(), contextuallyConvertedExprs_.end(), + expr) + != contextuallyConvertedExprs_.end(); + } + + // Get the source range starting at the "."or "->" (plus any preceding non-comment white space): + SourceRange getCallSourceRange(CXXMemberCallExpr const* expr) const + { + if (expr->getImplicitObjectArgument() == nullptr) + { + //TODO: Arguably, such a call of a `get` member function from within some member + // function (so that syntactically no caller is mentioned) should already be handled + // differently when reporting it (just "drop the get()" does not make sense), instead of + // being fitered here: + return {}; + } + // CXXMemberCallExpr::getExprLoc happens to return the location following the "." or "->": + auto start = compiler.getSourceManager().getSpellingLoc(expr->getExprLoc()); + if (!start.isValid()) + { + return {}; + } + for (;;) + { + start = Lexer::GetBeginningOfToken(start.getLocWithOffset(-1), + compiler.getSourceManager(), compiler.getLangOpts()); + auto const s = StringRef(compiler.getSourceManager().getCharacterData(start), + Lexer::MeasureTokenLength(start, compiler.getSourceManager(), + compiler.getLangOpts())); + if (s.empty() || s.startswith("\\\n")) + { + continue; + } + if (s != "." && s != "->") + { + return {}; + } + break; + } + for (;;) + { + auto start1 = Lexer::GetBeginningOfToken( + start.getLocWithOffset(-1), compiler.getSourceManager(), compiler.getLangOpts()); + auto const s = StringRef(compiler.getSourceManager().getCharacterData(start1), + Lexer::MeasureTokenLength(start1, compiler.getSourceManager(), + compiler.getLangOpts())); + if (!(s.empty() || s.startswith("\\\n"))) + { + break; + } + start = start1; + } + return SourceRange(start, + compiler.getSourceManager().getSpellingLoc(compat::getEndLoc(expr))); + } + + //TODO: There are some more places where an expression is contextually converted to bool, but + // those are probably not relevant for our needs here. + std::deque contextuallyConvertedExprs_; + + std::stack parenExprs_; }; bool SimplifyPointerToBool::VisitImplicitCastExpr(ImplicitCastExpr const* castExpr) @@ -58,7 +336,7 @@ bool SimplifyPointerToBool::VisitImplicitCastExpr(ImplicitCastExpr const* castEx return true; // castExpr->dump(); // methodDecl->getParent()->getTypeForDecl()->dump(); - if (!loplugin::isSmartPointerType(methodDecl->getParent()->getTypeForDecl())) + if (!loplugin::isSmartPointerType(memberCallExpr->getImplicitObjectArgument())) return true; // if (isa(callExpr)) // return true; @@ -104,15 +382,57 @@ bool SimplifyPointerToBool::VisitImplicitCastExpr(ImplicitCastExpr const* castEx // if (isa(arg->IgnoreParenImpCasts())) // continue; // } - report(DiagnosticsEngine::Warning, "simplify, drop the get()", castExpr->getExprLoc()) - << castExpr->getSourceRange(); + if (isContextuallyConverted(memberCallExpr)) + { + if (rewriter) + { + auto const range = getCallSourceRange(memberCallExpr); + if (range.isValid() && removeText(range)) + { + return true; + } + } + report(DiagnosticsEngine::Warning, "simplify, drop the get()", memberCallExpr->getExprLoc()) + << memberCallExpr->getSourceRange(); + } + else if (!parenExprs_.empty() && parenExprs_.top()->IgnoreImpCasts() == memberCallExpr) + { + //TODO: attempt rewrite + report(DiagnosticsEngine::Warning, + "simplify, drop the get() and turn the surrounding parentheses into a functional " + "cast to bool", + memberCallExpr->getExprLoc()) + << memberCallExpr->getSourceRange(); + report(DiagnosticsEngine::Note, "surrounding parentheses here", + parenExprs_.top()->getExprLoc()) + << parenExprs_.top()->getSourceRange(); + } + else + { + if (rewriter) + { + auto const loc + = compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(memberCallExpr)); + auto const range = getCallSourceRange(memberCallExpr); + if (loc.isValid() && range.isValid() && insertText(loc, "bool(") + && replaceText(range, ")")) + { + //TODO: atomically only change both or neither + return true; + } + } + report(DiagnosticsEngine::Warning, + "simplify, drop the get() and wrap the expression in a functional cast to bool", + memberCallExpr->getExprLoc()) + << memberCallExpr->getSourceRange(); + } // report(DiagnosticsEngine::Note, "method here", param->getLocation()) // << param->getSourceRange(); return true; } -loplugin::Plugin::Registration - simplifypointertobool("simplifypointertobool"); +loplugin::Plugin::Registration simplifypointertobool("simplifypointertobool", + true); } // namespace diff --git a/compilerplugins/clang/test/simplifypointertobool.cxx b/compilerplugins/clang/test/simplifypointertobool.cxx index 901262c3d474..18e1da607bb8 100644 --- a/compilerplugins/clang/test/simplifypointertobool.cxx +++ b/compilerplugins/clang/test/simplifypointertobool.cxx @@ -11,11 +11,24 @@ void foo(); -void test1(std::unique_ptr p2) +bool test1(std::unique_ptr p2) { // expected-error@+1 {{simplify, drop the get() [loplugin:simplifypointertobool]}} if (p2.get()) foo(); + // expected-error@+1 {{simplify, drop the get() and wrap the expression in a functional cast to bool [loplugin:simplifypointertobool]}} + bool b1 = p2.get(); + //TODO: + bool b2 = ( // deliberately spread across multiple lines + p2.get()); + return b1 && b2; +} + +void test2(std::shared_ptr p) +{ + // expected-error@+1 {{simplify, drop the get() [loplugin:simplifypointertobool]}} + if (p.get()) + foo(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index e22740144316..e86af9673052 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -371,7 +371,7 @@ void OTableHelper::refreshForeignKeys(::std::vector< OUString>& _rNames) { if ( sOldFKName != sFkName ) { - if ( pKeyProps.get() ) + if ( pKeyProps ) m_pImpl->m_aKeys.emplace(sOldFKName,pKeyProps); const OUString sReferencedName = ::dbtools::composeTableName(getMetaData(),sCatalog,aSchema,aName,false,::dbtools::EComposeRule::InDataManipulation); @@ -387,13 +387,13 @@ void OTableHelper::refreshForeignKeys(::std::vector< OUString>& _rNames) } // if ( m_pTables->hasByName(sReferencedName) ) sOldFKName = sFkName; } // if ( sOldFKName != sFkName ) - else if ( pKeyProps.get() ) + else if ( pKeyProps ) { pKeyProps->m_aKeyColumnNames.push_back(sForeignKeyColumn); } } } // while( xResult->next() ) - if ( pKeyProps.get() ) + if ( pKeyProps ) m_pImpl->m_aKeys.emplace(sOldFKName,pKeyProps); ::comphelper::disposeComponent(xResult); } diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 5ea16e7e1c60..60e3fd0ee868 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -68,7 +68,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ } #endif std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XOutputStream> xFlush = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); + Reference< XOutputStream> xFlush = pHelper ? pHelper->getOutputStream() : Reference< XOutputStream>(); if ( xFlush.is() ) try { @@ -108,7 +108,7 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nati std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); OSL_ENSURE(pHelper.get(),"No stream helper!"); - jlong nReturn = pHelper.get() ? pHelper->getSeek()->getPosition() : jlong(0); + jlong nReturn = pHelper ? pHelper->getSeek()->getPosition() : jlong(0); #ifdef HSQLDB_DBG aOpLog.logReturn( nReturn ); #endif @@ -132,7 +132,7 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nati std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); OSL_ENSURE(pHelper.get(),"No stream helper!"); - jlong nReturn = pHelper.get() ? pHelper->getSeek()->getLength() :jlong(0); + jlong nReturn = pHelper ? pHelper->getSeek()->getLength() :jlong(0); #ifdef HSQLDB_DBG aOpLog.logReturn( nReturn ); #endif @@ -143,7 +143,7 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nati jint read_from_storage_stream( JNIEnv * env, jstring name, jstring key ) { std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>(); + Reference< XInputStream> xIn = pHelper ? pHelper->getInputStream() : Reference< XInputStream>(); OSL_ENSURE(xIn.is(),"Input stream is NULL!"); if ( xIn.is() ) { @@ -201,7 +201,7 @@ jint read_from_storage_stream_into_buffer( JNIEnv * env, jstring name, jstring k } #endif std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>(); + Reference< XInputStream> xIn = pHelper ? pHelper->getInputStream() : Reference< XInputStream>(); OSL_ENSURE(xIn.is(),"Input stream is NULL!"); if ( xIn.is() ) { @@ -274,7 +274,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ #endif std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>(); + Reference< XInputStream> xIn = pHelper ? pHelper->getInputStream() : Reference< XInputStream>(); OSL_ENSURE(xIn.is(),"Input stream is NULL!"); if ( xIn.is() ) { @@ -340,7 +340,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ #endif std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XSeekable> xSeek = pHelper.get() ? pHelper->getSeek() : Reference< XSeekable>(); + Reference< XSeekable> xSeek = pHelper ? pHelper->getSeek() : Reference< XSeekable>(); OSL_ENSURE(xSeek.is(),"No Seekable stream!"); if ( !xSeek.is() ) @@ -396,7 +396,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ void write_to_storage_stream_from_buffer( JNIEnv* env, jstring name, jstring key, jbyteArray buffer, jint off, jint len ) { std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); + Reference< XOutputStream> xOut = pHelper ? pHelper->getOutputStream() : Reference< XOutputStream>(); OSL_ENSURE(xOut.is(),"Stream is NULL"); try @@ -456,7 +456,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ void write_to_storage_stream( JNIEnv* env, jstring name, jstring key, jint v ) { std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XOutputStream> xOut = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); + Reference< XOutputStream> xOut = pHelper ? pHelper->getOutputStream() : Reference< XOutputStream>(); OSL_ENSURE(xOut.is(),"Stream is NULL"); try { diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx index 28221925dcc2..bdafac4ee3ab 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx @@ -141,7 +141,7 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stor std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); OSL_ENSURE(pHelper.get(),"No stream helper!"); - if ( pHelper.get() ) + if ( pHelper ) { Reference xIn = pHelper->getInputStream(); if ( xIn.is() ) @@ -203,7 +203,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); OSL_ENSURE(pHelper.get(),"No stream helper!"); - Reference xIn = pHelper.get() ? pHelper->getInputStream() : Reference(); + Reference xIn = pHelper ? pHelper->getInputStream() : Reference(); if ( xIn.is() ) { try @@ -246,7 +246,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora #endif std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XInputStream> xIn = pHelper.get() ? pHelper->getInputStream() : Reference< XInputStream>(); + Reference< XInputStream> xIn = pHelper ? pHelper->getInputStream() : Reference< XInputStream>(); OSL_ENSURE(xIn.is(),"Input stream is NULL!"); jint nBytesRead = 0; if ( xIn.is() ) diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx index 7a4f2b7aa50c..f766696e0d9b 100644 --- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx +++ b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx @@ -109,7 +109,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora #endif std::shared_ptr pHelper = StorageContainer::getRegisteredStream(env,name,key); - Reference< XOutputStream> xFlush = pHelper.get() ? pHelper->getOutputStream() : Reference< XOutputStream>(); + Reference< XOutputStream> xFlush = pHelper ? pHelper->getOutputStream() : Reference< XOutputStream>(); if ( xFlush.is() ) try { @@ -176,7 +176,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora OperationLogFile( env, name, "output" ).logOperation( "sync" ); #endif std::shared_ptr< StreamHelper > pStream = StorageContainer::getRegisteredStream( env, name, key ); - Reference< XOutputStream > xFlush = pStream.get() ? pStream->getOutputStream() : Reference< XOutputStream>(); + Reference< XOutputStream > xFlush = pStream ? pStream->getOutputStream() : Reference< XOutputStream>(); OSL_ENSURE( xFlush.is(), "StorageNativeOutputStream::sync: could not retrieve an output stream!" ); if ( xFlush.is() ) { diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 9cb334c27e86..d8c48c64321a 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -101,7 +101,7 @@ namespace connectivity public: bool isQueryAllowed( const OUString& _rQueryName ) { - if ( !m_pForbiddenQueryNames.get() ) + if ( !m_pForbiddenQueryNames ) return true; if ( m_pForbiddenQueryNames->find( _rQueryName ) == m_pForbiddenQueryNames->end() ) return true; @@ -123,7 +123,7 @@ namespace connectivity :m_rpAllForbiddenNames( _rIteratorImpl.m_pForbiddenQueryNames ) ,m_sForbiddenQueryName( _rForbiddenQueryName ) { - if ( !m_rpAllForbiddenNames.get() ) + if ( !m_rpAllForbiddenNames ) m_rpAllForbiddenNames = std::make_shared(); m_rpAllForbiddenNames->insert( m_sForbiddenQueryName ); } diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 77554ef40fb7..4109e21635d1 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -2514,7 +2514,7 @@ namespace cppcanvas::internal rCanvas, rState ) ); - if( pPolyAction.get() ) + if( pPolyAction ) { maActions.emplace_back( pPolyAction, diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 8f6dbaa31bb0..9aa56fe53787 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -655,7 +655,7 @@ void ODatabaseModelImpl::dispose() for (auto const& elem : m_aContainer) { - if ( elem.get() ) + if ( elem ) elem->m_pDataSource = nullptr; } m_aContainer.clear(); @@ -1113,7 +1113,7 @@ TContentPtr& ODatabaseModelImpl::getObjectContainer( ObjectType _eType ) OSL_PRECOND( _eType >= E_FORM && _eType <= E_TABLE, "ODatabaseModelImpl::getObjectContainer: illegal index!" ); TContentPtr& rContentPtr = m_aContainer[ _eType ]; - if ( !rContentPtr.get() ) + if ( !rContentPtr ) { rContentPtr = std::make_shared(); rContentPtr->m_pDataSource = this; diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx index a8e103a2ee14..5ec2c22e8ea4 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.cxx +++ b/dbaccess/source/sdbtools/connection/objectnames.cxx @@ -204,7 +204,7 @@ namespace sdbtools :m_pPrimary( _pPrimary ) ,m_pSecondary( _pSecondary ) { - OSL_ENSURE( m_pPrimary.get() && m_pSecondary.get(), "CombinedNameCheck::CombinedNameCheck: this will crash!" ); + OSL_ENSURE( m_pPrimary && m_pSecondary, "CombinedNameCheck::CombinedNameCheck: this will crash!" ); } // INameValidation diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index bac5b49cbd7c..28a77291ce13 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -152,7 +152,7 @@ OUString OColumnControlWindow::getAutoIncrementValue() const TOTypeInfoSP const & OColumnControlWindow::getDefaultTyp() const { - if ( !m_pTypeInfo.get() ) + if ( !m_pTypeInfo ) { m_pTypeInfo = std::make_shared(); m_pTypeInfo->aUIName = m_sTypeNames.getToken(TYPE_OTHER, ';'); diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 4650ba113303..c7bb190ab34e 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -916,7 +916,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) { DeactivateAggregate(tpRequired); } - else if (!m_xAutoIncrement && pFieldType.get()) + else if (!m_xAutoIncrement && pFieldType) { if (pFieldType->bNullable) ActivateAggregate(tpRequired); @@ -961,7 +961,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) OUString sDef = BoolStringUI(sValue); // Make sure that <> is only present if the field can be NULL - if ( ( pFieldType.get() && !pFieldType->bNullable ) || !pFieldDescr->IsNullable() ) + if ( ( pFieldType && !pFieldType->bNullable ) || !pFieldDescr->IsNullable() ) { pFieldDescr->SetIsNullable(ColumnValue::NO_NULLS); // The type says so @@ -1015,11 +1015,11 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if (m_xType) { - sal_Int32 nPos = pFieldType.get() ? m_xType->find_text(pFieldDescr->getTypeInfo()->aUIName) : -1; + sal_Int32 nPos = pFieldType ? m_xType->find_text(pFieldDescr->getTypeInfo()->aUIName) : -1; if (nPos == -1) { const OTypeInfoMap* pMap = getTypeInfo(); - OTypeInfoMap::const_iterator aIter = pMap->find(pFieldType.get() ? pFieldDescr->getTypeInfo()->nType : pFieldDescr->GetType()); + OTypeInfoMap::const_iterator aIter = pMap->find(pFieldType ? pFieldDescr->getTypeInfo()->nType : pFieldDescr->GetType()); if(aIter == pMap->end() && !pMap->empty()) { aIter = pMap->begin(); diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 041e7a50378c..d9de91ba494b 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -145,7 +145,7 @@ namespace dbaui void ORelationControl::lateInit() { - if ( !m_pConnData.get() ) + if ( !m_pConnData ) return; m_xSourceDef = m_pConnData->getReferencingTable()->getTable(); m_xDestDef = m_pConnData->getReferencedTable()->getTable(); diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index c6e7f7ac37fb..6e3d329e3ef2 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -139,7 +139,7 @@ void OHTMLReader::NextToken( HtmlTokenId nToken ) } break; case HtmlTokenId::TABLEROW_ON: - if ( !m_pUpdateHelper.get() ) + if ( !m_pUpdateHelper ) m_bError = true; break; case HtmlTokenId::TEXTTOKEN: @@ -176,7 +176,7 @@ void OHTMLReader::NextToken( HtmlTokenId nToken ) } break; case HtmlTokenId::TABLEROW_OFF: - if ( !m_pUpdateHelper.get() ) + if ( !m_pUpdateHelper ) { m_bError = true; break; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 062bdda820bd..865a580b3947 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1066,12 +1066,12 @@ TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap& _rTypeInfo) pTypeInfo = elem.second; // alternative break; } - else if ( !pTypeInfo.get() && elem.second->nType == DataType::DOUBLE ) + else if ( !pTypeInfo && elem.second->nType == DataType::DOUBLE ) pTypeInfo = elem.second; // alternative - else if ( !pTypeInfo.get() && elem.second->nType == DataType::REAL ) + else if ( !pTypeInfo && elem.second->nType == DataType::REAL ) pTypeInfo = elem.second; // alternative } - if ( !pTypeInfo.get() ) // just a fallback + if ( !pTypeInfo ) // just a fallback pTypeInfo = queryTypeInfoByType(DataType::VARCHAR,_rTypeInfo); OSL_ENSURE(pTypeInfo.get(),"checkColumns: can't find a type which is usable as a key!"); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 05cf7e802dd6..35c8a7fe0f18 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -263,7 +263,7 @@ bool OCopyTable::checkAppendData() return false; } - if ( pTypeInfo.get() ) + if ( pTypeInfo ) m_pParent->m_vColumnTypes[i] = pTypeInfo->nType; else m_pParent->m_vColumnTypes[i] = DataType::VARCHAR; diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 30ebf6f6a642..58dbc4d65327 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -729,7 +729,7 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos) { // add extra column for the primary key TOTypeInfoSP pTypeInfo = queryPrimaryKeyType(m_aDestTypeInfo); - if ( pTypeInfo.get() ) + if ( pTypeInfo ) { if ( m_bAddPKFirstTime ) { @@ -1021,7 +1021,7 @@ void OCopyTableWizard::loadData( const ICopyTableSourceObject& _rSourceObject, // search for type bool bForce; TOTypeInfoSP pTypeInfo = ::dbaui::getTypeInfoFromType(m_aTypeInfo,nType,sTypeName,sCreateParam,nPrecision,nScale,bAutoIncrement,bForce); - if ( !pTypeInfo.get() ) + if ( !pTypeInfo ) pTypeInfo = m_pTypeInfo; pActFieldDescr->FillFromTypeInfo(pTypeInfo,true,false); @@ -1416,7 +1416,7 @@ TOTypeInfoSP OCopyTableWizard::convertType(const TOTypeInfoSP& _pType, bool& _bN bool bForce; TOTypeInfoSP pType = ::dbaui::getTypeInfoFromType(m_aDestTypeInfo,_pType->nType,_pType->aTypeName,_pType->aCreateParams,_pType->nPrecision,_pType->nMaximumScale,_pType->bAutoIncrement,bForce); - if ( !pType.get() || bForce ) + if ( !pType || bForce ) { // no type found so we have to find the correct one ourself sal_Int32 nDefaultType = DataType::VARCHAR; switch(_pType->nType) @@ -1492,12 +1492,12 @@ TOTypeInfoSP OCopyTableWizard::convertType(const TOTypeInfoSP& _pType, bool& _bN nDefaultType = DataType::VARCHAR; } pType = ::dbaui::getTypeInfoFromType(m_aDestTypeInfo,nDefaultType,_pType->aTypeName,_pType->aCreateParams,_pType->nPrecision,_pType->nMaximumScale,_pType->bAutoIncrement,bForce); - if ( !pType.get() ) + if ( !pType ) { _bNotConvert = false; OUString const sCreate("x"); pType = ::dbaui::getTypeInfoFromType(m_aDestTypeInfo,DataType::VARCHAR,_pType->aTypeName,sCreate,50,0,false,bForce); - if ( !pType.get() ) + if ( !pType ) pType = m_pTypeInfo; } else if ( bForce ) diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 0dad92bbdf17..83ad642d887a 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -165,7 +165,7 @@ bool OWizNameMatching::LeavePage() } sal_Int32 nType = css::sdbc::DataType::VARCHAR; - if ( pTypeInfo.get() ) + if ( pTypeInfo ) nType = pTypeInfo->nType; m_pParent->m_vColumnTypes[nPos] = nType; } diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index 76f05951541b..6882f12166a7 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -323,7 +323,7 @@ void OFieldDescription::SetAutoIncrementValue(const OUString& _sAutoIncValue) void OFieldDescription::SetType(const TOTypeInfoSP& _pType) { m_pType = _pType; - if ( !m_pType.get() ) + if ( !m_pType ) return; try @@ -348,7 +348,7 @@ void OFieldDescription::SetTypeValue(sal_Int32 _nType) else { m_nType = _nType; - OSL_ENSURE(!m_pType.get(),"Invalid call here!"); + OSL_ENSURE(!m_pType,"Invalid call here!"); } } catch( const Exception& ) @@ -504,7 +504,7 @@ sal_Int32 OFieldDescription::GetType() const if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_TYPE) ) return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_TYPE)); else - return m_pType.get() ? m_pType->nType : m_nType; + return m_pType ? m_pType->nType : m_nType; } OUString OFieldDescription::GetTypeName() const @@ -512,7 +512,7 @@ OUString OFieldDescription::GetTypeName() const if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_TYPENAME) ) return ::comphelper::getString(m_xDest->getPropertyValue(PROPERTY_TYPENAME)); else - return m_pType.get() ? m_pType->aTypeName : m_sTypeName; + return m_pType ? m_pType->aTypeName : m_sTypeName; } sal_Int32 OFieldDescription::GetPrecision() const diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index a17cf27bdf76..6f5128faa6e5 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -891,7 +891,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const TOTypeIn default: OSL_FAIL("OTableEditorCtrl::SetCellData: invalid column!"); } - SetControlText(nRow,nColId,_pTypeInfo.get() ? _pTypeInfo->aUIName : OUString()); + SetControlText(nRow,nColId,_pTypeInfo ? _pTypeInfo->aUIName : OUString()); } void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) @@ -1562,7 +1562,7 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType ) // Show the new description std::shared_ptr pRow = (*m_pRowList)[nRow]; pRow->SetFieldType( _pType, true ); - if ( _pType.get() ) + if ( _pType ) { weld::ComboBox& rTypeList = pTypeCell->get_widget(); const sal_Int32 nCurrentlySelected = rTypeList.get_active(); diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index d8174d69a09a..f88110b48362 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -812,7 +812,7 @@ void OTableController::loadData() bool bForce; OUString const sCreate("x"); TOTypeInfoSP pTypeInfo = ::dbaui::getTypeInfoFromType(m_aTypeInfo,nType,sTypeName,sCreate,nPrecision,nScale,bIsAutoIncrement,bForce); - if ( !pTypeInfo.get() ) + if ( !pTypeInfo ) pTypeInfo = m_pTypeInfo; pTabEdRow->SetFieldType( pTypeInfo, bForce ); @@ -921,7 +921,7 @@ bool OTableController::checkColumns(bool _bNew) { auto pNewRow = std::make_shared(); TOTypeInfoSP pTypeInfo = ::dbaui::queryPrimaryKeyType(m_aTypeInfo); - if ( !pTypeInfo.get() ) + if ( !pTypeInfo ) break; pNewRow->SetFieldType( pTypeInfo ); diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx index 989dd8d819bb..c84ebc834410 100644 --- a/dbaccess/source/ui/tabledesign/TableRow.cxx +++ b/dbaccess/source/ui/tabledesign/TableRow.cxx @@ -78,7 +78,7 @@ bool OTableRow::IsPrimaryKey() const void OTableRow::SetFieldType( const TOTypeInfoSP& _pType, bool _bForce ) { - if ( _pType.get() ) + if ( _pType ) { if( !m_pActFieldDescr ) { diff --git a/dbaccess/source/ui/uno/ColumnPeer.cxx b/dbaccess/source/ui/uno/ColumnPeer.cxx index 66904e79a13f..36bad3a1057d 100644 --- a/dbaccess/source/ui/uno/ColumnPeer.cxx +++ b/dbaccess/source/ui/uno/ColumnPeer.cxx @@ -90,7 +90,7 @@ void OColumnPeer::setColumn(const Reference< XPropertySet>& _xColumn) OUString const sCreateParam("x"); bool bForce; TOTypeInfoSP pTypeInfo = ::dbaui::getTypeInfoFromType(*pFieldControl->getTypeInfo(),nType,sTypeName,sCreateParam,nPrecision,nScale,bAutoIncrement,bForce); - if ( !pTypeInfo.get() ) + if ( !pTypeInfo ) pTypeInfo = pFieldControl->getDefaultTyp(); m_pActFieldDescr->FillFromTypeInfo(pTypeInfo,true,false); diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index ee07fd29f841..f86b1585b13f 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -75,7 +75,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const GraphicObject& rGraphicObject = getGraphicObject(); Graphic aTransformedGraphic(rGraphicObject.GetGraphic()); const bool isBitmap(GraphicType::Bitmap == aTransformedGraphic.GetType() - && !aTransformedGraphic.getVectorGraphicData().get()); + && !aTransformedGraphic.getVectorGraphicData()); const bool isAdjusted(getGraphicAttr().IsAdjusted()); const bool isDrawMode(GraphicDrawMode::Standard != getGraphicAttr().GetDrawMode()); diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 69caa9956e96..e06a41c500a8 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -481,7 +481,7 @@ namespace drawinglayer::primitive2d rGraphic, rTransform); } - else if(rGraphic.getVectorGraphicData().get()) + else if(rGraphic.getVectorGraphicData()) { // embedded Vector Graphic Data fill, create embed transform const basegfx::B2DRange& rSvgRange(rGraphic.getVectorGraphicData()->getRange()); diff --git a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx index 3693ad87aba9..4c0e8e6ccd18 100644 --- a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx @@ -45,7 +45,7 @@ namespace drawinglayer::primitive2d return true; } - if(!getColorModifier().get() || !rCompare.getColorModifier().get()) + if(!getColorModifier() || !rCompare.getColorModifier()) { return false; } diff --git a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx index 954da54b0c8a..255f0235c911 100644 --- a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx @@ -45,7 +45,7 @@ namespace drawinglayer::primitive3d return true; } - if(!getColorModifier().get() || !rCompare.getColorModifier().get()) + if(!getColorModifier() || !rCompare.getColorModifier()) { return false; } diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 5af4dcac755f..9e3cf43208bc 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -420,7 +420,7 @@ void VclProcessor2D::RenderFillGraphicPrimitive2D( // when graphic is animated, force decomposition to use the correct graphic, else // fill style will not be animated if (GraphicType::Bitmap == rFillGraphicAttribute.getGraphic().GetType() - && !rFillGraphicAttribute.getGraphic().getVectorGraphicData().get() + && !rFillGraphicAttribute.getGraphic().getVectorGraphicData() && !rFillGraphicAttribute.getGraphic().IsAnimated()) { // decompose matrix to check for shear, rotate and mirroring diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index b754c980637f..51dfefb6ac5d 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -352,7 +352,7 @@ namespace drawinglayer::processor3d if(bPaintIt) { // get rid of texture coordinates if there is no texture - if(aFill.areTextureCoordinatesUsed() && !getGeoTexSvx().get() && !getTransparenceGeoTexSvx().get()) + if(aFill.areTextureCoordinatesUsed() && !getGeoTexSvx() && !getTransparenceGeoTexSvx()) { aFill.clearTextureCoordinates(); } diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index 49a6a78c7003..dc8a2f8aa962 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -109,14 +109,14 @@ private: basegfx::B2DPoint aTexCoor(0.0, 0.0); getTextureCoor(aTexCoor); - if(mrProcessor.getGeoTexSvx().get()) + if(mrProcessor.getGeoTexSvx()) { // calc color in spot. This may also set to invisible already when // e.g. bitmap textures have transparent parts mrProcessor.getGeoTexSvx()->modifyBColor(aTexCoor, rColor, fOpacity); } - if(basegfx::fTools::more(fOpacity, 0.0) && mrProcessor.getTransparenceGeoTexSvx().get()) + if(basegfx::fTools::more(fOpacity, 0.0) && mrProcessor.getTransparenceGeoTexSvx()) { // calc opacity. Object has a 2nd texture, a transparence texture mrProcessor.getTransparenceGeoTexSvx()->modifyOpacity(aTexCoor, fOpacity); @@ -125,7 +125,7 @@ private: if(basegfx::fTools::more(fOpacity, 0.0)) { - if(mrProcessor.getGeoTexSvx().get()) + if(mrProcessor.getGeoTexSvx()) { if(mbUseNrm) { @@ -193,9 +193,9 @@ private: mbModifyColor = mrProcessor.getBColorModifierStack().count(); mbHasTexCoor = SCANLINE_EMPTY_INDEX != rA.getTextureIndex() && SCANLINE_EMPTY_INDEX != rB.getTextureIndex(); mbHasInvTexCoor = SCANLINE_EMPTY_INDEX != rA.getInverseTextureIndex() && SCANLINE_EMPTY_INDEX != rB.getInverseTextureIndex(); - const bool bTextureActive(mrProcessor.getGeoTexSvx().get() || mrProcessor.getTransparenceGeoTexSvx().get()); + const bool bTextureActive(mrProcessor.getGeoTexSvx() || mrProcessor.getTransparenceGeoTexSvx()); mbUseTex = bTextureActive && (mbHasTexCoor || mbHasInvTexCoor || mrProcessor.getSimpleTextureActive()); - const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx().get()); + const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx()); const bool bNeedNrmOrCol(!bUseColorTex || mrProcessor.getModulate()); mbUseNrm = bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getNormalIndex() && SCANLINE_EMPTY_INDEX != rB.getNormalIndex(); mbUseCol = !mbUseNrm && bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getColorIndex() && SCANLINE_EMPTY_INDEX != rB.getColorIndex(); diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index 427cb440f1bd..6bed0d99351f 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -250,7 +250,7 @@ bool TBCData::Read(SvStream &rS) default: break; } - if ( controlSpecificInfo.get() ) + if ( controlSpecificInfo ) return controlSpecificInfo->Read( rS ); //#FIXME I need to be able to handle different controlSpecificInfo types. return true; @@ -549,7 +549,7 @@ TBCMenuSpecific::Print( FILE* fp ) OUString TBCMenuSpecific::Name() { OUString aName; - if ( name.get() ) + if ( name ) aName = name->getString(); return aName; } @@ -641,7 +641,7 @@ TBCComboDropdownSpecific::TBCComboDropdownSpecific(const TBCHeader& header ) bool TBCComboDropdownSpecific::Read( SvStream &rS) { nOffSet = rS.Tell(); - if ( data.get() ) + if ( data ) return data->Read( rS ); return true; } diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index f6f7e4876eb0..da5f7428e196 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -932,7 +932,7 @@ void FormulaCompiler::InitSymbolsOOXML() const void FormulaCompiler::loadSymbols(const std::pair* pSymbols, FormulaGrammar::Grammar eGrammar, NonConstOpCodeMapPtr& rxMap, SeparatorType eSepType) const { - if ( rxMap.get() ) + if ( rxMap ) return; // not Core diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index f43f95f7e0fb..330217c80292 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -518,7 +518,7 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct ) // OpCode symbol mapping that could be used to create strings from // tokens, it's all dreaded API mapping. However, in that case there's // no array/matrix support anyway, but ensure checking. - if (pCompiler->GetCurrentOpCodeMap().get()) + if (pCompiler->GetCurrentOpCodeMap()) { const sal_Int32 nPos = m_aFuncSel.Min(); assert( 0 <= nPos && nPos < m_pHelper->getCurrentFormula().getLength()); diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx index 44bca5476b2e..6b9144646069 100644 --- a/include/oox/dump/dumperbase.hxx +++ b/include/oox/dump/dumperbase.hxx @@ -447,7 +447,7 @@ public: Base & operator =(Base &&) = default; bool isValid() const { return implIsValid(); } - static bool isValid( const std::shared_ptr< Base >& rxBase ) { return rxBase.get() && rxBase->isValid(); } + static bool isValid( const std::shared_ptr< Base >& rxBase ) { return rxBase && rxBase->isValid(); } protected: Base() {} @@ -824,7 +824,7 @@ template< typename ListType > void SharedConfigData::readNameList( TextInputStream& rStrm, const OUString& rListName ) { NameListRef xList = createNameList< ListType >( rListName ); - if( xList.get() ) + if( xList ) xList->readConfigBlock( rStrm ); } @@ -912,7 +912,7 @@ template< typename Type > OUString Config::getName( const NameListWrapper& rListWrp, Type nKey ) const { NameListRef xList = rListWrp.getNameList( *this ); - return xList.get() ? xList->getName( *this, nKey ) : OOX_DUMP_ERR_NOMAP; + return xList ? xList->getName( *this, nKey ) : OOX_DUMP_ERR_NOMAP; } template< typename Type > diff --git a/include/svx/sdr/attribute/sdrallfillattributeshelper.hxx b/include/svx/sdr/attribute/sdrallfillattributeshelper.hxx index 020401f0541f..01d9a37c19de 100644 --- a/include/svx/sdr/attribute/sdrallfillattributeshelper.hxx +++ b/include/svx/sdr/attribute/sdrallfillattributeshelper.hxx @@ -53,7 +53,7 @@ namespace drawinglayer ~SdrAllFillAttributesHelper(); bool isUsed() const; - bool hasSdrFillAttribute() const { return maFillAttribute.get(); } + bool hasSdrFillAttribute() const { return bool(maFillAttribute); } bool isTransparent() const; const drawinglayer::attribute::SdrFillAttribute& getFillAttribute() const; diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 94f7c08c9b20..2eea42a8decf 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -472,14 +472,14 @@ sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDes if( mxImpl->mxInStream.is() ) { mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream ); - bRet = mxImpl->mxStorage.get() && importDocument(); + bRet = mxImpl->mxStorage && importDocument(); } break; case FILTERDIRECTION_EXPORT: if( mxImpl->mxOutStream.is() ) { mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream ); - bRet = mxImpl->mxStorage.get() && exportDocument() && implFinalizeExport( getMediaDescriptor() ); + bRet = mxImpl->mxStorage && exportDocument() && implFinalizeExport( getMediaDescriptor() ); } break; } diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index fb775338d90c..85eeb2986bcc 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -175,7 +175,7 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con return this; case CDR_TOKEN( ext ): - if( mxAnchor.get() ) mxAnchor->importExt( rAttribs ); + if( mxAnchor ) mxAnchor->importExt( rAttribs ); return nullptr; } break; @@ -195,7 +195,7 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con void ChartDrawingFragment::onCharacters( const OUString& rChars ) { - if( isCurrentElement( CDR_TOKEN( x ), CDR_TOKEN( y ) ) && mxAnchor.get() ) + if( isCurrentElement( CDR_TOKEN( x ), CDR_TOKEN( y ) ) && mxAnchor ) mxAnchor->setPos( getCurrentElement(), getParentElement(), rChars ); } @@ -204,7 +204,7 @@ void ChartDrawingFragment::onEndElement() if( !isCurrentElement( CDR_TOKEN( absSizeAnchor ), CDR_TOKEN( relSizeAnchor ) ) ) return; - if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() ) + if( mxDrawPage.is() && mxShape && mxAnchor ) { EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( maChartRectEmu ); if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) ) diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index bc3af886c8af..7bfee70b15de 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -842,7 +842,7 @@ LineFormatter::LineFormatter( ObjectFormatterData& rData, const AutoFormatEntry* void LineFormatter::convertFormatting( ShapePropertyMap& rPropMap, const ModelRef< Shape >& rxShapeProp, sal_Int32 nSeriesIdx ) { LineProperties aLineProps; - if( mxAutoLine.get() ) + if( mxAutoLine ) aLineProps.assignUsed( *mxAutoLine ); if( rxShapeProp.is() ) aLineProps.assignUsed( rxShapeProp->getLineProperties() ); @@ -871,7 +871,7 @@ FillFormatter::FillFormatter( ObjectFormatterData& rData, const AutoFormatEntry* void FillFormatter::convertFormatting( ShapePropertyMap& rPropMap, const ModelRef< Shape >& rxShapeProp, const PictureOptionsModel* pPicOptions, sal_Int32 nSeriesIdx ) { FillProperties aFillProps; - if( mxAutoFill.get() ) + if( mxAutoFill ) aFillProps.assignUsed( *mxAutoFill ); if( rxShapeProp.is() ) aFillProps.assignUsed( rxShapeProp->getFillProperties() ); @@ -919,7 +919,7 @@ TextFormatter::TextFormatter( ObjectFormatterData& rData, const AutoTextEntry* p void TextFormatter::convertFormatting( PropertySet& rPropSet, const TextCharacterProperties* pTextProps ) { TextCharacterProperties aTextProps; - if( mxAutoText.get() ) + if( mxAutoText ) aTextProps.assignUsed( *mxAutoText ); if( pTextProps ) aTextProps.assignUsed( *pTextProps ); diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 6591e7277040..5d08b28d8094 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -301,7 +301,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat xCustomLabel->setFieldType( lcl_ConvertFieldNameToFieldEnum( pField->getType() ) ); xCustomLabel->setGuid( pField->getUuid() ); } - else if( pRun.get() ) + else if( pRun ) { xCustomLabel->setString( pRun->getText() ); xCustomLabel->setFieldType( DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT ); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index b7e855058e6a..d0f243ffabc1 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -192,7 +192,7 @@ Shape::~Shape() table::TablePropertiesPtr const & Shape::getTableProperties() { - if ( !mpTablePropertiesPtr.get() ) + if ( !mpTablePropertiesPtr ) mpTablePropertiesPtr = std::make_shared(); return mpTablePropertiesPtr; } @@ -321,7 +321,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText ) { SAL_INFO("oox.drawingml", "Shape::applyShapeReference: apply '" << rReferencedShape.msId << "' to '" << msId << "'"); - if ( rReferencedShape.mpTextBody.get() && bUseText ) + if ( rReferencedShape.mpTextBody && bUseText ) mpTextBody = std::make_shared( *rReferencedShape.mpTextBody ); else mpTextBody.reset(); @@ -650,7 +650,7 @@ Reference< XShape > const & Shape::createAndInsert( SAL_INFO("oox.drawingml", "Shape::createAndInsert: id='" << msId << "' service='" << rServiceName << "'"); formulaimport::XmlStreamBuilder * pMathXml(nullptr); - if (mpTextBody.get()) + if (mpTextBody) { for (auto const& it : mpTextBody->getParagraphs()) { @@ -669,7 +669,7 @@ Reference< XShape > const & Shape::createAndInsert( } // tdf#90403 PowerPoint ignores a:ext cx and cy values of p:xfrm, and uses real table width and height - if ( mpTablePropertiesPtr.get() && rServiceName == "com.sun.star.drawing.TableShape" ) + if ( mpTablePropertiesPtr && rServiceName == "com.sun.star.drawing.TableShape" ) { maSize.Width = 0; for (auto const& elem : mpTablePropertiesPtr->getTableGrid()) @@ -1022,7 +1022,7 @@ Reference< XShape > const & Shape::createAndInsert( ShapePropertyMap aShapeProps( rFilterBase.getModelObjectHelper() ); // add properties from textbody to shape properties - if( mpTextBody.get() ) + if( mpTextBody ) { mpTextBody->getTextProperties().pushRotationAdjustments(); aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap ); @@ -1036,7 +1036,7 @@ Reference< XShape > const & Shape::createAndInsert( aShapeProps.assignUsed( maDefaultShapeProperties ); if ( bIsEmbMedia || aServiceName == "com.sun.star.drawing.GraphicObjectShape" || aServiceName == "com.sun.star.drawing.OLE2Shape" || bIsCustomShape ) mpGraphicPropertiesPtr->pushToPropMap( aShapeProps, rGraphicHelper ); - if ( mpTablePropertiesPtr.get() && aServiceName == "com.sun.star.drawing.TableShape" ) + if ( mpTablePropertiesPtr && aServiceName == "com.sun.star.drawing.TableShape" ) mpTablePropertiesPtr->pushToPropSet( rFilterBase, xSet, mpMasterTextListStyle ); FillProperties aFillProperties = getActualFillProperties(pTheme, &rShapeOrParentShapeFillProps); diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx index b4c284a03edd..8d76755855c9 100644 --- a/oox/source/drawingml/shapecontext.cxx +++ b/oox/source/drawingml/shapecontext.cxx @@ -49,7 +49,7 @@ ShapeContext::ShapeContext( ContextHandler2Helper const & rParent, ShapePtr cons , mpMasterShapePtr( pMasterShapePtr ) , mpShapePtr( pShapePtr ) { - if( mpMasterShapePtr.get() && mpShapePtr.get() ) + if( mpMasterShapePtr && mpShapePtr ) mpMasterShapePtr->addChild( mpShapePtr ); } diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx index 84fc719f0e50..61aadb45d862 100644 --- a/oox/source/drawingml/shapegroupcontext.cxx +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -45,7 +45,7 @@ ShapeGroupContext::ShapeGroupContext( FragmentHandler2 const & rParent, ShapePtr { if( pMasterShapePtr ) mpGroupShapePtr->setWps(pMasterShapePtr->getWps()); - if( pMasterShapePtr.get() && mpGroupShapePtr.get() ) + if( pMasterShapePtr && mpGroupShapePtr ) pMasterShapePtr->addChild( mpGroupShapePtr ); } diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index c2deb715048e..e5ab3372d42e 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -130,7 +130,7 @@ static void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableSty std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rPartLineBorders( rTableStylePart.getLineBorders() ); ::oox::drawingml::ShapeStyleRef& rLineStyleRef = rTableStylePart.getStyleRefs()[ nLineType ]; std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >::const_iterator aIter( rPartLineBorders.find( nLineType ) ); - if ( ( aIter != rPartLineBorders.end() ) && aIter->second.get() ) + if ( ( aIter != rPartLineBorders.end() ) && aIter->second ) rLineProperties.assignUsed( *aIter->second ); else if (rLineStyleRef.mnThemedIdx != 0) { @@ -155,7 +155,7 @@ static void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& rTableStylePart ) { ::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( rTableStylePart.getFillProperties() ); - if ( rPartFillPropertiesPtr.get() ) + if ( rPartFillPropertiesPtr ) rFillProperties.assignUsed( *rPartFillPropertiesPtr ); else { @@ -427,7 +427,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons ::Color nPhClr = API_RGB_TRANSPARENT; std::shared_ptr< ::oox::drawingml::FillProperties >& rBackgroundFillPropertiesPtr( rTable.getBackgroundFillProperties() ); ::oox::drawingml::ShapeStyleRef& rBackgroundFillStyle( rTable.getBackgroundFillStyleRef() ); - if (rBackgroundFillPropertiesPtr.get()) + if (rBackgroundFillPropertiesPtr) aBgColor = rBackgroundFillPropertiesPtr->getBestSolidColor(); else if (rBackgroundFillStyle.mnThemedIdx != 0) { diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index e013a5069b80..1abe31db984e 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -35,7 +35,7 @@ TextBody::TextBody() TextBody::TextBody( const TextBodyPtr& pBody ) { - if( pBody.get() ) { + if( pBody ) { maTextProperties = pBody->maTextProperties; maTextListStyle = pBody->maTextListStyle; } @@ -120,7 +120,7 @@ void TextBody::ApplyStyleEmpty( // Apply paragraph properties TextParagraphPropertiesPtr pTextParagraphStyle = maParagraphs[0]->getParagraphStyle(aCombinedTextStyle); - if (pTextParagraphStyle.get()) + if (pTextParagraphStyle) { Reference< XPropertySet > xProps(xText, UNO_QUERY); PropertyMap aioBulletList; diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx index 46bb5b5a38bc..098bf102900a 100644 --- a/oox/source/drawingml/textparagraph.cxx +++ b/oox/source/drawingml/textparagraph.cxx @@ -52,7 +52,7 @@ TextCharacterProperties TextParagraph::getCharacterStyle ( TextParagraphPropertiesPtr pTextParagraphStyle = getParagraphStyle(rTextListStyle); TextCharacterProperties aTextCharacterStyle; - if (pTextParagraphStyle.get()) + if (pTextParagraphStyle) aTextCharacterStyle.assignUsed(pTextParagraphStyle->getTextCharacterProperties()); aTextCharacterStyle.assignUsed(rTextStyleProperties); aTextCharacterStyle.assignUsed(maProperties.getTextCharacterProperties()); @@ -127,7 +127,7 @@ void TextParagraph::insertAt( Reference< XPropertySet > xProps( xAt, UNO_QUERY); TextParagraphPropertiesPtr pTextParagraphStyle = getParagraphStyle(rTextListStyle); - if ( pTextParagraphStyle.get() ) + if ( pTextParagraphStyle ) { TextParagraphProperties aParaProp; aParaProp.apply( *pTextParagraphStyle ); diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index 8f7f206cdf31..17fd33cd7081 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -151,7 +151,7 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext() rPropertyMap.setProperty( PROP_ParaTabStops, aSeq); } - if (mxBlipProps.get() && mxBlipProps->mxFillGraphic.is()) + if (mxBlipProps && mxBlipProps->mxFillGraphic.is()) mrBulletList.setGraphic(mxBlipProps->mxFillGraphic); if( mrBulletList.is() ) diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx index ed25b451f12d..e5f84e5a02a0 100644 --- a/oox/source/drawingml/themeelementscontext.cxx +++ b/oox/source/drawingml/themeelementscontext.cxx @@ -176,15 +176,15 @@ ContextHandlerRef FontSchemeContext::onCreateContext( sal_Int32 nElement, const return this; case A_TOKEN( latin ): - if( mxCharProps.get() ) + if( mxCharProps ) mxCharProps->maLatinFont.setAttributes( rAttribs ); break; case A_TOKEN( ea ): - if( mxCharProps.get() ) + if( mxCharProps ) mxCharProps->maAsianFont.setAttributes( rAttribs ); break; case A_TOKEN( cs ): - if( mxCharProps.get() ) + if( mxCharProps ) mxCharProps->maComplexFont.setAttributes( rAttribs ); break; } diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 3f00248a26cc..775790a20eed 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -869,7 +869,7 @@ void NameListBase::setName( sal_Int64 nKey, const String& rName ) void NameListBase::includeList( const NameListRef& rxList ) { - if( rxList.get() ) + if( rxList ) { for (auto const& elem : *rxList) maMap[ elem.first ] = elem.second; @@ -1249,7 +1249,7 @@ void UnitConverter::implIncludeList( const NameListBase& /*rList*/ ) NameListRef NameListWrapper::getNameList( const Config& rCfg ) const { - if (!mxList.get()) + if (!mxList) mxList = rCfg.getNameList( maName ); return mxList; } @@ -1303,7 +1303,7 @@ NameListRef SharedConfigData::getNameList( const OUString& rListName ) const bool SharedConfigData::implIsValid() const { - return mbLoaded && mxContext.is() && mxRootStrg.get() && !maSysFileName.isEmpty(); + return mbLoaded && mxContext.is() && mxRootStrg && !maSysFileName.isEmpty(); } void SharedConfigData::implProcessConfigItemStr( @@ -1355,7 +1355,7 @@ void SharedConfigData::createShortList( const OUString& rData ) if( StringHelper::convertStringToInt( nStartKey, aDataVec[ 1 ] ) ) { std::shared_ptr< MultiList > xList = createNameList< MultiList >( aDataVec[ 0 ] ); - if( xList.get() ) + if( xList ) { aDataVec.erase( aDataVec.begin(), aDataVec.begin() + 2 ); xList->setNamesFromVec( nStartKey, aDataVec ); @@ -1378,7 +1378,7 @@ void SharedConfigData::createUnitConverter( const OUString& rData ) if( StringHelper::convertStringToDouble( fFactor, aFactor ) && (fFactor != 0.0) ) { std::shared_ptr< UnitConverter > xList = createNameList< UnitConverter >( aDataVec[ 0 ] ); - if( xList.get() ) + if( xList ) { xList->setFactor( bRecip ? (1.0 / fFactor) : fFactor ); if( aDataVec.size() >= 3 ) @@ -1409,7 +1409,7 @@ void Config::construct( const char* pcEnvVar, const FilterBase& rFilter ) void Config::construct( const char* pcEnvVar, const Reference< XComponentContext >& rxContext, const StorageRef& rxRootStrg, const OUString& rSysFileName ) { - if( pcEnvVar && rxRootStrg.get() && !rSysFileName.isEmpty() ) + if( pcEnvVar && rxRootStrg && !rSysFileName.isEmpty() ) if( const char* pcFileName = ::getenv( pcEnvVar ) ) mxCfgData = std::make_shared( OUString::createFromAscii( pcFileName ), rxContext, rxRootStrg, rSysFileName ); } @@ -1688,7 +1688,7 @@ void Output::writeItemName( const String& rItemName ) StorageIterator::StorageIterator( const StorageRef& rxStrg ) : mxStrg( rxStrg ) { - if( mxStrg.get() ) + if( mxStrg ) mxStrg->getElementNames( maNames ); maIt = maNames.begin(); } @@ -1722,12 +1722,12 @@ bool StorageIterator::isStorage() const if( !isValid() ) return false; StorageRef xStrg = mxStrg->openSubStorage( *maIt, false ); - return xStrg.get() && xStrg->isStorage(); + return xStrg && xStrg->isStorage(); } bool StorageIterator::implIsValid() const { - return mxStrg.get() && mxStrg->isStorage() && (maIt != maNames.end()); + return mxStrg && mxStrg->isStorage() && (maIt != maNames.end()); } ObjectBase::~ObjectBase() @@ -1778,7 +1778,7 @@ void StorageObjectBase::construct( const ObjectBase& rParent ) bool StorageObjectBase::implIsValid() const { - return mxStrg.get() && !maSysPath.isEmpty() && ObjectBase::implIsValid(); + return mxStrg && !maSysPath.isEmpty() && ObjectBase::implIsValid(); } void StorageObjectBase::implDump() @@ -2308,7 +2308,7 @@ void TextStreamObjectBase::construct( const OutputObjectBase& rParent, bool TextStreamObjectBase::implIsValid() const { - return InputObjectBase::implIsValid() && mxTextStrm.get(); + return InputObjectBase::implIsValid() && mxTextStrm; } void TextStreamObjectBase::implDump() diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx index f8ce1ec59fa8..80485c453b7c 100644 --- a/oox/source/dump/oledumper.cxx +++ b/oox/source/dump/oledumper.cxx @@ -323,7 +323,7 @@ void OlePropertyStreamObject::dumpDictionaryProperty( sal_uInt32 nStartPos ) TableGuard aTabGuard( mxOut, 10, 20 ); sal_Int32 nId = dumpDec< sal_Int32 >( "id" ); OUString aName = dumpString8( "name" ); - if( mxPropIds.get() ) + if( mxPropIds ) mxPropIds->setName( nId, aName ); } } diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx index d0928373350f..2f0ddd6b7926 100644 --- a/oox/source/helper/storagebase.cxx +++ b/oox/source/helper/storagebase.cxx @@ -126,7 +126,7 @@ StorageRef StorageBase::openSubStorage( const OUString& rStorageName, bool bCrea lclSplitFirstElement( aElement, aRemainder, rStorageName ); if( !aElement.isEmpty() ) xSubStorage = getSubStorage( aElement, bCreateMissing ); - if( xSubStorage.get() && !aRemainder.isEmpty() ) + if( xSubStorage && !aRemainder.isEmpty() ) xSubStorage = xSubStorage->openSubStorage( aRemainder, bCreateMissing ); } return xSubStorage; @@ -142,7 +142,7 @@ Reference< XInputStream > StorageBase::openInputStream( const OUString& rStreamN if( !aRemainder.isEmpty() ) { StorageRef xSubStorage = getSubStorage( aElement, false ); - if( xSubStorage.get() ) + if( xSubStorage ) xInStream = xSubStorage->openInputStream( aRemainder ); } else @@ -170,7 +170,7 @@ Reference< XOutputStream > StorageBase::openOutputStream( const OUString& rStrea if( !aRemainder.isEmpty() ) { StorageRef xSubStorage = getSubStorage( aElement, true ); - if( xSubStorage.get() ) + if( xSubStorage ) xOutStream = xSubStorage->openOutputStream( aRemainder ); } else @@ -194,10 +194,10 @@ void StorageBase::copyToStorage( StorageBase& rDestStrg, const OUString& rElemen return; StorageRef xSubStrg = openSubStorage( rElementName, false ); - if( xSubStrg.get() ) + if( xSubStrg ) { StorageRef xDestSubStrg = rDestStrg.openSubStorage( rElementName, true ); - if( xDestSubStrg.get() ) + if( xDestSubStrg ) xSubStrg->copyStorageToStorage( *xDestSubStrg ); } else diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 78cc0b76770d..706514baf1c2 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -2688,12 +2688,12 @@ ControlModelBase* EmbeddedControl::createModelFromGuid( const OUString& rClassId OUString EmbeddedControl::getServiceName() const { - return mxModel.get() ? mxModel->getServiceName() : OUString(); + return mxModel ? mxModel->getServiceName() : OUString(); } bool EmbeddedControl::convertProperties( const Reference< XControlModel >& rxCtrlModel, const ControlConverter& rConv ) const { - if( mxModel.get() && rxCtrlModel.is() && !maName.isEmpty() ) + if( mxModel && rxCtrlModel.is() && !maName.isEmpty() ) { PropertyMap aPropMap; aPropMap.setProperty( PROP_Name, maName ); @@ -2715,7 +2715,7 @@ bool EmbeddedControl::convertProperties( const Reference< XControlModel >& rxCtr void EmbeddedControl::convertFromProperties( const Reference< XControlModel >& rxCtrlModel, const ControlConverter& rConv ) { - if( mxModel.get() && rxCtrlModel.is() && !maName.isEmpty() ) + if( mxModel && rxCtrlModel.is() && !maName.isEmpty() ) { PropertySet aPropSet( rxCtrlModel ); aPropSet.getProperty( maName, PROP_Name ); diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx index f5113ebc62c4..82aa1cd79fe8 100644 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -311,13 +311,13 @@ StorageRef OleStorage::implOpenSubStorage( const OUString& rElementName, bool bC new OLE storage based on a temporary file. All operations are performed on this clean storage. On committing, the storage will be completely re-inserted into the parent storage. */ - if( !isReadOnly() && (bCreateMissing || xSubStorage.get()) ) try + if( !isReadOnly() && (bCreateMissing || xSubStorage) ) try { // create new storage based on a temp file Reference< XStream > xTempFile( TempFile::create(mxContext), UNO_QUERY_THROW ); StorageRef xTempStorage( new OleStorage( *this, xTempFile, rElementName ) ); // copy existing substorage into temp storage - if( xSubStorage.get() ) + if( xSubStorage ) xSubStorage->copyStorageToStorage( *xTempStorage ); // return the temp storage to caller xSubStorage = xTempStorage; diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index c48e701e1dae..d0a5952ba486 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -279,7 +279,7 @@ ControlModelRef VbaSiteModel::createControlModel( const AxClassTable& rClassTabl } } - if( xCtrlModel.get() ) + if( xCtrlModel ) { // user form controls are AWT models xCtrlModel->setAwtModelMode(); @@ -324,14 +324,14 @@ VbaFormControl::~VbaFormControl() void VbaFormControl::importModelOrStorage( BinaryInputStream& rInStrm, StorageBase& rStrg, const AxClassTable& rClassTable ) { - if( !mxSiteModel.get() ) + if( !mxSiteModel ) return; if( mxSiteModel->isContainer() ) { StorageRef xSubStrg = rStrg.openSubStorage( mxSiteModel->getSubStorageName(), false ); OSL_ENSURE( xSubStrg.get(), "VbaFormControl::importModelOrStorage - cannot find storage for embedded control" ); - if( xSubStrg.get() ) + if( xSubStrg ) importStorage( *xSubStrg, rClassTable ); } else if( !rInStrm.isEof() ) @@ -344,13 +344,13 @@ void VbaFormControl::importModelOrStorage( BinaryInputStream& rInStrm, StorageBa OUString VbaFormControl::getControlName() const { - return mxSiteModel.get() ? mxSiteModel->getName() : OUString(); + return mxSiteModel ? mxSiteModel->getName() : OUString(); } void VbaFormControl::createAndConvert( sal_Int32 nCtrlIndex, const Reference< XNameContainer >& rxParentNC, const ControlConverter& rConv ) const { - if( !(rxParentNC.is() && mxSiteModel.get() && mxCtrlModel.get()) ) + if( !(rxParentNC.is() && mxSiteModel && mxCtrlModel) ) return; try @@ -379,7 +379,7 @@ void VbaFormControl::createAndConvert( sal_Int32 nCtrlIndex, void VbaFormControl::importControlModel( BinaryInputStream& rInStrm, const AxClassTable& rClassTable ) { createControlModel( rClassTable ); - if( mxCtrlModel.get() ) + if( mxCtrlModel ) mxCtrlModel->importBinaryModel( rInStrm ); } @@ -442,7 +442,7 @@ void VbaFormControl::importStorage( StorageBase& rStrg, const AxClassTable& rCla if (elem->getControlType() == API_CONTROL_PAGE) { VbaSiteModelRef xPageSiteRef = control->mxSiteModel; - if ( xPageSiteRef.get() ) + if ( xPageSiteRef ) idToPage[ xPageSiteRef->getId() ] = control; } else @@ -484,7 +484,7 @@ void VbaFormControl::importStorage( StorageBase& rStrg, const AxClassTable& rCla bool VbaFormControl::convertProperties( const Reference< XControlModel >& rxCtrlModel, const ControlConverter& rConv, sal_Int32 nCtrlIndex ) const { - if( rxCtrlModel.is() && mxSiteModel.get() && mxCtrlModel.get() ) + if( rxCtrlModel.is() && mxSiteModel && mxCtrlModel ) { const OUString& rCtrlName = mxSiteModel->getName(); OSL_ENSURE( !rCtrlName.isEmpty(), "VbaFormControl::convertProperties - control without name" ); @@ -524,7 +524,7 @@ bool VbaFormControl::convertProperties( const Reference< XControlModel >& rxCtrl void VbaFormControl::createControlModel( const AxClassTable& rClassTable ) { // derived classes may have created their own control model - if( !mxCtrlModel && mxSiteModel.get() ) + if( !mxCtrlModel && mxSiteModel ) mxCtrlModel = mxSiteModel->createControlModel( rClassTable ); } @@ -603,7 +603,7 @@ void VbaFormControl::finalizeEmbeddedControls() VbaControlNameInserter aInserter( aControlNames ); maControls.forEach( aInserter ); for (auto const& control : maControls) - if( control->mxCtrlModel.get() && (control->mxCtrlModel->getControlType() == API_CONTROL_GROUPBOX) ) + if( control->mxCtrlModel && (control->mxCtrlModel->getControlType() == API_CONTROL_GROUPBOX) ) control->maControls.forEach( aInserter ); /* Reprocess the sorted list and collect all option button controls that @@ -689,13 +689,13 @@ void VbaFormControl::finalizeEmbeddedControls() void VbaFormControl::moveRelative( const AxPairData& rDistance ) { - if( mxSiteModel.get() ) + if( mxSiteModel ) mxSiteModel->moveRelative( rDistance ); } void VbaFormControl::moveEmbeddedToAbsoluteParent() { - if( !(mxSiteModel.get() && !maControls.empty()) ) + if( !(mxSiteModel && !maControls.empty()) ) return; // distance to move is equal to position of this control in its parent @@ -718,8 +718,8 @@ void VbaFormControl::moveEmbeddedToAbsoluteParent() bool VbaFormControl::compareByTabIndex( const VbaFormControlRef& rxLeft, const VbaFormControlRef& rxRight ) { // sort controls without model to the end - sal_Int32 nLeftTabIndex = rxLeft->mxSiteModel.get() ? rxLeft->mxSiteModel->getTabIndex() : SAL_MAX_INT32; - sal_Int32 nRightTabIndex = rxRight->mxSiteModel.get() ? rxRight->mxSiteModel->getTabIndex() : SAL_MAX_INT32; + sal_Int32 nLeftTabIndex = rxLeft->mxSiteModel ? rxLeft->mxSiteModel->getTabIndex() : SAL_MAX_INT32; + sal_Int32 nRightTabIndex = rxRight->mxSiteModel ? rxRight->mxSiteModel->getTabIndex() : SAL_MAX_INT32; return nLeftTabIndex < nRightTabIndex; } diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index 02b290ed8d1c..3434cb306d66 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -491,7 +491,7 @@ void VbaProject::importModulesAndForms( StorageBase& rVbaPrjStrg, const GraphicH if( elem != "VBA" ) { StorageRef xSubStrg = rVbaPrjStrg.openSubStorage( elem, false ); - if( xSubStrg.get() ) try + if( xSubStrg ) try { // resolve module name from storage name (which equals the module stream name) VbaModule* pModule = maModulesByStrm.get( elem ).get(); diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx index f16eb4a454d7..296263762897 100644 --- a/oox/source/ppt/pptgraphicshapecontext.cxx +++ b/oox/source/ppt/pptgraphicshapecontext.cxx @@ -75,10 +75,10 @@ ContextHandlerRef PPTGraphicShapeContext::onCreateContext( sal_Int32 aElementTok { // TODO: use id to shape map SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() ); - if ( pMasterPersist.get() && rAttribs.hasAttribute( XML_idx ) ) + if ( pMasterPersist && rAttribs.hasAttribute( XML_idx ) ) pPlaceholder = PPTShape::findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() ); } - if ( !pPlaceholder.get() && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) ) + if ( !pPlaceholder && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) ) { // inheriting properties from placeholder objects by cloning shape @@ -123,13 +123,13 @@ ContextHandlerRef PPTGraphicShapeContext::onCreateContext( sal_Int32 aElementTok else if ( eShapeLocation == Slide ) // normal slide shapes have to search within the corresponding master tree for referenced objects { SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() ); - if ( pMasterPersist.get() ) + if ( pMasterPersist ) pPlaceholder = PPTShape::findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, pPPTShapePtr->getSubTypeIndex(), pMasterPersist->getShapes()->getChildren() ); } } } - if ( pPlaceholder.get() ) + if ( pPlaceholder ) { bool bUseText = true; switch( pPlaceholder->getSubType() ) diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 99bba509fa47..edf527b67049 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -93,15 +93,15 @@ oox::drawingml::TextListStylePtr PPTShape::getSubTypeTextListStyle( const SlideP { case XML_ctrTitle : case XML_title : - pTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle(); + pTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle(); break; case XML_subTitle : case XML_obj : case XML_body : if ( rSlidePersist.isNotesPage() ) - pTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getNotesTextStyle() : rSlidePersist.getNotesTextStyle(); + pTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getNotesTextStyle() : rSlidePersist.getNotesTextStyle(); else - pTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); + pTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); break; } @@ -141,7 +141,7 @@ void PPTShape::addShape( case XML_title : { sServiceName = "com.sun.star.presentation.TitleTextShape"; - aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle(); + aMasterTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle(); } break; case XML_subTitle : @@ -150,14 +150,14 @@ void PPTShape::addShape( sServiceName = OUString(); else { sServiceName = "com.sun.star.presentation.SubtitleShape"; - aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); + aMasterTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); } } break; case XML_obj : { sServiceName = sOutlinerShapeService; - aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); + aMasterTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); } break; case XML_body : @@ -165,12 +165,12 @@ void PPTShape::addShape( if (rSlidePersist.isNotesPage()) { sServiceName = "com.sun.star.presentation.NotesShape"; - aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getNotesTextStyle() : rSlidePersist.getNotesTextStyle(); + aMasterTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getNotesTextStyle() : rSlidePersist.getNotesTextStyle(); } else { sServiceName = sOutlinerShapeService; - aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); + aMasterTextListStyle = rSlidePersist.getMasterPersist() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle(); } } break; @@ -246,10 +246,10 @@ void PPTShape::addShape( if (mnSubType && getSubTypeIndex().has() && meShapeLocation == Layout) { oox::drawingml::ShapePtr pPlaceholder = PPTShape::findPlaceholderByIndex( getSubTypeIndex().get(), rSlidePersist.getShapes()->getChildren(), true ); - if (!pPlaceholder.get()) + if (!pPlaceholder) pPlaceholder = PPTShape::findPlaceholder( mnSubType, 0, getSubTypeIndex(), rSlidePersist.getShapes()->getChildren(), true ); - if (pPlaceholder.get()) { + if (pPlaceholder) { if (maSize.Width == 0 || maSize.Height == 0) { awt::Size aSize = maSize; if (maSize.Width == 0) @@ -270,24 +270,24 @@ void PPTShape::addShape( } // use placeholder index if possible - if (mnSubType && getSubTypeIndex().has() && rSlidePersist.getMasterPersist().get()) + if (mnSubType && getSubTypeIndex().has() && rSlidePersist.getMasterPersist()) { oox::drawingml::ShapePtr pPlaceholder = PPTShape::findPlaceholderByIndex(getSubTypeIndex().get(), rSlidePersist.getMasterPersist()->getShapes()->getChildren()); // TODO: Check if this is required for non-notes slides as well... - if (rSlidePersist.isNotesPage() && pPlaceholder.get() && pPlaceholder->getSubType() != getSubType()) + if (rSlidePersist.isNotesPage() && pPlaceholder && pPlaceholder->getSubType() != getSubType()) pPlaceholder.reset(); - if (pPlaceholder.get()) { + if (pPlaceholder) { SAL_INFO("oox.ppt","found placeholder with index: " << getSubTypeIndex().get() << " and type: " << lclDebugSubType( mnSubType )); } - if (pPlaceholder.get()) { + if (pPlaceholder) { PPTShape* pPPTPlaceholder = dynamic_cast< PPTShape* >( pPlaceholder.get() ); TextListStylePtr pNewTextListStyle = std::make_shared(); if (pPlaceholder->getTextBody()) { pNewTextListStyle->apply( pPlaceholder->getTextBody()->getTextListStyle() ); - if (pPlaceholder->getMasterTextListStyle().get()) + if (pPlaceholder->getMasterTextListStyle()) pNewTextListStyle->apply( *pPlaceholder->getMasterTextListStyle() ); // SAL_INFO("oox.ppt","placeholder body style"); @@ -299,34 +299,34 @@ void PPTShape::addShape( // SAL_INFO("oox.ppt","combined master text list style"); // aMasterTextListStyle->dump(); } - if (pPPTPlaceholder && pPPTPlaceholder->mpPlaceholder.get()) { + if (pPPTPlaceholder && pPPTPlaceholder->mpPlaceholder) { SAL_INFO("oox.ppt","placeholder has parent placeholder: " << pPPTPlaceholder->mpPlaceholder->getId() << " type: " << lclDebugSubType( pPPTPlaceholder->mpPlaceholder->getSubType() ) << " index: " << pPPTPlaceholder->mpPlaceholder->getSubTypeIndex().get() ); SAL_INFO("oox.ppt","has textbody " << (pPPTPlaceholder->mpPlaceholder->getTextBody() != nullptr) ); TextListStylePtr pPlaceholderStyle = getSubTypeTextListStyle( rSlidePersist, pPPTPlaceholder->mpPlaceholder->getSubType() ); if (pPPTPlaceholder->mpPlaceholder->getTextBody()) pNewTextListStyle->apply( pPPTPlaceholder->mpPlaceholder->getTextBody()->getTextListStyle() ); - if (pPlaceholderStyle.get()) { + if (pPlaceholderStyle) { pNewTextListStyle->apply( *pPlaceholderStyle ); //pPlaceholderStyle->dump(); } } - } else if (!mpPlaceholder.get()) { + } else if (!mpPlaceholder) { aMasterTextListStyle.reset(); } - SAL_INFO("oox.ppt","placeholder id: " << (pPlaceholder.get() ? pPlaceholder->getId() : "not found")); + SAL_INFO("oox.ppt","placeholder id: " << (pPlaceholder ? pPlaceholder->getId() : "not found")); } if (!sServiceName.isEmpty()) { - if (!aMasterTextListStyle.get()) + if (!aMasterTextListStyle) { - bool isOther = !getTextBody().get() && sServiceName != "com.sun.star.drawing.GroupShape"; + bool isOther = !getTextBody() && sServiceName != "com.sun.star.drawing.GroupShape"; TextListStylePtr aSlideStyle = isOther ? rSlidePersist.getOtherTextStyle() : rSlidePersist.getDefaultTextStyle(); // Combine from MasterSlide details as well. - if (rSlidePersist.getMasterPersist().get()) + if (rSlidePersist.getMasterPersist()) { aMasterTextListStyle = isOther ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getMasterPersist()->getDefaultTextStyle(); - if (aSlideStyle.get()) + if (aSlideStyle) aMasterTextListStyle->apply( *aSlideStyle ); } else @@ -335,12 +335,12 @@ void PPTShape::addShape( } } - if( aMasterTextListStyle.get() && getTextBody().get() ) { + if( aMasterTextListStyle && getTextBody() ) { TextListStylePtr aCombinedTextListStyle = std::make_shared(); aCombinedTextListStyle->apply( *aMasterTextListStyle ); - if( mpPlaceholder.get() && mpPlaceholder->getTextBody().get() ) + if( mpPlaceholder && mpPlaceholder->getTextBody() ) aCombinedTextListStyle->apply( mpPlaceholder->getTextBody()->getTextListStyle() ); aCombinedTextListStyle->apply( getTextBody()->getTextListStyle() ); @@ -436,7 +436,7 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstSubType, sal void add(const oox::drawingml::ShapePtr& aShape, sal_Int32 nFirstSubType, sal_Int32 nSecondSubType, const OptValue< sal_Int32 >& oSubTypeIndex) { - if (!aShape.get()) + if (!aShape) return; // get flags @@ -460,7 +460,7 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstSubType, sal // add if (aPrioIndex != -1) { - if (!aChoice.at(aPrioIndex).get()) + if (!aChoice.at(aPrioIndex)) { aChoice.at(aPrioIndex) = aShape; } @@ -472,7 +472,7 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstSubType, sal { for (const oox::drawingml::ShapePtr& aShape : aChoice) { - if (aShape.get()) + if (aShape) { return aShape; } @@ -483,7 +483,7 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstSubType, sal bool hasByPrio(size_t aIndex) const { - return aChoice.at(aIndex).get(); + return bool(aChoice.at(aIndex)); } private: @@ -507,7 +507,7 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstSubType, sal if (!rChildren.empty()) { const oox::drawingml::ShapePtr aShape = findPlaceholder( nFirstSubType, nSecondSubType, oSubTypeIndex, rChildren, bMasterOnly ); - if (aShape.get()) + if (aShape) { aPlaceholders.add(aShape, nFirstSubType, nSecondSubType, oSubTypeIndex); } @@ -538,7 +538,7 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholderByIndex( const sal_Int32 nIdx, } std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren(); aShapePtr = findPlaceholderByIndex( nIdx, rChildren, bMasterOnly ); - if ( aShapePtr.get() ) + if ( aShapePtr ) break; ++aRevIter; } diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx index c8677bdd8371..25bcc9200bef 100644 --- a/oox/source/ppt/pptshapecontext.cxx +++ b/oox/source/ppt/pptshapecontext.cxx @@ -126,13 +126,13 @@ ContextHandlerRef PPTShapeContext::onCreateContext( sal_Int32 aElementToken, con else if ( eShapeLocation == Slide ) // normal slide shapes have to search within the corresponding master tree for referenced objects { SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() ); - if ( pMasterPersist.get() ) + if ( pMasterPersist ) { pPlaceholder = PPTShape::findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, pPPTShapePtr->getSubTypeIndex(), pMasterPersist->getShapes()->getChildren() ); } } - if ( pPlaceholder.get() ) + if ( pPlaceholder ) { SAL_INFO("oox.ppt","shape " << mpShapePtr->getId() << " will get shape reference " << pPlaceholder->getId() << " applied"); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index ea8d692ac2fc..03863baa8b3d 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -274,7 +274,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage } } - if ( !pMasterPersistPtr.get() ) + if ( !pMasterPersistPtr ) { // masterpersist not found, we have to load it Reference< drawing::XDrawPage > xMasterPage; Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); @@ -336,7 +336,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage } // importing slide page - if (pMasterPersistPtr.get()) { + if (pMasterPersistPtr) { pSlidePersistPtr->setMasterPersist( pMasterPersistPtr ); pSlidePersistPtr->setTheme( pMasterPersistPtr->getTheme() ); Reference< drawing::XMasterPageTarget > xMasterPageTarget( pSlidePersistPtr->getPage(), UNO_QUERY ); @@ -562,7 +562,7 @@ void PresentationFragmentHandler::importSlide( const FragmentHandlerRef& rxSlide { Reference< drawing::XDrawPage > xSlide( rSlidePersistPtr->getPage() ); SlidePersistPtr pMasterPersistPtr( rSlidePersistPtr->getMasterPersist() ); - if ( pMasterPersistPtr.get() ) + if ( pMasterPersistPtr ) { // Setting "Layout" property adds extra title and outliner preset shapes to the master slide Reference< drawing::XDrawPage > xMasterSlide(pMasterPersistPtr->getPage()); diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 5feaf8532513..c607e17d7a4e 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -179,7 +179,7 @@ SlideFragmentHandler::~SlideFragmentHandler() case PPT_TOKEN( clrMap ): // CT_ColorMapping { oox::drawingml::ClrMapPtr pClrMapPtr = - ( aElementToken == PPT_TOKEN( clrMap ) || !mpSlidePersistPtr.get() || !mpSlidePersistPtr->getClrMap().get() ) + ( aElementToken == PPT_TOKEN( clrMap ) || !mpSlidePersistPtr || !mpSlidePersistPtr->getClrMap() ) ? std::make_shared() : std::make_shared( *mpSlidePersistPtr->getClrMap() ); ContextHandlerRef ret = new oox::drawingml::clrMapContext( *this, rAttribs, *pClrMapPtr ); diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx index 80be6d7fde53..6505b91a16e5 100644 --- a/oox/source/shape/ShapeFilterBase.cxx +++ b/oox/source/shape/ShapeFilterBase.cxx @@ -111,7 +111,7 @@ GraphicHelper* ShapeFilterBase::implCreateGraphicHelper() const { ::Color nColor; - if (mpTheme.get()) + if (mpTheme) mpTheme->getClrScheme().getColor( nToken, nColor ); return nColor; diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index f62185f81455..332da1efe004 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -6599,7 +6599,7 @@ void Test::testExternalRef() // Sheet2 is not referenced at all; the cache table shouldn't even exist. pCacheTab = pRefMgr->getCacheTable(nFileId, aExtSh2Name, false); - CPPUNIT_ASSERT_MESSAGE("Cache table for sheet 2 should *not* exist.", !pCacheTab.get()); + CPPUNIT_ASSERT_MESSAGE("Cache table for sheet 2 should *not* exist.", !pCacheTab); // Sheet3's row 5 is not referenced; it should not be cached. pCacheTab = pRefMgr->getCacheTable(nFileId, aExtSh3Name, false); diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index dd9a36b71763..d0ac658f3e35 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -899,7 +899,7 @@ const OutlinerParaObject* ScPostIt::GetOutlinerObject() const { if( maNoteData.mxCaption ) return maNoteData.mxCaption->GetOutlinerParaObject(); - if( maNoteData.mxInitData.get() ) + if( maNoteData.mxInitData ) return maNoteData.mxInitData->mxOutlinerObj.get(); return nullptr; } @@ -926,7 +926,7 @@ OUString ScPostIt::GetText() const } return aBuffer.makeStringAndClear(); } - if( maNoteData.mxInitData.get() ) + if( maNoteData.mxInitData ) return maNoteData.mxInitData->maSimpleText; return OUString(); } @@ -935,7 +935,7 @@ bool ScPostIt::HasMultiLineText() const { if( const EditTextObject* pEditObj = GetEditTextObject() ) return pEditObj->GetParagraphCount() > 1; - if( maNoteData.mxInitData.get() ) + if( maNoteData.mxInitData ) return maNoteData.mxInitData->maSimpleText.indexOf( '\n' ) >= 0; return false; } @@ -1013,8 +1013,8 @@ void ScPostIt::CreateCaptionFromInitData( const ScAddress& rPos ) const { // Captions are not created in Undo documents and only rarely in Clipboard, // but otherwise we need caption or initial data. - assert((maNoteData.mxCaption || maNoteData.mxInitData.get()) || mrDoc.IsUndo() || mrDoc.IsClipboard()); - if( !maNoteData.mxInitData.get() ) + assert((maNoteData.mxCaption || maNoteData.mxInitData) || mrDoc.IsUndo() || mrDoc.IsClipboard()); + if( !maNoteData.mxInitData ) return; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 8217c6a411e8..9cdc0c8fc427 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -262,7 +262,7 @@ void ScCompiler::SetNumberFormatter( SvNumberFormatter* pFormatter ) void ScCompiler::SetFormulaLanguage( const ScCompiler::OpCodeMapPtr & xMap ) { - if (xMap.get()) + if (xMap) { mxSymbols = xMap; if (mxSymbols->isEnglish()) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 644783757893..56309d6878d7 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2461,7 +2461,7 @@ void ScInterpreter::ScCellExternal() // For SHEET, No idea what number we should set, but let's always set // 1 if the external sheet exists, no matter what sheet. Excel does // the same. - if (pRefMgr->getCacheTable(nFileId, aTabName, false).get()) + if (pRefMgr->getCacheTable(nFileId, aTabName, false)) PushInt(1); else SetError(FormulaError::NoName); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 451f26bcd076..91f01290c154 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -349,7 +349,7 @@ void ImportExcel8::ReadBasic() uno::Reference< io::XInputStream > xIn = rMedium.GetInputStream(); oox::ole::OleStorage root( aCtx, xIn, false ); oox::StorageRef vbaStg = root.openSubStorage( "_VBA_PROJECT_CUR", false ); - if ( vbaStg.get() ) + if ( vbaStg ) { oox::ole::VbaProject aVbaPrj( aCtx, pShell->GetModel(), "Calc" ); // collect names of embedded form controls, as specified in the VBA project diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 51b151a7ba08..c7d6d97ea6de 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -120,7 +120,7 @@ XclExpSstImpl::XclExpSstImpl() : sal_uInt32 XclExpSstImpl::Insert( XclExpStringRef xString ) { OSL_ENSURE( xString.get(), "XclExpSstImpl::Insert - empty pointer not allowed" ); - if( !xString.get() ) + if( !xString ) xString.reset( new XclExpString ); ++mnTotal; @@ -440,10 +440,10 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU } // text mark - if( !mxTextMark.get() && aUrlObj.HasMark() ) + if( !mxTextMark && aUrlObj.HasMark() ) mxTextMark.reset( new XclExpString( aUrlObj.GetMark(), XclStrFlags::ForceUnicode, 255 ) ); - if( mxTextMark.get() ) + if( mxTextMark ) { aXclStrm << sal_uInt32( mxTextMark->Len() + 1 ); // string length + 1 trailing zero word mxTextMark->WriteBuffer( aXclStrm ); // NO flags @@ -739,8 +739,8 @@ void XclExpCFImpl::WriteBody( XclExpStream& rStrm ) // *** formula sizes *** - sal_uInt16 nFmlaSize1 = mxTokArr1.get() ? mxTokArr1->GetSize() : 0; - sal_uInt16 nFmlaSize2 = mxTokArr2.get() ? mxTokArr2->GetSize() : 0; + sal_uInt16 nFmlaSize1 = mxTokArr1 ? mxTokArr1->GetSize() : 0; + sal_uInt16 nFmlaSize2 = mxTokArr2 ? mxTokArr2->GetSize() : 0; rStrm << nFmlaSize1 << nFmlaSize2; // *** formatting blocks *** @@ -817,9 +817,9 @@ void XclExpCFImpl::WriteBody( XclExpStream& rStrm ) // *** formulas *** - if( mxTokArr1.get() ) + if( mxTokArr1 ) mxTokArr1->WriteArray( rStrm ); - if( mxTokArr2.get() ) + if( mxTokArr2 ) mxTokArr2->WriteArray( rStrm ); } @@ -1830,7 +1830,7 @@ void XclExpDV::WriteBody( XclExpStream& rStrm ) // flags and strings rStrm << mnFlags << maPromptTitle << maErrorTitle << maPromptText << maErrorText; // condition formulas - if( mxString1.get() ) + if( mxString1 ) lclWriteDvFormula( rStrm, *mxString1 ); else lclWriteDvFormula( rStrm, mxTokArr1.get() ); @@ -2019,7 +2019,7 @@ XclExpWebQuery::~XclExpWebQuery() void XclExpWebQuery::Save( XclExpStream& rStrm ) { - OSL_ENSURE( !mbEntireDoc || !mxQryTables.get(), "XclExpWebQuery::Save - illegal mode" ); + OSL_ENSURE( !mbEntireDoc || !mxQryTables, "XclExpWebQuery::Save - illegal mode" ); sal_uInt16 nFlags; // QSI record @@ -2059,7 +2059,7 @@ void XclExpWebQuery::Save( XclExpStream& rStrm ) rStrm.EndRecord(); // WEBQRYSETTINGS record - nFlags = mxQryTables.get() ? EXC_WQSETT_SPECTABLES : EXC_WQSETT_ALL; + nFlags = mxQryTables ? EXC_WQSETT_SPECTABLES : EXC_WQSETT_ALL; rStrm.StartRecord( EXC_ID_WQSETT, 28 ); rStrm << EXC_ID_WQSETT // repeated record id ?!? << sal_uInt16( 0x0000 ) @@ -2074,7 +2074,7 @@ void XclExpWebQuery::Save( XclExpStream& rStrm ) rStrm.EndRecord(); // WEBQRYTABLES record - if( mxQryTables.get() ) + if( mxQryTables ) { rStrm.StartRecord( EXC_ID_WQTABLES, 4 + mxQryTables->GetSize() ); rStrm << EXC_ID_WQTABLES // repeated record id ?!? diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index cd01aaeb2b23..66525e1d0a43 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -568,7 +568,7 @@ const XclExpCompConfig* XclExpFmlaCompImpl::GetConfigForType( XclFormulaType eTy void XclExpFmlaCompImpl::Init( XclFormulaType eType ) { // compiler invoked recursively? - store old working data - if( mxData.get() ) + if( mxData ) maDataStack.push_back( mxData ); // new compiler working data structure mxData = std::make_shared( GetConfigForType( eType ) ); @@ -2159,7 +2159,7 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpScToken& rTokData ) sal_uInt16 nFileId = rTokData.mpScToken->GetIndex(); OUString aName = rTokData.mpScToken->GetString().getString(); ScExternalRefCache::TokenArrayRef xArray = rExtRefMgr.getRangeNameTokens( nFileId, aName ); - if( xArray.get() ) + if( xArray ) { // store external cell contents in CRN records if( mxData->mpScBasePos ) @@ -2518,7 +2518,7 @@ void XclExpFmlaCompImpl::InsertZeros( sal_uInt16 nInsertPos, sal_uInt16 nInsertS if( nInsertPos < mxData->maOpListVec.size() ) mxData->maOpListVec.insert( mxData->maOpListVec.begin() + nInsertPos, nInsertSize, XclExpOperandListRef() ); for( auto& rxOpList : mxData->maOpListVec ) - if( rxOpList.get() ) + if( rxOpList ) for( auto& rOp : *rxOpList ) if( nInsertPos <= rOp.mnTokPos ) rOp.mnTokPos += nInsertSize; diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index e3efd87072f8..42375c20d46f 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1912,7 +1912,7 @@ void XclExpSupbookBuffer::StoreCellRange( sal_uInt16 nFileId, const OUString& rT // This is a new'ed instance, so we must manage its life cycle here. ScExternalRefCache::TokenArrayRef pArray = pRefMgr->getDoubleRefTokens(nFileId, rTabName, rRange, nullptr); - if (!pArray.get()) + if (!pArray) return; FormulaTokenArrayPlainIterator aIter(*pArray); diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index e2160048b597..8e1c6aecd196 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -473,11 +473,11 @@ void XclImpHFConverter::ParseString( const OUString& rHFString ) void XclImpHFConverter::FillToItemSet( SfxItemSet& rItemSet, sal_uInt16 nWhichId ) const { ScPageHFItem aHFItem( nWhichId ); - if( maInfos[ EXC_HF_LEFT ].mxObj.get() ) + if( maInfos[ EXC_HF_LEFT ].mxObj ) aHFItem.SetLeftArea( *maInfos[ EXC_HF_LEFT ].mxObj ); - if( maInfos[ EXC_HF_CENTER ].mxObj.get() ) + if( maInfos[ EXC_HF_CENTER ].mxObj ) aHFItem.SetCenterArea( *maInfos[ EXC_HF_CENTER ].mxObj ); - if( maInfos[ EXC_HF_RIGHT ].mxObj.get() ) + if( maInfos[ EXC_HF_RIGHT ].mxObj ) aHFItem.SetRightArea( *maInfos[ EXC_HF_RIGHT ].mxObj ); rItemSet.Put( aHFItem ); } @@ -575,7 +575,7 @@ void XclImpHFConverter::SetNewPortion( XclImpHFPortion eNew ) { CreateCurrObject(); meCurrObj = eNew; - if( GetCurrObj().get() ) + if( GetCurrObj() ) mrEE.SetText( *GetCurrObj() ); else mrEE.SetText( EMPTY_OUSTRING ); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 436e00e3b911..a5e248be1214 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1986,7 +1986,7 @@ void XclImpXFRangeBuffer::Finalize() for( const auto& rxColumn : maColumns ) { // apply all cell styles of an existing column - if( rxColumn.get() ) + if( rxColumn ) { XclImpXFRangeColumn& rColumn = *rxColumn; std::vector aAttrs; diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index a4c48663aa94..448fafaaad1e 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -357,7 +357,7 @@ DateTime XclRoot::GetDateTimeFromDouble( double fValue ) const ScEditEngineDefaulter& XclRoot::GetEditEngine() const { - if( !mrData.mxEditEngine.get() ) + if( !mrData.mxEditEngine ) { mrData.mxEditEngine = std::make_shared( GetDoc().GetEnginePool() ); ScEditEngineDefaulter& rEE = *mrData.mxEditEngine; @@ -372,7 +372,7 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const ScHeaderEditEngine& XclRoot::GetHFEditEngine() const { - if( !mrData.mxHFEditEngine.get() ) + if( !mrData.mxHFEditEngine ) { mrData.mxHFEditEngine = std::make_shared( EditEngine::CreatePool() ); ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine; @@ -396,7 +396,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const EditEngine& XclRoot::GetDrawEditEngine() const { - if( !mrData.mxDrawEditEng.get() ) + if( !mrData.mxDrawEditEng ) { mrData.mxDrawEditEng = std::make_shared( &GetDoc().GetDrawLayer()->GetItemPool() ); EditEngine& rEE = *mrData.mxDrawEditEng; diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx index a676dd5c0429..87f22f630843 100644 --- a/sc/source/filter/excel/xltoolbar.cxx +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -252,7 +252,7 @@ bool ScTBC::ImportToolBarControl( ScCTBWrapper& rWrapper, const css::uno::Refere { // how to identify built-in-command ? // bool bBuiltin = false; - if ( tbcd.get() ) + if ( tbcd ) { std::vector< css::beans::PropertyValue > props; bool bBeginGroup = false; diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx index b289d3b00553..8e77d935d9a2 100644 --- a/sc/source/filter/oox/autofilterbuffer.cxx +++ b/sc/source/filter/oox/autofilterbuffer.cxx @@ -518,7 +518,7 @@ void FilterColumn::importFilterColumn( SequenceInputStream& rStrm ) ApiFilterSettings FilterColumn::finalizeImport( sal_Int32 nMaxCount ) { ApiFilterSettings aSettings; - if( (0 <= mnColId) && mxSettings.get() ) + if( (0 <= mnColId) && mxSettings ) { // filter settings object creates a sequence of filter fields aSettings = mxSettings->finalizeImport( nMaxCount ); @@ -683,7 +683,7 @@ void AutoFilterBuffer::finalizeImport( sal_Int16 nSheet ) // position of output data (if built-in defined name 'Extract' exists) DefinedNameRef xExtractName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_EXTRACT, nSheet ); ScRange aOutputRange; - bool bHasOutputRange = xExtractName.get() && xExtractName->getAbsoluteRange( aOutputRange ); + bool bHasOutputRange = xExtractName && xExtractName->getAbsoluteRange( aOutputRange ); aDescProps.setProperty( PROP_CopyOutputData, bHasOutputRange ); if( bHasOutputRange ) { diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx index f33284ac3675..3a85f8a6482f 100644 --- a/sc/source/filter/oox/commentsbuffer.cxx +++ b/sc/source/filter/oox/commentsbuffer.cxx @@ -157,7 +157,7 @@ void Comment::finalizeImport() // BIFF12 stores cell range instead of cell address, use first cell of this range OSL_ENSURE( maModel.maRange.aStart == maModel.maRange.aEnd, "Comment::finalizeImport - comment anchor should be a single cell" ); - if( !getAddressConverter().checkCellAddress( maModel.maRange.aStart, true ) || !maModel.mxText.get() ) + if( !getAddressConverter().checkCellAddress( maModel.maRange.aStart, true ) || !maModel.mxText ) return; try diff --git a/sc/source/filter/oox/commentsfragment.cxx b/sc/source/filter/oox/commentsfragment.cxx index fd4a4e34050c..0d6a8b27a870 100644 --- a/sc/source/filter/oox/commentsfragment.cxx +++ b/sc/source/filter/oox/commentsfragment.cxx @@ -61,7 +61,7 @@ ContextHandlerRef CommentsFragment::onCreateContext( sal_Int32 nElement, const A case XDR_TOKEN( to ): return this; case XLS_TOKEN( comment ): - if( (nElement == XLS_TOKEN( text )) && mxComment.get() ) + if( (nElement == XLS_TOKEN( text )) && mxComment ) return new RichStringContext( *this, mxComment->createText() ); if( nElement == XLS_TOKEN( commentPr ) ) { mxComment->importCommentPr( rAttribs ); return this; } break; @@ -99,7 +99,7 @@ ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, Seq if( nRecId == BIFF12_ID_COMMENT ) { importComment( rStrm ); return this; } break; case BIFF12_ID_COMMENT: - if( (nRecId == BIFF12_ID_COMMENTTEXT) && mxComment.get() ) + if( (nRecId == BIFF12_ID_COMMENTTEXT) && mxComment ) mxComment->createText()->importString( rStrm, true ); break; } diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 22b5fbde9303..76369bccbeb0 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1070,7 +1070,7 @@ CondFormatRuleRef CondFormat::createRule() void CondFormat::insertRule( CondFormatRuleRef const & xRule ) { - if( xRule.get() && (xRule->getPriority() > 0) ) + if( xRule && (xRule->getPriority() > 0) ) { OSL_ENSURE( maRules.find( xRule->getPriority() ) == maRules.end(), "CondFormat::insertRule - multiple rules with equal priority" ); maRules[ xRule->getPriority() ] = xRule; @@ -1164,12 +1164,12 @@ void CondFormatBuffer::finalizeImport() for( const auto& rxCondFormat : maCondFormats ) { - if ( rxCondFormat.get()) + if ( rxCondFormat) rxCondFormat->finalizeImport(); } for ( const auto& rxCfRule : maCfRules ) { - if ( rxCfRule.get() ) + if ( rxCfRule ) rxCfRule->finalizeImport(); } diff --git a/sc/source/filter/oox/condformatcontext.cxx b/sc/source/filter/oox/condformatcontext.cxx index 5b7e624aa18a..9c9a47065bac 100644 --- a/sc/source/filter/oox/condformatcontext.cxx +++ b/sc/source/filter/oox/condformatcontext.cxx @@ -198,7 +198,7 @@ void CondFormatContext::onEndElement() switch( getCurrentElement() ) { case XLS_TOKEN( conditionalFormatting ): - if(mxCondFmt.get()) + if(mxCondFmt) mxCondFmt->setReadyForFinalize(); break; } @@ -212,14 +212,14 @@ void CondFormatContext::onStartElement( const AttributeList& rAttribs ) mxCondFmt = getCondFormats().importConditionalFormatting( rAttribs ); break; case XLS_TOKEN( cfRule ): - if( mxCondFmt.get() ) mxRule = mxCondFmt->importCfRule( rAttribs ); + if( mxCondFmt ) mxRule = mxCondFmt->importCfRule( rAttribs ); break; } } void CondFormatContext::onCharacters( const OUString& rChars ) { - if( isCurrentElement( XLS_TOKEN( formula ) ) && mxCondFmt.get() && mxRule.get() ) + if( isCurrentElement( XLS_TOKEN( formula ) ) && mxCondFmt && mxRule ) mxRule->appendFormula( rChars ); } @@ -241,7 +241,7 @@ void CondFormatContext::onStartRecord( SequenceInputStream& rStrm ) mxCondFmt = getCondFormats().importCondFormatting( rStrm ); break; case BIFF12_ID_CFRULE: - if( mxCondFmt.get() ) mxCondFmt->importCfRule( rStrm ); + if( mxCondFmt ) mxCondFmt->importCfRule( rStrm ); break; } } @@ -251,7 +251,7 @@ void CondFormatContext::onEndRecord() switch( getCurrentElement() ) { case BIFF12_ID_CONDFORMATTING: - if( mxCondFmt.get() ) + if( mxCondFmt ) { mxCondFmt->setReadyForFinalize(); } diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 800d52ef769c..9c440d76c0f8 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -255,7 +255,7 @@ void DrawingFragment::onEndElement() case XDR_TOKEN( absoluteAnchor ): case XDR_TOKEN( oneCellAnchor ): case XDR_TOKEN( twoCellAnchor ): - if( mxDrawPage.is() && mxShape.get() && mxAnchor ) + if( mxDrawPage.is() && mxShape && mxAnchor ) { // Rotation is decided by orientation of shape determined // by the anchor position given by 'editAs="oneCell"' diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 17d5325e52af..4c59a0e9393b 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -106,7 +106,7 @@ bool ExcelFilter::importDocument() the class WorkbookHelper, and execute the import filter by constructing an instance of WorkbookFragment and loading the file. */ WorkbookGlobalsRef xBookGlob(WorkbookHelper::constructGlobals(*this)); - if (xBookGlob.get()) + if (xBookGlob) { rtl::Reference xWorkbookFragment( new WorkbookFragment(*xBookGlob, aWorkbookPath)); bool bRet = importFragment( xWorkbookFragment); diff --git a/sc/source/filter/oox/externallinkfragment.cxx b/sc/source/filter/oox/externallinkfragment.cxx index bcc51246c265..eddc0c607cbd 100644 --- a/sc/source/filter/oox/externallinkfragment.cxx +++ b/sc/source/filter/oox/externallinkfragment.cxx @@ -213,7 +213,7 @@ ContextHandlerRef ExternalLinkFragment::onCreateContext( sal_Int32 nElement, con case XLS_TOKEN( ddeItem ): if( nElement == XLS_TOKEN( values ) ) { - if( mxExtName.get() ) mxExtName->importValues( rAttribs ); + if( mxExtName ) mxExtName->importValues( rAttribs ); return this; } break; @@ -246,7 +246,7 @@ void ExternalLinkFragment::onCharacters( const OUString& rChars ) void ExternalLinkFragment::onEndElement() { - if( isCurrentElement( XLS_TOKEN( value ) ) && mxExtName.get() ) switch( mnResultType ) + if( isCurrentElement( XLS_TOKEN( value ) ) && mxExtName ) switch( mnResultType ) { case XML_b: mxExtName->appendResultValue( maResultValue.toDouble() ); @@ -293,18 +293,18 @@ ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, case BIFF12_ID_EXTERNALNAME: switch( nRecId ) { - case BIFF12_ID_EXTERNALNAMEFLAGS: if( mxExtName.get() ) mxExtName->importExternalNameFlags( rStrm ); break; - case BIFF12_ID_DDEITEMVALUES: if( mxExtName.get() ) mxExtName->importDdeItemValues( rStrm ); return this; + case BIFF12_ID_EXTERNALNAMEFLAGS: if( mxExtName ) mxExtName->importExternalNameFlags( rStrm ); break; + case BIFF12_ID_DDEITEMVALUES: if( mxExtName ) mxExtName->importDdeItemValues( rStrm ); return this; } break; case BIFF12_ID_DDEITEMVALUES: switch( nRecId ) { - case BIFF12_ID_DDEITEM_BOOL: if( mxExtName.get() ) mxExtName->importDdeItemBool( rStrm ); break; - case BIFF12_ID_DDEITEM_DOUBLE: if( mxExtName.get() ) mxExtName->importDdeItemDouble( rStrm ); break; - case BIFF12_ID_DDEITEM_ERROR: if( mxExtName.get() ) mxExtName->importDdeItemError( rStrm ); break; - case BIFF12_ID_DDEITEM_STRING: if( mxExtName.get() ) mxExtName->importDdeItemString( rStrm ); break; + case BIFF12_ID_DDEITEM_BOOL: if( mxExtName ) mxExtName->importDdeItemBool( rStrm ); break; + case BIFF12_ID_DDEITEM_DOUBLE: if( mxExtName ) mxExtName->importDdeItemDouble( rStrm ); break; + case BIFF12_ID_DDEITEM_ERROR: if( mxExtName ) mxExtName->importDdeItemError( rStrm ); break; + case BIFF12_ID_DDEITEM_STRING: if( mxExtName ) mxExtName->importDdeItemString( rStrm ); break; } break; } diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index 51974233f847..4ade10d2e706 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -964,7 +964,7 @@ bool FormulaParserImpl::pushDdeLinkOperand( const OUString& rDdeServer, const OU bool FormulaParserImpl::pushExternalNameOperand( const ExternalNameRef& rxExtName, const ExternalLink& rExtLink ) { - if( rxExtName.get() ) switch( rExtLink.getLinkType() ) + if( rxExtName ) switch( rExtLink.getLinkType() ) { case ExternalLinkType::External: return pushEmbeddedRefOperand( *rxExtName, false ); @@ -1419,7 +1419,7 @@ bool OoxFormulaParserImpl::importTableToken( SequenceInputStream& rStrm ) nCol1 = rStrm.readuInt16(); nCol2 = rStrm.readuInt16(); TableRef xTable = getTables().getTable( nTableId ); - sal_Int32 nTokenIndex = xTable.get() ? xTable->getTokenIndex() : -1; + sal_Int32 nTokenIndex = xTable ? xTable->getTokenIndex() : -1; if( nTokenIndex >= 0 ) { sal_Int32 nWidth = xTable->getWidth(); diff --git a/sc/source/filter/oox/pivotcachefragment.cxx b/sc/source/filter/oox/pivotcachefragment.cxx index c60a383ab9fa..1b7e2d36b090 100644 --- a/sc/source/filter/oox/pivotcachefragment.cxx +++ b/sc/source/filter/oox/pivotcachefragment.cxx @@ -196,7 +196,7 @@ void PivotCacheDefinitionFragment::finalizeImport() { SCTAB nSheet = mrPivotCache.getSourceRange().aStart.Tab(); WorksheetGlobalsRef xSheetGlob = WorksheetHelper::constructGlobals( *this, ISegmentProgressBarRef(), WorksheetType::Work, nSheet ); - if( xSheetGlob.get() ) + if( xSheetGlob ) importOoxFragment( new PivotCacheRecordsFragment( *xSheetGlob, aRecFragmentPath, mrPivotCache ) ); } } diff --git a/sc/source/filter/oox/querytablebuffer.cxx b/sc/source/filter/oox/querytablebuffer.cxx index d587349105ef..3e82ae71c028 100644 --- a/sc/source/filter/oox/querytablebuffer.cxx +++ b/sc/source/filter/oox/querytablebuffer.cxx @@ -214,7 +214,7 @@ void QueryTable::finalizeImport() { ConnectionRef xConnection = getConnections().getConnection( maModel.mnConnId ); OSL_ENSURE( xConnection.get(), "QueryTable::finalizeImport - missing connection object" ); - if( xConnection.get() && (xConnection->getConnectionType() == BIFF12_CONNECTION_HTML) ) + if( xConnection && (xConnection->getConnectionType() == BIFF12_CONNECTION_HTML) ) { // check that valid web query properties exist const WebPrModel* pWebPr = xConnection->getModel().mxWebPr.get(); @@ -227,7 +227,7 @@ void QueryTable::finalizeImport() OUString aDefName = maModel.maDefName.replace( ' ', '_' ).replace( '-', '_' ); DefinedNameRef xDefName = getDefinedNames().getByModelName( aDefName, getSheetIndex() ); OSL_ENSURE( xDefName.get(), "QueryTable::finalizeImport - missing defined name" ); - if( xDefName.get() ) + if( xDefName ) { ScRange aDestRange; bool bIsRange = xDefName->getAbsoluteRange( aDestRange ) && (aDestRange.aStart.Tab() == getSheetIndex()); diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx index 848ac6917c25..c2ea6afe3120 100644 --- a/sc/source/filter/oox/richstring.cxx +++ b/sc/source/filter/oox/richstring.cxx @@ -75,7 +75,7 @@ void RichStringPortion::setFontId( sal_Int32 nFontId ) void RichStringPortion::finalizeImport() { - if( mxFont.get() ) + if( mxFont ) mxFont->finalizeImport(); else if( mnFontId >= 0 ) mxFont = getStyles().getFont( mnFontId ); @@ -96,7 +96,7 @@ void RichStringPortion::convert( const Reference< XText >& rxText, bool bReplace if( xRange.is() ) { xRange->setString( maText ); - if( mxFont.get() ) + if( mxFont ) { PropertySet aPropSet( xRange ); mxFont->writeToPropertySet( aPropSet ); @@ -112,7 +112,7 @@ void RichStringPortion::convert( ScEditEngineDefaulter& rEE, ESelection& rSelect rSelection.nStartPara = rSelection.nEndPara; SfxItemSet aItemSet( rEE.GetEmptyItemSet() ); - const Font* pFontToUse = mxFont.get() ? mxFont.get() : lclNeedsRichTextFormat( pFont ) ? pFont : nullptr; + const Font* pFontToUse = mxFont ? mxFont.get() : lclNeedsRichTextFormat( pFont ) ? pFont : nullptr; if ( pFontToUse ) pFontToUse->fillToItemSet( aItemSet, true ); @@ -145,7 +145,7 @@ void RichStringPortion::writeFontProperties( const Reference& rxText ) co { PropertySet aPropSet(rxText); - if (mxFont.get()) + if (mxFont) mxFont->writeToPropertySet(aPropSet); } diff --git a/sc/source/filter/oox/richstringcontext.cxx b/sc/source/filter/oox/richstringcontext.cxx index 36cd1a165dea..e7c3fd618bed 100644 --- a/sc/source/filter/oox/richstringcontext.cxx +++ b/sc/source/filter/oox/richstringcontext.cxx @@ -52,7 +52,7 @@ ContextHandlerRef RichStringContext::onCreateContext( sal_Int32 nElement, const switch( nElement ) { case XLS_TOKEN( rPr ): - if( mxPortion.get() ) + if( mxPortion ) return new FontContext( *this, mxPortion->createFont() ); break; @@ -77,11 +77,11 @@ void RichStringContext::onCharacters( const OUString& rChars ) if( isCurrentElement( XLS_TOKEN( t ) ) ) switch( getParentElement() ) { case XLS_TOKEN( rPh ): - if( mxPhonetic.get() ) + if( mxPhonetic ) mxPhonetic->setText( rChars ); break; default: - if( mxPortion.get() ) + if( mxPortion ) mxPortion->setText( rChars ); } } diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index d6757af4df91..7c3264c18dc7 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -158,7 +158,7 @@ void SheetDataBuffer::setStringCell( const CellModel& rModel, const RichStringRe void SheetDataBuffer::setStringCell( const CellModel& rModel, sal_Int32 nStringId ) { RichStringRef xString = getSharedStrings().getString( nStringId ); - if( xString.get() ) + if( xString ) setStringCell( rModel, xString ); else setBlankCell( rModel ); diff --git a/sc/source/filter/oox/sheetdatacontext.cxx b/sc/source/filter/oox/sheetdatacontext.cxx index 7ca914e6ad4b..242192f67350 100644 --- a/sc/source/filter/oox/sheetdatacontext.cxx +++ b/sc/source/filter/oox/sheetdatacontext.cxx @@ -196,7 +196,7 @@ void SheetDataContext::onEndElement() mrSheetData.setDateCell( maCellData, maCellValue ); break; } - else if( (maCellData.mnCellType == XML_inlineStr) && mxInlineStr.get() ) + else if( (maCellData.mnCellType == XML_inlineStr) && mxInlineStr ) { mxInlineStr->finalizeImport(); mrSheetData.setStringCell( maCellData, mxInlineStr ); diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 0895f87a2f98..cd1515914663 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -1713,7 +1713,7 @@ void Fill::importPatternFill( const AttributeList& rAttribs ) void Fill::importFgColor( const AttributeList& rAttribs ) { OSL_ENSURE( mxPatternModel.get(), "Fill::importFgColor - missing pattern data" ); - if( mxPatternModel.get() ) + if( mxPatternModel ) { mxPatternModel->maPatternColor.importColor( rAttribs ); mxPatternModel->mbPattColorUsed = true; @@ -1723,7 +1723,7 @@ void Fill::importFgColor( const AttributeList& rAttribs ) void Fill::importBgColor( const AttributeList& rAttribs ) { OSL_ENSURE( mxPatternModel.get(), "Fill::importBgColor - missing pattern data" ); - if( mxPatternModel.get() ) + if( mxPatternModel ) { mxPatternModel->maFillColor.importColor( rAttribs ); mxPatternModel->mbFillColorUsed = true; @@ -1744,7 +1744,7 @@ void Fill::importGradientFill( const AttributeList& rAttribs ) void Fill::importColor( const AttributeList& rAttribs, double fPosition ) { OSL_ENSURE( mxGradientModel.get(), "Fill::importColor - missing gradient data" ); - if( mxGradientModel.get() && (fPosition >= 0.0) ) + if( mxGradientModel && (fPosition >= 0.0) ) mxGradientModel->maColors[ fPosition ].importColor( rAttribs ); } @@ -1817,7 +1817,7 @@ void Fill::finalizeImport() { const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper(); - if( mxPatternModel.get() ) + if( mxPatternModel ) { // finalize the OOXML data struct PatternFillModel& rModel = *mxPatternModel; @@ -1882,7 +1882,7 @@ void Fill::finalizeImport() maApiData.mbTransparent = false; } } - else if( mxGradientModel.get() && !mxGradientModel->maColors.empty() ) + else if( mxGradientModel && !mxGradientModel->maColors.empty() ) { GradientFillModel& rModel = *mxGradientModel; maApiData.mbUsed = true; // no support for differential attributes @@ -2301,11 +2301,11 @@ void Dxf::importDxf( SequenceInputStream& rStrm ) void Dxf::finalizeImport() { - if( mxFont.get() ) + if( mxFont ) mxFont->finalizeImport(); bool bRTL = false; // number format already finalized by the number formats buffer - if( mxAlignment.get() ) + if( mxAlignment ) { mxAlignment->finalizeImport(); // how do we detect RTL when text dir is OOX_XF_CONTEXT? ( seems you @@ -2313,13 +2313,13 @@ void Dxf::finalizeImport() if ( mxAlignment->getModel().mnTextDir == OOX_XF_TEXTDIR_RTL ) bRTL = true; } - if( mxProtection.get() ) + if( mxProtection ) mxProtection->finalizeImport(); - if( mxBorder.get() ) + if( mxBorder ) { mxBorder->finalizeImport( bRTL ); } - if( mxFill.get() ) + if( mxFill ) mxFill->finalizeImport(); } @@ -2623,7 +2623,7 @@ void CellStyleBuffer::finalizeImport() sal_Int32 CellStyleBuffer::getDefaultXfId() const { - return mxDefStyle.get() ? mxDefStyle->getModel().mnXfId : -1; + return mxDefStyle ? mxDefStyle->getModel().mnXfId : -1; } OUString CellStyleBuffer::getDefaultStyleName() const @@ -2664,14 +2664,14 @@ void CellStyleBuffer::insertCellStyle( CellStyleRef const & xCellStyle ) ::ScStyleSheet* CellStyleBuffer::getCellStyleSheet( const CellStyleRef& rxCellStyle ) { ::ScStyleSheet* pStyleSheet = nullptr; - if ( rxCellStyle.get() ) + if ( rxCellStyle ) pStyleSheet = rxCellStyle->getStyleSheet(); return pStyleSheet; } OUString CellStyleBuffer::createCellStyle( const CellStyleRef& rxCellStyle ) { - if( rxCellStyle.get() ) + if( rxCellStyle ) { rxCellStyle->createCellStyle(); const OUString& rStyleName = rxCellStyle->getFinalStyleName(); @@ -2860,7 +2860,7 @@ FontRef StylesBuffer::getDefaultFont() const const FontModel& StylesBuffer::getDefaultFontModel() const { FontRef xDefFont = getDefaultFont(); - return xDefFont.get() ? xDefFont->getModel() : getTheme().getDefaultFontModel(); + return xDefFont ? xDefFont->getModel() : getTheme().getDefaultFontModel(); } bool StylesBuffer::equalBorders( sal_Int32 nBorderId1, sal_Int32 nBorderId2 ) diff --git a/sc/source/filter/oox/stylesfragment.cxx b/sc/source/filter/oox/stylesfragment.cxx index a6188072b4d8..e6707704dc44 100644 --- a/sc/source/filter/oox/stylesfragment.cxx +++ b/sc/source/filter/oox/stylesfragment.cxx @@ -57,20 +57,20 @@ ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, ContextHandlerRef FontContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - if( mxFont.get() ) + if( mxFont ) mxFont->importAttribs( nElement, rAttribs ); return nullptr; } void BorderContext::onStartElement( const AttributeList& rAttribs ) { - if( mxBorder.get() && (getCurrentElement() == XLS_TOKEN( border )) ) + if( mxBorder && (getCurrentElement() == XLS_TOKEN( border )) ) mxBorder->importBorder( rAttribs ); } ContextHandlerRef BorderContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - if( mxBorder.get() ) switch( getCurrentElement() ) + if( mxBorder ) switch( getCurrentElement() ) { case XLS_TOKEN( border ): mxBorder->importStyle( nElement, rAttribs ); @@ -85,7 +85,7 @@ ContextHandlerRef BorderContext::onCreateContext( sal_Int32 nElement, const Attr ContextHandlerRef FillContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - if( mxFill.get() ) switch( getCurrentElement() ) + if( mxFill ) switch( getCurrentElement() ) { case XLS_TOKEN( fill ): switch( nElement ) @@ -118,13 +118,13 @@ ContextHandlerRef FillContext::onCreateContext( sal_Int32 nElement, const Attrib void XfContext::onStartElement( const AttributeList& rAttribs ) { - if( mxXf.get() && (getCurrentElement() == XLS_TOKEN( xf )) ) + if( mxXf && (getCurrentElement() == XLS_TOKEN( xf )) ) mxXf->importXf( rAttribs, mbCellXf ); } ContextHandlerRef XfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - if( mxXf.get() ) switch( getCurrentElement() ) + if( mxXf ) switch( getCurrentElement() ) { case XLS_TOKEN( xf ): switch( nElement ) @@ -139,7 +139,7 @@ ContextHandlerRef XfContext::onCreateContext( sal_Int32 nElement, const Attribut ContextHandlerRef DxfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - if( mxDxf.get() ) switch( getCurrentElement() ) + if( mxDxf ) switch( getCurrentElement() ) { case XLS_TOKEN( dxf ): switch( nElement ) @@ -157,7 +157,7 @@ ContextHandlerRef DxfContext::onCreateContext( sal_Int32 nElement, const Attribu break; } - if( mxExtDxf.get() ) switch( getCurrentElement() ) + if( mxExtDxf ) switch( getCurrentElement() ) { case XLS14_TOKEN( dxf ): switch( nElement ) diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 7bcada3bdf08..969a0a6c29ec 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -141,7 +141,7 @@ ContextHandlerRef WorkbookFragment::onCreateContext( sal_Int32 nElement, const A void WorkbookFragment::onCharacters( const OUString& rChars ) { - if( isCurrentElement( XLS_TOKEN( definedName ) ) && mxCurrName.get() ) + if( isCurrentElement( XLS_TOKEN( definedName ) ) && mxCurrName ) mxCurrName->setFormula( rChars ); } @@ -422,7 +422,7 @@ void WorkbookFragment::finalizeImport() // create the WorksheetGlobals object WorksheetGlobalsRef xSheetGlob = WorksheetHelper::constructGlobals( *this, xSheetSegment, eSheetType, nCalcSheet ); OSL_ENSURE( xSheetGlob.get(), "WorkbookFragment::finalizeImport - missing sheet in document" ); - if( xSheetGlob.get() ) + if( xSheetGlob ) { // create the sheet fragment handler ::rtl::Reference< WorksheetFragmentBase > xFragment; diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 2223d3cb692b..892e2e1bd2d2 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -688,7 +688,7 @@ void WorkbookHelper::finalizeWorkbookImport() // contains the workbook code name). Do it before processing formulas in // order to correctly resolve VBA custom function names. StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage(); - if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() ) + if( xVbaPrjStrg && xVbaPrjStrg->isStorage() ) getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); // need to import formulas before scenarios diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index aa00eadf7d60..5fc46ecbfd30 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -89,7 +89,7 @@ namespace { void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, double fPosition ) { - if( rxProgressBar.get() ) + if( rxProgressBar ) rxProgressBar->setPosition( fPosition ); } @@ -433,7 +433,7 @@ WorksheetGlobals::WorksheetGlobals( const WorkbookHelper& rHelper, const ISegmen mxVmlDrawing.reset( new VmlDrawing( *this ) ); // prepare progress bars - if( mxProgressBar.get() ) + if( mxProgressBar ) { mxRowProgress = mxProgressBar->createSegment( 0.5 ); mxFinalProgress = mxProgressBar->createSegment( 0.5 ); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index bbadc34397f9..a338a2d861c5 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4801,7 +4801,7 @@ void ScXMLExport::WriteExternalRefCaches() for (const auto& rTabName : aTabNames) { ScExternalRefCache::TableTypeRef pTable = pRefMgr->getCacheTable(nFileId, rTabName, false); - if (!pTable.get() || !pTable->isReferenced()) + if (!pTable || !pTable->isReferenced()) continue; AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, "'" + *pUrl + "'#" + rTabName); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index cc3933eaa34f..9b90a5cbea36 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -526,7 +526,7 @@ ScExternalRefCache::TokenRef ScExternalRefCache::getCellData( } const TableTypeRef& pTableData = rDoc.maTables[itrTabId->second]; - if (!pTableData.get()) + if (!pTableData) { // the table data is not instantiated yet. return TokenRef(); @@ -579,7 +579,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData( for (size_t nTab = nTabFirstId; nTab <= nTabLastId; ++nTab) { TableTypeRef pTab = rDoc.maTables[nTab]; - if (!pTab.get()) + if (!pTab) return TokenArrayRef(); SCCOL nDataCol1 = nCol1, nDataCol2 = nCol2; @@ -781,7 +781,7 @@ void ScExternalRefCache::setCellData(sal_uInt16 nFileId, const OUString& rTabNam return; TableTypeRef& pTableData = rDoc.maTables[itrTabName->second]; - if (!pTableData.get()) + if (!pTableData) pTableData = std::make_shared(); pTableData->setCell(nCol, nRow, pToken, nFmtIndex); @@ -819,7 +819,7 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa for (const auto& rItem : rData) { TableTypeRef& pTabData = rDoc.maTables[i]; - if (!pTabData.get()) + if (!pTabData) pTabData = std::make_shared
(); const ScMatrixRef& pMat = rItem.mpRangeData; @@ -1107,7 +1107,7 @@ bool ScExternalRefCache::setCacheDocReferenced( sal_uInt16 nFileId ) for (auto& rxTab : pDocItem->maTables) { - if (rxTab.get()) + if (rxTab) rxTab->setReferenced(true); } addCacheDocToReferenced( nFileId); @@ -1126,7 +1126,7 @@ bool ScExternalRefCache::setCacheTableReferenced( sal_uInt16 nFileId, const OUSt for (size_t i = nIndex; i < nStop; ++i) { TableTypeRef pTab = pDoc->maTables[i]; - if (pTab.get()) + if (pTab) { if (!pTab->isReferenced()) { @@ -1152,7 +1152,7 @@ void ScExternalRefCache::setAllCacheTableReferencedStati( bool bReferenced ) ScExternalRefCache::DocItem& rDocItem = rEntry.second; for (auto& rxTab : rDocItem.maTables) { - if (rxTab.get()) + if (rxTab) rxTab->setReferenced(true); } } @@ -1175,7 +1175,7 @@ void ScExternalRefCache::setAllCacheTableReferencedStati( bool bReferenced ) for (size_t i=0; i < nTables; ++i) { TableTypeRef & xTab = rDocItem.maTables[i]; - if (xTab.get()) + if (xTab) { xTab->setReferenced(false); rDocReferenced.maTables[i] = false; @@ -2041,7 +2041,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens( } ScExternalRefCache::TokenArrayRef pArray = maRefCache.getRangeNameTokens(nFileId, rName); - if (pArray.get()) + if (pArray) // This range name is cached. return pArray; diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index 6c836bb822be..f422915a26a2 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -100,7 +100,7 @@ void ScRetypePassDlg::SetDesiredHash(ScPasswordHash eHash) void ScRetypePassDlg::WriteNewDataToDocument(ScDocument& rDoc) const { - if (mpDocItem.get()) + if (mpDocItem) rDoc.SetDocProtection(mpDocItem.get()); size_t nTabCount = static_cast(rDoc.GetTableCount()); @@ -141,7 +141,7 @@ void ScRetypePassDlg::PopulateDialog() void ScRetypePassDlg::SetDocData() { bool bBtnEnabled = false; - if (mpDocItem.get() && mpDocItem->isProtected()) + if (mpDocItem && mpDocItem->isProtected()) { if (mpDocItem->isPasswordEmpty()) mxTextDocStatus->set_label(maTextNotPassProtected); diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 3b3ca6b9cf0d..964ad6732f1d 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -735,7 +735,7 @@ ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rP mpDrawUndo( std::move(pDrawUndo) ) { OSL_ENSURE( maOldData.mxCaption || maNewData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" ); - OSL_ENSURE( !maOldData.mxInitData.get() && !maNewData.mxInitData.get(), "ScUndoReplaceNote::ScUndoReplaceNote - unexpected uninitialized note" ); + OSL_ENSURE( !maOldData.mxInitData && !maNewData.mxInitData, "ScUndoReplaceNote::ScUndoReplaceNote - unexpected uninitialized note" ); maOldData.mxCaption.setNotOwner(); maNewData.mxCaption.setNotOwner(); } diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index a71e8bb2e351..25bd94957236 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -100,7 +100,7 @@ void ScFormulaParserObj::SetCompilerFlags( ScCompiler& rCompiler ) const // If mxOpCodeMap is not empty it overrides mbEnglish, and vice versa. We // don't need to initialize things twice. - if (mxOpCodeMap.get()) + if (mxOpCodeMap) rCompiler.SetFormulaLanguage( mxOpCodeMap ); else { @@ -195,7 +195,7 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue( // Need to recreate the symbol map to change English property // because the map is const. So for performance reasons set // CompileEnglish _before_ OpCodeMap! - if (mxOpCodeMap.get() && mbEnglish != bOldEnglish) + if (mxOpCodeMap && mbEnglish != bOldEnglish) { ScDocument& rDoc = mpDocShell->GetDocument(); ScCompiler aCompiler( &rDoc, ScAddress(), rDoc.GetGrammar()); diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 2004b88564f8..1c6456d60c76 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1667,7 +1667,7 @@ CustomAnimationEffectPtr EffectSequenceHelper::append( const CustomAnimationPres { CustomAnimationEffectPtr pEffect; - if( pPreset.get() ) + if( pPreset ) { Reference< XAnimationNode > xNode( pPreset->create( "" ) ); if( xNode.is() ) @@ -1771,7 +1771,7 @@ CustomAnimationEffectPtr EffectSequenceHelper::append( const SdrPathObj& rPathOb void EffectSequenceHelper::replace( const CustomAnimationEffectPtr& pEffect, const CustomAnimationPresetPtr& pPreset, const OUString& rPresetSubType, double fDuration /* = -1.0 */ ) { - if( !(pEffect.get() && pPreset.get()) ) + if( !(pEffect && pPreset) ) return; try @@ -1799,7 +1799,7 @@ void EffectSequenceHelper::replace( const CustomAnimationEffectPtr& pEffect, con void EffectSequenceHelper::remove( const CustomAnimationEffectPtr& pEffect ) { - if( pEffect.get() ) + if( pEffect ) { pEffect->setEffectSequence( nullptr ); maEffects.remove( pEffect ); @@ -1810,7 +1810,7 @@ void EffectSequenceHelper::remove( const CustomAnimationEffectPtr& pEffect ) void EffectSequenceHelper::moveToBeforeEffect( const CustomAnimationEffectPtr& pEffect, const CustomAnimationEffectPtr& pInsertBefore) { - if ( pEffect.get() ) + if ( pEffect ) { maEffects.remove( pEffect ); EffectSequence::iterator aInsertIter( find( pInsertBefore ) ); @@ -1922,13 +1922,13 @@ void EffectSequenceHelper::implRebuild() else pEffect.reset(); } - while( pEffect.get() && (pEffect->getNodeType() == EffectNodeType::WITH_PREVIOUS) ); + while( pEffect && (pEffect->getNodeType() == EffectNodeType::WITH_PREVIOUS) ); fBegin += fDuration; } - while( pEffect.get() && (pEffect->getNodeType() != EffectNodeType::ON_CLICK) ); + while( pEffect && (pEffect->getNodeType() != EffectNodeType::ON_CLICK) ); } - while( pEffect.get() ); + while( pEffect ); // process after effect nodes std::for_each( aAfterEffects.begin(), aAfterEffects.end(), stl_process_after_effect_node_func ); @@ -2417,7 +2417,7 @@ void EffectSequenceHelper::updateTextGroups() continue; // trivial case, no group CustomAnimationTextGroupPtr pGroup = findGroup( nGroupId ); - if( !pGroup.get() ) + if( !pGroup ) { pGroup = std::make_shared( pEffect->getTargetShape(), nGroupId ); maGroupMap[nGroupId] = pGroup; @@ -2991,7 +2991,7 @@ void EffectSequenceHelper::processAfterEffect( const Reference< XAnimationNode > if( aIter != maEffects.end() ) pMasterEffect = *aIter; - if( pMasterEffect.get() ) + if( pMasterEffect ) { pMasterEffect->setHasAfterEffect( true ); @@ -3221,7 +3221,7 @@ CustomAnimationEffectPtr MainSequence::findEffect( const css::uno::Reference< cs for (auto const& interactiveSequence : maInteractiveSequenceVector) { pEffect = interactiveSequence->findEffect( xNode ); - if (pEffect.get()) + if (pEffect) break; } } @@ -3535,13 +3535,13 @@ void InteractiveSequence::implRebuild() MainSequenceRebuildGuard::MainSequenceRebuildGuard( const MainSequencePtr& pMainSequence ) : mpMainSequence( pMainSequence ) { - if( mpMainSequence.get() ) + if( mpMainSequence ) mpMainSequence->lockRebuilds(); } MainSequenceRebuildGuard::~MainSequenceRebuildGuard() { - if( mpMainSequence.get() ) + if( mpMainSequence ) mpMainSequence->unlockRebuilds(); } diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 6c2a3f701043..25c03daae6ac 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -162,7 +162,7 @@ Reference< XAnimationNode > CustomAnimationPreset::create( const OUString& rstrS strSubType = maDefaultSubTyp; CustomAnimationEffectPtr pEffect = maSubTypes[strSubType]; - if( pEffect.get() ) + if( pEffect ) { Reference< XCloneable > xCloneable( pEffect->getNode(), UNO_QUERY_THROW ); Reference< XAnimationNode > xNode( xCloneable->createClone(), UNO_QUERY_THROW ); @@ -292,7 +292,7 @@ void CustomAnimationPresets::importEffects() const OUString aPresetId( pEffect->getPresetId() ); CustomAnimationPresetPtr pDescriptor = getEffectDescriptor( aPresetId ); - if( pDescriptor.get() ) + if( pDescriptor ) pDescriptor->add( pEffect ); else { @@ -398,7 +398,7 @@ void CustomAnimationPresets::importPresets( const Reference< XMultiServiceFactor for( const OUString& rEffectName : std::as_const(aEffects) ) { CustomAnimationPresetPtr pEffect = getEffectDescriptor( rEffectName ); - if( pEffect.get() ) + if( pEffect ) { aEffectsList.push_back( pEffect ); } @@ -465,11 +465,11 @@ const OUString& CustomAnimationPresets::translateName( const OUString& rId, cons } void CustomAnimationPresets::changePresetSubType( const CustomAnimationEffectPtr& pEffect, const OUString& rPresetSubType ) const { - if( pEffect.get() && pEffect->getPresetSubType() != rPresetSubType ) + if( pEffect && pEffect->getPresetSubType() != rPresetSubType ) { CustomAnimationPresetPtr pDescriptor( getEffectDescriptor( pEffect->getPresetId() ) ); - if( pDescriptor.get() ) + if( pDescriptor ) { Reference< XAnimationNode > xNewNode( pDescriptor->create( rPresetSubType ) ); if( xNewNode.is() ) @@ -518,11 +518,11 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n sal_Int32 nCategory = comphelper::rng::uniform_size_distribution(0, pCategoryList->size()-1); PresetCategoryPtr pCategory = (*pCategoryList)[nCategory]; - if( pCategory.get() && !pCategory->maEffects.empty() ) + if( pCategory && !pCategory->maEffects.empty() ) { sal_Int32 nDescriptor = comphelper::rng::uniform_size_distribution(0, pCategory->maEffects.size()-1); CustomAnimationPresetPtr pPreset = pCategory->maEffects[nDescriptor]; - if( pPreset.get() ) + if( pPreset ) { std::vector aSubTypes = pPreset->getSubTypes(); diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 1aa52dfe0c68..35bddcd3116e 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -454,7 +454,7 @@ void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEff CustomAnimationPresetPtr pPreset( rPresets.getEffectDescriptor( aPresetId ) ); sd::MainSequencePtr pMainSequence = static_cast(pObj->getSdrPageFromSdrObject())->getMainSequence(); - if( !(pPreset.get() && pMainSequence.get()) ) + if( !(pPreset && pMainSequence) ) return; const Reference< XShape > xShape( pShape ); @@ -476,7 +476,7 @@ void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEff if( nGroupId >= 0 ) { CustomAnimationTextGroupPtr pGroup = pMainSequence->findGroup( nGroupId ); - if( pGroup.get() ) + if( pGroup ) { // add an effect to animate the shape pMainSequence->setAnimateForm( pGroup, true ); @@ -538,7 +538,7 @@ void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEff pEffect = *aIterOnlyBackground; } - if( pEffect.get() ) + if( pEffect ) { if( (pEffect->getPresetId() != aPresetId) || (pEffect->getPresetSubType() != aPresetSubType) ) @@ -557,7 +557,7 @@ AnimationEffect EffectMigration::GetAnimationEffect( SvxShape* pShape ) SdrObject* pObj = pShape->GetSdrObject(); sd::MainSequencePtr pMainSequence = static_cast(pObj->getSdrPageFromSdrObject())->getMainSequence(); - if( pMainSequence.get() ) + if( pMainSequence ) { const Reference< XShape > xShape( pShape ); @@ -619,7 +619,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect sd::MainSequencePtr pMainSequence = static_cast(pObj->getSdrPageFromSdrObject())->getMainSequence(); - if( !(pPreset.get() && pMainSequence.get()) ) + if( !(pPreset && pMainSequence) ) return; const Reference< XShape > xShape( pShape ); @@ -672,7 +672,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect } } - if( pShapeEffect.get() ) + if( pShapeEffect ) { SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() ); const bool bManual = (pPage == nullptr) || (pPage->GetPresChange() == PresChange::Manual); @@ -730,7 +730,7 @@ AnimationEffect EffectMigration::GetTextAnimationEffect( SvxShape* pShape ) { sd::MainSequencePtr pMainSequence = static_cast(pObj->getSdrPageFromSdrObject())->getMainSequence(); - if( pMainSequence.get() ) + if( pMainSequence ) { const Reference< XShape > xShape( pShape ); EffectSequence::iterator aIter( ImplFindEffect( pMainSequence, xShape, ShapeAnimationSubType::ONLY_TEXT ) ); @@ -1278,7 +1278,7 @@ void EffectMigration::SetAnimationPath( SvxShape* pShape, SdrPathObj const * pPa if( pPage ) { std::shared_ptr< sd::MainSequence > pMainSequence( pPage->getMainSequence() ); - if( pMainSequence.get() ) + if( pMainSequence ) pMainSequence->append( *pPathObj, makeAny( xShape ), -1.0, "" ); } } @@ -1353,7 +1353,7 @@ void EffectMigration::CreateAnimatedGroup(SdrObjGroup const & rGroupObj, SdPage& std::shared_ptr< sd::MainSequence > pMainSequence(rPage.getMainSequence()); - if(!pMainSequence.get()) + if(!pMainSequence) return; std::vector< SdrObject* > aObjects; diff --git a/sd/source/core/sdpage_animations.cxx b/sd/source/core/sdpage_animations.cxx index 47094551e950..bb16cacdbb7a 100644 --- a/sd/source/core/sdpage_animations.cxx +++ b/sd/source/core/sdpage_animations.cxx @@ -60,7 +60,7 @@ Reference< XAnimationNode > const & SdPage::getAnimationNode() void SdPage::setAnimationNode( Reference< XAnimationNode > const & xNode ) { mxAnimationNode = xNode; - if( mpMainSequence.get() ) + if( mpMainSequence ) mpMainSequence->reset( xNode ); } diff --git a/sd/source/core/undoanim.cxx b/sd/source/core/undoanim.cxx index 8ad89efcc159..707d14bf885b 100644 --- a/sd/source/core/undoanim.cxx +++ b/sd/source/core/undoanim.cxx @@ -124,10 +124,10 @@ struct UndoAnimationPathImpl return; std::shared_ptr< sd::MainSequence > pMainSequence( mpPage->getMainSequence() ); - if( pMainSequence.get() ) + if( pMainSequence ) { CustomAnimationEffectPtr pEffect( pMainSequence->findEffect( xNode ) ); - if( pEffect.get() ) + if( pEffect ) { mnEffectOffset = pMainSequence->getOffsetFromEffect( pEffect ); msUndoPath = pEffect->getPath(); @@ -143,7 +143,7 @@ struct UndoAnimationPathImpl if( mpPage && (mnEffectOffset >= 0) ) { std::shared_ptr< sd::MainSequence > pMainSequence( mpPage->getMainSequence() ); - if( pMainSequence.get() ) + if( pMainSequence ) pEffect = pMainSequence->getEffectFromOffset( mnEffectOffset ); } return pEffect; @@ -163,7 +163,7 @@ UndoAnimationPath::~UndoAnimationPath() void UndoAnimationPath::Undo() { CustomAnimationEffectPtr pEffect = mpImpl->getEffect(); - if( pEffect.get() ) + if( pEffect ) { mpImpl->msRedoPath = pEffect->getPath(); pEffect->setPath( mpImpl->msUndoPath ); @@ -173,7 +173,7 @@ void UndoAnimationPath::Undo() void UndoAnimationPath::Redo() { CustomAnimationEffectPtr pEffect = mpImpl->getEffect(); - if( pEffect.get() ) + if( pEffect ) { pEffect->setPath( mpImpl->msRedoPath ); } diff --git a/sd/source/filter/ppt/ppt97animations.cxx b/sd/source/filter/ppt/ppt97animations.cxx index 64312a026292..96d578019753 100644 --- a/sd/source/filter/ppt/ppt97animations.cxx +++ b/sd/source/filter/ppt/ppt97animations.cxx @@ -560,7 +560,7 @@ void Ppt97Animation::createAndSetCustomAnimationEffect( SdrObject* pObj ) return; } ::sd::MainSequencePtr pMainSequence = static_cast(pObj->getSdrPageFromSdrObject())->getMainSequence(); - if( !pMainSequence.get() ) + if( !pMainSequence ) { OSL_FAIL("no MainSequence found for ppt import"); return; @@ -568,7 +568,7 @@ void Ppt97Animation::createAndSetCustomAnimationEffect( SdrObject* pObj ) const ::sd::CustomAnimationPresets& rPresets( ::sd::CustomAnimationPresets::getCustomAnimationPresets() ); ::sd::CustomAnimationPresetPtr pPreset( rPresets.getEffectDescriptor( GetPresetId() ) ); - if( !pPreset.get() ) + if( !pPreset ) { OSL_FAIL("no suitable preset found for ppt import"); return; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 9a7e2b5f93b5..26453ed7033c 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1487,7 +1487,7 @@ struct Ppt97AnimationStlSortHelper bool Ppt97AnimationStlSortHelper::operator()( const std::pair< SdrObject*, Ppt97AnimationPtr >& p1, const std::pair< SdrObject*, Ppt97AnimationPtr >& p2 ) { - if( !p1.second.get() || !p2.second.get() ) + if( !p1.second || !p2.second ) return p1.second.get() < p2.second.get(); if( *p1.second < *p2.second ) return true; @@ -1853,7 +1853,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations for( auto& rEntry : aAnimationsOnThisPage ) { Ppt97AnimationPtr pPpt97Animation = rEntry.second; - if( pPpt97Animation.get() ) + if( pPpt97Animation ) pPpt97Animation->createAndSetCustomAnimationEffect( rEntry.first ); } } diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index b19e76350c70..c9f64e2c8125 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -144,7 +144,7 @@ void SdPresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId const CustomAnimationPresets& rPresets = CustomAnimationPresets::getCustomAnimationPresets(); CustomAnimationPresetPtr pDescriptor = rPresets.getEffectDescriptor( rPresetId ); - if( pDescriptor.get() ) + if( pDescriptor ) { OUString aPropertyValue; diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index e6ccb0c3c721..9444d21ed192 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -555,7 +555,7 @@ CustomAnimationList::~CustomAnimationList() mnPostCollapseEvent = nullptr; } - if( mpMainSequence.get() ) + if( mpMainSequence ) mpMainSequence->removeListener( this ); clear(); @@ -631,13 +631,13 @@ void CustomAnimationList::clear() void CustomAnimationList::update( const MainSequencePtr& pMainSequence ) { - if( mpMainSequence.get() ) + if( mpMainSequence ) mpMainSequence->removeListener( this ); mpMainSequence = pMainSequence; update(); - if( mpMainSequence.get() ) + if( mpMainSequence ) mpMainSequence->addListener( this ); } @@ -670,7 +670,7 @@ void CustomAnimationList::update() std::unique_ptr xEntry = mxTreeView->make_iterator(); - if( mpMainSequence.get() ) + if( mpMainSequence ) { std::unique_ptr xLastSelectedEntry; std::unique_ptr xLastVisibleEntry; @@ -680,7 +680,7 @@ void CustomAnimationList::update() &aSelected, &nFirstSelOld, &pFirstSelEffect, &xLastSelectedEntry](weld::TreeIter& rEntry){ CustomAnimationListEntryItem* pEntry = reinterpret_cast(mxTreeView->get_id(rEntry).toInt64()); CustomAnimationEffectPtr pEffect(pEntry->getEffect()); - if (pEffect.get()) + if (pEffect) { if (weld::IsEntryVisible(*mxTreeView, rEntry)) { @@ -735,7 +735,7 @@ void CustomAnimationList::update() clear(); - if (mpMainSequence.get()) + if (mpMainSequence) { std::for_each( mpMainSequence->getBegin(), mpMainSequence->getEnd(), stl_append_effect_func( *this ) ); mxLastParentEntry.reset(); @@ -768,7 +768,7 @@ void CustomAnimationList::update() mxTreeView->show(); } - if (mpMainSequence.get()) + if (mpMainSequence) { long nFirstSelNew = -1; long nLastSelNew = -1; @@ -783,7 +783,7 @@ void CustomAnimationList::update() CustomAnimationListEntryItem* pEntry = reinterpret_cast(mxTreeView->get_id(*xEntry).toInt64()); CustomAnimationEffectPtr pEffect( pEntry->getEffect() ); - if (pEffect.get()) + if (pEffect) { // Any effects that were visible should still be visible, so expand their parents. // (a previously expanded parent may have moved leaving a child to now be the new parent to expand) @@ -1112,7 +1112,7 @@ EffectSequence CustomAnimationList::getSelection() const { CustomAnimationListEntryItem* pChild = reinterpret_cast(mxTreeView->get_id(*xChild).toInt64()); const CustomAnimationEffectPtr& pChildEffect( pChild->getEffect() ); - if( pChildEffect.get() ) + if( pChildEffect ) aSelection.push_back( pChildEffect ); } } while (mxTreeView->iter_next_sibling(*xChild)); @@ -1146,7 +1146,7 @@ IMPL_LINK(CustomAnimationList, CommandHdl, const CommandEvent&, rCEvt, bool) CustomAnimationEffectPtr pEffect(pEntry->getEffect()); nEntries++; - if (pEffect.get()) + if (pEffect) { if( nNodeType == -1 ) { diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index c85f9df7a90b..a55f93beecbc 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -323,7 +323,7 @@ IMPL_LINK(CustomAnimationPane,EventMultiplexerListener, onChangeCurrentPage(); break; case EventMultiplexerEventId::EndTextEdit: - if (mpMainSequence.get() && rEvent.mpUserData) + if (mpMainSequence && rEvent.mpUserData) mxCustomAnimationList->update( mpMainSequence ); break; default: break; @@ -540,7 +540,7 @@ void CustomAnimationPane::updateControls() Any aValue; CustomAnimationPresetPtr pDescriptor = CustomAnimationPresets::getCustomAnimationPresets().getEffectDescriptor( pEffect->getPresetId() ); - if (pDescriptor.get()) + if (pDescriptor) { std::vector aProperties( pDescriptor->getProperties() ); if( !aProperties.empty() ) @@ -572,7 +572,7 @@ void CustomAnimationPane::updateControls() mxPlaceholderBox->set_sensitive( bEnable ); mxFTProperty->set_sensitive( bEnable ); - if (!pDescriptor.get()) + if (!pDescriptor) { mxPBPropertyMore->set_sensitive( false ); mxFTStartDelay->set_sensitive( false ); @@ -609,7 +609,7 @@ void CustomAnimationPane::updateControls() if (nEntryData) { CustomAnimationPresetPtr& pPtr = *reinterpret_cast(nEntryData); - if( pPtr.get() && pPtr->getPresetId() == rsPresetId ) + if( pPtr && pPtr->getPresetId() == rsPresetId ) { mxLBAnimation->select( nAnimationPos ); mnLastSelectedAnimation = nAnimationPos; @@ -719,7 +719,7 @@ void CustomAnimationPane::updateControls() EffectSequenceHelper* pSequence = nullptr; for( const CustomAnimationEffectPtr& pEffect : maListSelection ) { - if( pEffect.get() ) + if( pEffect ) { if( pSequence == nullptr ) { @@ -754,7 +754,7 @@ static bool updateMotionPathImpl( CustomAnimationPane& rPane, ::sd::View& rView, while( aIter != aEnd ) { CustomAnimationEffectPtr pEffect( *aIter++ ); - if( pEffect.get() && pEffect->getPresetClass() == css::presentation::EffectPresetClass::MOTIONPATH ) + if( pEffect && pEffect->getPresetClass() == css::presentation::EffectPresetClass::MOTIONPATH ) { rtl::Reference< MotionPathTag > xMotionPathTag; // first try to find if there is already a tag for this @@ -797,11 +797,11 @@ void CustomAnimationPane::updateMotionPathTags() if( mxView.is() ) { std::shared_ptr xViewShell( mrBase.GetMainViewShell() ); - if( xViewShell.get() ) + if( xViewShell ) pView = xViewShell->GetView(); } - if( IsVisible() && mpMainSequence.get() && pView ) + if( IsVisible() && mpMainSequence && pView ) { bChanges = updateMotionPathImpl( *this, *pView, mpMainSequence->getBegin(), mpMainSequence->getEnd(), aTags, maMotionPathTags ); @@ -1155,10 +1155,10 @@ std::unique_ptr CustomAnimationPane::createSelectionSet() if( nGroupId != -1 ) pTextGroup = pEffectSequence->findGroup( nGroupId ); - addValue( pSet, nHandleTextGrouping, makeAny( pTextGroup.get() ? pTextGroup->getTextGrouping() : sal_Int32(-1) ) ); + addValue( pSet, nHandleTextGrouping, makeAny( pTextGroup ? pTextGroup->getTextGrouping() : sal_Int32(-1) ) ); addValue( pSet, nHandleAnimateForm, makeAny( pTextGroup.get() == nullptr || pTextGroup->getAnimateForm() ) ); - addValue( pSet, nHandleTextGroupingAuto, makeAny( pTextGroup.get() ? pTextGroup->getTextGroupingAuto() : -1.0 ) ); - addValue( pSet, nHandleTextReverse, makeAny( pTextGroup.get() && pTextGroup->getTextReverse() ) ); + addValue( pSet, nHandleTextGroupingAuto, makeAny( pTextGroup ? pTextGroup->getTextGroupingAuto() : -1.0 ) ); + addValue( pSet, nHandleTextReverse, makeAny( pTextGroup && pTextGroup->getTextReverse() ) ); if( pEffectSequence->getSequenceType() == EffectNodeType::INTERACTIVE_SEQUENCE ) { @@ -1167,7 +1167,7 @@ std::unique_ptr CustomAnimationPane::createSelectionSet() } CustomAnimationPresetPtr pDescriptor = rPresets.getEffectDescriptor( pEffect->getPresetId() ); - if( pDescriptor.get() ) + if( pDescriptor ) { sal_Int32 nType = nPropertyTypeNone; @@ -1544,7 +1544,7 @@ void CustomAnimationPane::changeSelection( STLPropertySet const * pResultSet, ST if( bHasAnimateForm ) { - if( pTextGroup.get() && pTextGroup->getAnimateForm() != bAnimateForm ) + if( pTextGroup && pTextGroup->getAnimateForm() != bAnimateForm ) { if( (pTextGroup->getTextGrouping() >= 0) && (nTextGrouping == -1 ) ) { @@ -1562,7 +1562,7 @@ void CustomAnimationPane::changeSelection( STLPropertySet const * pResultSet, ST if( bHasTextGrouping ) { - if( pTextGroup.get() && pTextGroup->getTextGrouping() != nTextGrouping ) + if( pTextGroup && pTextGroup->getTextGrouping() != nTextGrouping ) { pEffectSequence->setTextGrouping( pTextGroup, nTextGrouping ); @@ -1582,7 +1582,7 @@ void CustomAnimationPane::changeSelection( STLPropertySet const * pResultSet, ST if (!bDoSetAnimateFormFirst && bNeedDoSetAnimateForm) { - if( pTextGroup.get() ) + if( pTextGroup ) { pEffectSequence->setAnimateForm( pTextGroup, bAnimateForm ); bChanged = true; @@ -1591,7 +1591,7 @@ void CustomAnimationPane::changeSelection( STLPropertySet const * pResultSet, ST if( bHasTextGroupingAuto ) { - if( pTextGroup.get() && pTextGroup->getTextGroupingAuto() != fTextGroupingAuto ) + if( pTextGroup && pTextGroup->getTextGroupingAuto() != fTextGroupingAuto ) { pEffectSequence->setTextGroupingAuto( pTextGroup, fTextGroupingAuto ); bChanged = true; @@ -1600,7 +1600,7 @@ void CustomAnimationPane::changeSelection( STLPropertySet const * pResultSet, ST if( bHasTextReverse ) { - if( pTextGroup.get() && pTextGroup->getTextReverse() != bTextReverse ) + if( pTextGroup && pTextGroup->getTextReverse() != bTextReverse ) { pEffectSequence->setTextReverse( pTextGroup, bTextReverse ); bChanged = true; @@ -1817,7 +1817,7 @@ void CustomAnimationPane::onAdd() mxCBXDuration->set_sensitive( bHasSpeed ); mxFTDuration->set_sensitive( bHasSpeed ); - if( pDescriptor.get() ) + if( pDescriptor ) { mxCustomAnimationList->unselect_all(); @@ -1842,7 +1842,7 @@ void CustomAnimationPane::onAdd() else pCreated->setNodeType( EffectNodeType::WITH_PREVIOUS ); - if( pCreated.get() ) + if( pCreated ) mxCustomAnimationList->select( pCreated ); } } @@ -2214,7 +2214,7 @@ sal_Int32 CustomAnimationPane::fillAnimationLB( bool bHasText ) for (PresetCategoryPtr& pCategory : rCategoryList) { - if( pCategory.get() ) + if( pCategory ) { InsertCategory(*mxLBAnimation, pCategory->maLabel); @@ -2226,7 +2226,7 @@ sal_Int32 CustomAnimationPane::fillAnimationLB( bool bHasText ) for( CustomAnimationPresetPtr& pDescriptor : aSortedVector ) { // ( !isTextOnly || ( isTextOnly && bHasText ) ) <=> !isTextOnly || bHasText - if( pDescriptor.get() && ( !pDescriptor->isTextOnly() || bHasText ) ) + if( pDescriptor && ( !pDescriptor->isTextOnly() || bHasText ) ) { auto pCustomPtr = new CustomAnimationPresetPtr(pDescriptor); OUString sId = OUString::number(reinterpret_cast(pCustomPtr)); @@ -2467,7 +2467,7 @@ void CustomAnimationPane::onSelect() // pEffectInsertBefore may be null if moving to end of list. void CustomAnimationPane::onDragNDropComplete(std::vector< CustomAnimationEffectPtr > pEffectsDragged, CustomAnimationEffectPtr pEffectInsertBefore) { - if ( !mpMainSequence.get() ) + if ( !mpMainSequence ) return; addUndo(); diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 8cd867a89c1a..512ed85a786d 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -111,7 +111,7 @@ SfxItemPool* GetAnnotationPool() static SfxBindings* getBindings( ViewShellBase const & rBase ) { - if( rBase.GetMainViewShell().get() && rBase.GetMainViewShell()->GetViewFrame() ) + if( rBase.GetMainViewShell() && rBase.GetMainViewShell()->GetViewFrame() ) return &rBase.GetMainViewShell()->GetViewFrame()->GetBindings(); return nullptr; @@ -119,7 +119,7 @@ static SfxBindings* getBindings( ViewShellBase const & rBase ) static SfxDispatcher* getDispatcher( ViewShellBase const & rBase ) { - if( rBase.GetMainViewShell().get() && rBase.GetMainViewShell()->GetViewFrame() ) + if( rBase.GetMainViewShell() && rBase.GetMainViewShell()->GetViewFrame() ) return rBase.GetMainViewShell()->GetViewFrame()->GetDispatcher(); return nullptr; @@ -1292,7 +1292,7 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage const * pPage, bool bForward SdPage* AnnotationManagerImpl::GetCurrentPage() { - if (mrBase.GetMainViewShell().get()) + if (mrBase.GetMainViewShell()) return mrBase.GetMainViewShell()->getCurrentPage(); return nullptr; } diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index ad0ce701bdfe..86fa9198dc05 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -452,7 +452,7 @@ void DrawDocShell::ClearUndoBuffer() if( pViewShellBase ) { std::shared_ptr pViewSh( pViewShellBase->GetMainViewShell() ); - if( pViewSh.get() ) + if( pViewSh ) { ::sd::View* pView = pViewSh->GetView(); if( pView ) diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index 7630ea02304e..526210ae84c9 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -230,7 +230,7 @@ bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt ) if( pPage ) { std::shared_ptr< sd::MainSequence > pMainSequence( pPage->getMainSequence() ); - if( pMainSequence.get() ) + if( pMainSequence ) { Sequence< Any > aTargets; maTargets >>= aTargets; diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index e4c305808b6f..437af13d0270 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -163,7 +163,7 @@ bool FuFormatPaintBrush::MouseMove(const MouseEvent& rMEvt) bool FuFormatPaintBrush::MouseButtonUp(const MouseEvent& rMEvt) { - if( mxItemSet.get() && mpView && mpView->AreObjectsMarked() ) + if( mxItemSet && mpView && mpView->AreObjectsMarked() ) { bool bNoCharacterFormats = false; bool bNoParagraphFormats = false; @@ -231,7 +231,7 @@ bool FuFormatPaintBrush::HasContentForThisType( SdrInventor nObjectInventor, sal void FuFormatPaintBrush::Paste( bool bNoCharacterFormats, bool bNoParagraphFormats ) { const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - if( !(mxItemSet.get() && ( rMarkList.GetMarkCount() == 1 )) ) + if( !(mxItemSet && ( rMarkList.GetMarkCount() == 1 )) ) return; SdrObject* pObj( nullptr ); diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 1b63f0d06f14..74bbe395d92d 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -1067,14 +1067,14 @@ void SlideShow::StartInPlacePresentation() ::std::shared_ptr pHelper(FrameworkHelper::Instance(*mpCurrentViewShellBase)); ::std::shared_ptr pMainViewShell(pHelper->GetViewShell(FrameworkHelper::msCenterPaneURL)); - if( pMainViewShell.get() ) + if( pMainViewShell ) eShell = pMainViewShell->GetShellType(); if( eShell != ViewShell::ST_IMPRESS ) { // Switch temporary to a DrawViewShell which supports the in-place presentation. - if( pMainViewShell.get() ) + if( pMainViewShell ) { FrameView* pFrameView = pMainViewShell->GetFrameView(); pFrameView->SetPresentationViewShellId(SID_VIEWSHELL1); @@ -1107,7 +1107,7 @@ void SlideShow::StartInPlacePresentation() return; bool bSuccess = false; - if( mxCurrentSettings.get() && mxCurrentSettings->mbPreview ) + if( mxCurrentSettings && mxCurrentSettings->mbPreview ) { bSuccess = mxController->startPreview(mxCurrentSettings->mxStartPage, mxCurrentSettings->mxAnimationNode, mxCurrentSettings->mpParentWindow ); } @@ -1120,7 +1120,7 @@ void SlideShow::StartInPlacePresentation() end(); else { - if( mpCurrentViewShellBase && ( !mxCurrentSettings.get() || ( mxCurrentSettings.get() && !mxCurrentSettings->mbPreview ) ) ) + if( mpCurrentViewShellBase && ( !mxCurrentSettings || ( mxCurrentSettings && !mxCurrentSettings->mbPreview ) ) ) mpCurrentViewShellBase->GetWindow()->GrabFocus(); } } @@ -1149,7 +1149,7 @@ void SlideShow::StartFullscreenPresentation( ) // view shells. FrameView* pOriginalFrameView = nullptr; ::std::shared_ptr xShell(mpCurrentViewShellBase->GetMainViewShell()); - if (xShell.get()) + if (xShell) pOriginalFrameView = xShell->GetFrameView(); delete mpFullScreenFrameView; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index e92bb0b509ce..03fbc17a10dc 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1310,7 +1310,7 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects) stopSound(); removeShapeEvents(); - if( mpSlideController.get() && mxShow.is() ) + if( mpSlideController && mxShow.is() ) { Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), UNO_QUERY_THROW ); @@ -1431,7 +1431,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape ) SolarMutexGuard aSolarGuard; WrappedShapeEventImplPtr pEvent = maShapeEventMap[xShape]; - if( !pEvent.get() ) + if( !pEvent ) return; switch( pEvent->meClickAction ) @@ -1589,7 +1589,7 @@ void SlideshowImpl::hyperLinkClicked( OUString const& aHyperLink ) void SlideshowImpl::displaySlideNumber( sal_Int32 nSlideNumber ) { - if( mpSlideController.get() ) + if( mpSlideController ) { if( mpSlideController->jumpToSlideNumber( nSlideNumber ) ) { @@ -1601,7 +1601,7 @@ void SlideshowImpl::displaySlideNumber( sal_Int32 nSlideNumber ) /** nSlideIndex == -1 displays current slide again */ void SlideshowImpl::displaySlideIndex( sal_Int32 nSlideIndex ) { - if( mpSlideController.get() ) + if( mpSlideController ) { if( (nSlideIndex == -1) || mpSlideController->jumpToSlideIndex( nSlideIndex ) ) { @@ -1619,7 +1619,7 @@ void SlideshowImpl::jumpToBookmark( const OUString& sBookmark ) sal_Int32 SlideshowImpl::getCurrentSlideNumber() const { - return mpSlideController.get() ? mpSlideController->getCurrentSlideNumber() : -1; + return mpSlideController ? mpSlideController->getCurrentSlideNumber() : -1; } sal_Bool SAL_CALL SlideshowImpl::isEndless() @@ -1736,7 +1736,7 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt) case KEY_SUBTRACT: // in case the user cancels the presentation, switch to current slide // in edit mode - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + if( mpSlideController && (ANIMATIONMODE_SHOW == meAnimationMode) ) { if( mpSlideController->getCurrentSlideNumber() != -1 ) mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); @@ -1763,7 +1763,7 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt) { if( !maCharBuffer.isEmpty() ) { - if( mpSlideController.get() ) + if( mpSlideController ) { if( mpSlideController->jumpToSlideNumber( maCharBuffer.toInt32() - 1 ) ) displayCurrentSlide(); @@ -1900,7 +1900,7 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void case MediaCommand::Stop: // in case the user cancels the presentation, switch to current slide // in edit mode - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + if( mpSlideController && (ANIMATIONMODE_SHOW == meAnimationMode) ) { if( mpSlideController->getCurrentSlideNumber() != -1 ) mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); @@ -2157,7 +2157,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu, bool ) // When in autoplay mode (pps/ppsx), offer editing of the presentation // Turn autostart off, else Impress will close when exiting the Presentation mpViewShell->GetDoc()->SetExitAfterPresenting(false); - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + if( mpSlideController && (ANIMATIONMODE_SHOW == meAnimationMode) ) { if( mpSlideController->getCurrentSlideNumber() != -1 ) { @@ -2170,7 +2170,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu, bool ) { // in case the user cancels the presentation, switch to current slide // in edit mode - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + if( mpSlideController && (ANIMATIONMODE_SHOW == meAnimationMode) ) { if( mpSlideController->getCurrentSlideNumber() != -1 ) { @@ -2529,7 +2529,7 @@ Reference< XDrawPage > SAL_CALL SlideshowImpl::getCurrentSlide() SolarMutexGuard aSolarGuard; Reference< XDrawPage > xSlide; - if( mxShow.is() && mpSlideController.get() ) + if( mxShow.is() && mpSlideController ) { sal_Int32 nSlide = getCurrentSlideNumber(); if( (nSlide >= 0) && (nSlide < mpSlideController->getSlideNumberCount() ) ) @@ -2555,14 +2555,14 @@ sal_Int32 SAL_CALL SlideshowImpl::getNextSlideIndex() sal_Int32 SAL_CALL SlideshowImpl::getCurrentSlideIndex() { - return mpSlideController.get() ? mpSlideController->getCurrentSlideIndex() : -1; + return mpSlideController ? mpSlideController->getCurrentSlideIndex() : -1; } // css::presentation::XSlideShowController: ::sal_Int32 SAL_CALL SlideshowImpl::getSlideCount() { - return mpSlideController.get() ? mpSlideController->getSlideIndexCount() : 0; + return mpSlideController ? mpSlideController->getSlideIndexCount() : 0; } Reference< XDrawPage > SAL_CALL SlideshowImpl::getSlideByIndex(::sal_Int32 Index) @@ -2717,7 +2717,7 @@ void SAL_CALL SlideshowImpl::gotoNextEffect( ) { SolarMutexGuard aSolarGuard; - if( !(mxShow.is() && mpSlideController.get() && mpShowWindow) ) + if( !(mxShow.is() && mpSlideController && mpShowWindow) ) return; if( mbIsPaused ) @@ -2743,7 +2743,7 @@ void SAL_CALL SlideshowImpl::gotoPreviousEffect( ) { SolarMutexGuard aSolarGuard; - if( !(mxShow.is() && mpSlideController.get() && mpShowWindow) ) + if( !(mxShow.is() && mpSlideController && mpShowWindow) ) return; if( mbIsPaused ) @@ -2765,7 +2765,7 @@ void SAL_CALL SlideshowImpl::gotoFirstSlide( ) { SolarMutexGuard aSolarGuard; - if( !(mpShowWindow && mpSlideController.get()) ) + if( !(mpShowWindow && mpSlideController) ) return; if( mbIsPaused ) @@ -2805,7 +2805,7 @@ void SAL_CALL SlideshowImpl::gotoNextSlide( ) maInputFreezeTimer.Start(); } - if( mpSlideController.get() ) + if( mpSlideController ) { if( mpSlideController->nextSlide() ) { @@ -2862,7 +2862,7 @@ void SlideshowImpl::gotoPreviousSlide (const bool bSkipAllMainSequenceEffects) { SolarMutexGuard aSolarGuard; - if( !(mxShow.is() && mpSlideController.get()) ) + if( !(mxShow.is() && mpSlideController) ) return; try @@ -2909,7 +2909,7 @@ void SAL_CALL SlideshowImpl::gotoLastSlide() { SolarMutexGuard aSolarGuard; - if( !mpSlideController.get() ) + if( !mpSlideController ) return; if( mbIsPaused ) @@ -2945,7 +2945,7 @@ void SAL_CALL SlideshowImpl::gotoSlide( const Reference< XDrawPage >& xSlide ) { SolarMutexGuard aSolarGuard; - if( !(mpSlideController.get() && xSlide.is()) ) + if( !(mpSlideController && xSlide.is()) ) return; if( mbIsPaused ) diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 56d14adf2370..46d92f8967ba 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -291,7 +291,7 @@ Reference< rendering::XSpriteCanvas > SAL_CALL SlideShowView::getCanvas( ) { ::osl::MutexGuard aGuard( m_aMutex ); - return mpCanvas.get() ? mpCanvas->getUNOSpriteCanvas() : Reference< rendering::XSpriteCanvas >(); + return mpCanvas ? mpCanvas->getUNOSpriteCanvas() : Reference< rendering::XSpriteCanvas >(); } void SAL_CALL SlideShowView::clear() @@ -311,7 +311,7 @@ void SAL_CALL SlideShowView::clear() ::cppcanvas::PolyPolygonSharedPtr pPolyPoly( ::cppcanvas::BaseGfxFactory::createPolyPolygon( mpCanvas, aPoly ) ); - if( pPolyPoly.get() ) + if( pPolyPoly ) { pPolyPoly->setRGBAFillColor( 0x000000FFU ); pPolyPoly->draw(); diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 64009e7bfe77..277ff844acad 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -128,7 +128,7 @@ TableDesignWidget::~TableDesignWidget() static SfxBindings* getBindings( ViewShellBase const & rBase ) { - if( rBase.GetMainViewShell().get() && rBase.GetMainViewShell()->GetViewFrame() ) + if( rBase.GetMainViewShell() && rBase.GetMainViewShell()->GetViewFrame() ) return &rBase.GetMainViewShell()->GetViewFrame()->GetBindings(); else return nullptr; @@ -136,7 +136,7 @@ static SfxBindings* getBindings( ViewShellBase const & rBase ) static SfxDispatcher* getDispatcher( ViewShellBase const & rBase ) { - if( rBase.GetMainViewShell().get() && rBase.GetMainViewShell()->GetViewFrame() ) + if( rBase.GetMainViewShell() && rBase.GetMainViewShell()->GetViewFrame() ) return rBase.GetMainViewShell()->GetViewFrame()->GetDispatcher(); else return nullptr; @@ -526,7 +526,7 @@ static void FillCellInfoMatrix( const CellInfoVector& rStyle, const TableStyleSe xCellInfo = rStyle[sdr::table::last_row_style]; } - if( !xCellInfo.get() ) + if( !xCellInfo ) { // next come first and last column, if used and available if( rSettings.mbUseFirstColumn && (nCol == 0) ) @@ -539,7 +539,7 @@ static void FillCellInfoMatrix( const CellInfoVector& rStyle, const TableStyleSe } } - if( !xCellInfo.get() ) + if( !xCellInfo ) { if( rSettings.mbUseRowBanding ) { @@ -554,7 +554,7 @@ static void FillCellInfoMatrix( const CellInfoVector& rStyle, const TableStyleSe } } - if( !xCellInfo.get() ) + if( !xCellInfo ) { if( rSettings.mbUseColumnBanding ) { @@ -569,7 +569,7 @@ static void FillCellInfoMatrix( const CellInfoVector& rStyle, const TableStyleSe } } - if( !xCellInfo.get() ) + if( !xCellInfo ) { // use default cell style if non found yet xCellInfo = rStyle[sdr::table::body_style]; @@ -614,7 +614,7 @@ static BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyl std::shared_ptr< CellInfo > xCellInfo(aMatrix[(nCol * nPreviewColumns) + nRow]); Color aTextColor( COL_AUTO ); - if( xCellInfo.get() ) + if( xCellInfo ) { // fill cell background const ::tools::Rectangle aRect( nX, nY, nX + nCellWidth - 1, nY + nCellHeight - 1 ); @@ -647,7 +647,7 @@ static BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyl { std::shared_ptr< CellInfo > xCellInfo(aMatrix[(nCol * nPreviewColumns) + nRow]); - if( xCellInfo.get() ) + if( xCellInfo ) { const Point aPntTL( nX, nY ); const Point aPntTR( nX + nCellWidth - 1, nY ); @@ -670,7 +670,7 @@ static BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyl { // check border std::shared_ptr< CellInfo > xBorderInfo(aMatrix[(nBorderCol * nPreviewColumns) + nBorderRow]); - if( xBorderInfo.get() ) + if( xBorderInfo ) { const ::editeng::SvxBorderLine* pBorderLine2 = xBorderInfo->maBorder->GetLine(static_cast(static_cast(nLine)^1)); if( pBorderLine2 && pBorderLine2->HasPriority(*pBorderLine) ) diff --git a/sd/source/ui/view/OutlinerIterator.cxx b/sd/source/ui/view/OutlinerIterator.cxx index 869350fa9571..9629774072fc 100644 --- a/sd/source/ui/view/OutlinerIterator.cxx +++ b/sd/source/ui/view/OutlinerIterator.cxx @@ -249,7 +249,7 @@ Iterator OutlinerContainer::CreateDocumentIterator ( case CURRENT: const std::shared_ptr pDrawViewShell( std::dynamic_pointer_cast(rpViewShell)); - if (pDrawViewShell.get()) + if (pDrawViewShell) { ePageKind = pDrawViewShell->GetPageKind(); eEditMode = pDrawViewShell->GetEditMode(); @@ -301,7 +301,7 @@ sal_Int32 OutlinerContainer::GetPageIndex ( switch (aLocation) { case CURRENT: - if (pDrawViewShell.get()) + if (pDrawViewShell) nPageIndex = pDrawViewShell->GetCurPagePos(); else { @@ -346,7 +346,7 @@ IteratorImplBase::IteratorImplBase(SdDrawDocument* pDocument, if ( ! mpViewShellWeak.expired()) pDrawViewShell = std::dynamic_pointer_cast(rpViewShellWeak.lock()); - if (pDrawViewShell.get()) + if (pDrawViewShell) { maPosition.mePageKind = pDrawViewShell->GetPageKind(); maPosition.meEditMode = pDrawViewShell->GetEditMode(); diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index a1d6cdc1b30c..282f4aeb8e93 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -488,7 +488,7 @@ bool ViewOverlayManager::CreateTags() std::shared_ptr aMainShell = mrBase.GetMainViewShell(); - SdPage* pPage = aMainShell.get() ? aMainShell->getCurrentPage() : nullptr; + SdPage* pPage = aMainShell ? aMainShell->getCurrentPage() : nullptr; if( pPage && !pPage->IsMasterPage() && (pPage->GetPageKind() == PageKind::Standard) ) { diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index 0074eb78ab4f..f86cf5c0f8cf 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -59,7 +59,7 @@ ErrCode LoadOlePropertySet( // global section SfxOleSectionRef xGlobSect = aGlobSet.GetSection( SECTION_GLOBAL ); - if( xGlobSect.get() ) + if( xGlobSect ) { // set supported properties OUString aStrValue; @@ -144,7 +144,7 @@ ErrCode LoadOlePropertySet( // custom properties SfxOleSectionRef xCustomSect = aDocSet.GetSection( SECTION_CUSTOM ); - if( xCustomSect.get() ) + if( xCustomSect ) { uno::Reference < beans::XPropertyContainer > xUserDefined( i_xDocProps->getUserDefinedProperties(), uno::UNO_SET_THROW); @@ -173,7 +173,7 @@ ErrCode LoadOlePropertySet( if ( xWriterProps.is() ) { SfxOleSectionRef xBuiltin = aDocSet.GetSection( SECTION_BUILTIN ); - if ( xBuiltin.get() ) + if ( xBuiltin ) { try { diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index c3baa5d21151..65145a21a96d 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -793,7 +793,7 @@ bool SfxOleSection::GetDateValue( util::Date& rValue, sal_Int32 nPropId ) const void SfxOleSection::SetProperty( const SfxOlePropertyRef& xProp ) { - if( xProp.get() ) + if( xProp ) maPropMap[ xProp->GetPropId() ] = xProp; } @@ -1062,7 +1062,7 @@ void SfxOleSection::LoadProperty( SvStream& rStrm, sal_Int32 nPropId ) break; } // load property contents - if( xProp.get() ) + if( xProp ) { SetError( xProp->Load( rStrm ) ); maPropMap[ nPropId ] = xProp; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index d647c80a4d48..533650751d75 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3468,7 +3468,7 @@ bool SfxBaseModel::hasValidSignatures() const void SfxBaseModel::getGrabBagItem(css::uno::Any& rVal) const { - if (m_pData->m_xGrabBagItem.get()) + if (m_pData->m_xGrabBagItem) m_pData->m_xGrabBagItem->QueryValue(rVal); else rVal <<= uno::Sequence(); @@ -3476,7 +3476,7 @@ void SfxBaseModel::getGrabBagItem(css::uno::Any& rVal) const void SfxBaseModel::setGrabBagItem(const css::uno::Any& rVal) { - if (!m_pData->m_xGrabBagItem.get()) + if (!m_pData->m_xGrabBagItem) m_pData->m_xGrabBagItem = std::make_shared(); m_pData->m_xGrabBagItem->PutValue(rVal, 0); diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx index acd6ecacd8eb..6e35a069f588 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx @@ -177,7 +177,7 @@ void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, -1, /* timeout */ nullptr, /* cancellable */ &error.getRef()),GVariantDeleter()); - if(result.get()) + if(result) o_isInstalled = bool(g_variant_get_boolean(g_variant_get_child_value(result.get(),0))); } diff --git a/slideshow/source/engine/animationnodes/generateevent.cxx b/slideshow/source/engine/animationnodes/generateevent.cxx index b228f041a93e..6d61c0c251e9 100644 --- a/slideshow/source/engine/animationnodes/generateevent.cxx +++ b/slideshow/source/engine/animationnodes/generateevent.cxx @@ -127,7 +127,7 @@ EventSharedPtr generateEvent( case animations::EventTrigger::ON_CLICK: // try to extract XShape event source event2shape(); - if (pShape.get()) + if (pShape) { pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, @@ -143,7 +143,7 @@ EventSharedPtr generateEvent( case animations::EventTrigger::ON_DBL_CLICK: // try to extract XShape event source event2shape(); - if (pShape.get()) + if (pShape) { pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, @@ -159,7 +159,7 @@ EventSharedPtr generateEvent( case animations::EventTrigger::ON_MOUSE_ENTER: // try to extract XShape event source event2shape(); - if (pShape.get()) + if (pShape) { pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, @@ -175,7 +175,7 @@ EventSharedPtr generateEvent( case animations::EventTrigger::ON_MOUSE_LEAVE: // try to extract XShape event source event2shape(); - if (pShape.get()) + if (pShape) { pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index b06a05bf06b1..ebae0d83276d 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1808,7 +1808,7 @@ void SlideShowImpl::addShapeEventListener( } // add new listener to broadcaster - if( aIter->second.get() ) + if( aIter->second ) aIter->second->addInterface( xListener ); maEventMultiplexer.notifyShapeListenerAdded(xShape); diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index 66faf10e09b3..3ec2c8089e6f 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -924,7 +924,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( pSoundPlayer, rEventMultiplexer )); - if( pTransition.get() ) + if( pTransition ) return pTransition; } diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 73b1103dd44f..8dfc70e643a1 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -164,7 +164,7 @@ namespace svgio::svgreader { if(GraphicType::Bitmap == rGraphic.GetType()) { - if(rGraphic.getVectorGraphicData().get()) + if(rGraphic.getVectorGraphicData()) { // embedded Svg rEmbedded = rGraphic.getVectorGraphicData()->getPrimitive2DSequence(); diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index deaea90b0d7b..b41f16072d71 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -155,7 +155,7 @@ PlaceEditDialog::~PlaceEditDialog() OUString PlaceEditDialog::GetServerUrl() { OUString sUrl; - if (m_xCurrentDetails.get()) + if (m_xCurrentDetails) { INetURLObject aUrl = m_xCurrentDetails->getUrl(); OUString sUsername = m_xEDUsername->get_text().trim(); @@ -249,7 +249,7 @@ void PlaceEditDialog::InitDetails( ) IMPL_LINK( PlaceEditDialog, OKHdl, weld::Button&, /*rBtn*/, void) { - if ( !m_xCurrentDetails.get() ) + if ( !m_xCurrentDetails ) return; OUString sUrl = m_xCurrentDetails->getUrl().GetHost( INetURLObject::DecodeMechanism::WithCharset ); @@ -353,7 +353,7 @@ void PlaceEditDialog::SelectType(bool bSkipSeparator) return; } - if (m_xCurrentDetails.get()) + if (m_xCurrentDetails) m_xCurrentDetails->set_visible(false); const int nPos = m_xLBServerType->get_active( ); diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 33eb60a9dd37..7bf8383ab8f6 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -869,7 +869,7 @@ double EnhancedCustomShape2d::GetEquationValueAsDouble( const sal_Int32 nIndex ) static sal_uInt32 nLevel = 0; if ( nIndex < static_cast(vNodesSharedPtr.size()) ) { - if ( vNodesSharedPtr[ nIndex ].get() ) { + if ( vNodesSharedPtr[ nIndex ] ) { nLevel ++; try { diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index bd95ca8237f3..2caa529e12bc 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -363,7 +363,7 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) IMapObjectPtr pIMapObj = pUserData->GetObject(); bool bActive = true; - if ( pIMapObj.get() ) + if ( pIMapObj ) { aURL = pIMapObj->GetURL(); aAltText = pIMapObj->GetAltText(); diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 6b9259c19328..f7eae17dbca1 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -337,7 +337,7 @@ void SvxPageWindow::drawFillAttributes(vcl::RenderContext& rRenderContext, drawinglayer::primitive2d::Primitive2DContainer aSequence; // create fill geometry if there is something to fill - if (rFillAttributes.get() && rFillAttributes->isUsed()) + if (rFillAttributes && rFillAttributes->isUsed()) { aSequence = rFillAttributes->getPrimitive2DSequence(aPaintRange, aDefineRange); } diff --git a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx index 039311e9739e..57945facb4bb 100644 --- a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx +++ b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx @@ -45,8 +45,8 @@ namespace drawinglayer::attribute basegfx::utils::createPolygonFromRect( maLastPaintRange)), maLastDefineRange, - maFillAttribute.get() ? *maFillAttribute : drawinglayer::attribute::SdrFillAttribute(), - maFillGradientAttribute.get() ? *maFillGradientAttribute : drawinglayer::attribute::FillGradientAttribute()); + maFillAttribute ? *maFillAttribute : drawinglayer::attribute::SdrFillAttribute(), + maFillGradientAttribute ? *maFillGradientAttribute : drawinglayer::attribute::FillGradientAttribute()); } } @@ -86,7 +86,7 @@ namespace drawinglayer::attribute bool SdrAllFillAttributesHelper::isUsed() const { // only depends on fill, FillGradientAttribute alone defines no fill - return maFillAttribute.get() && !maFillAttribute->isDefault(); + return maFillAttribute && !maFillAttribute->isDefault(); } bool SdrAllFillAttributesHelper::isTransparent() const @@ -96,7 +96,7 @@ namespace drawinglayer::attribute return true; } - if(maFillGradientAttribute.get() && !maFillGradientAttribute->isDefault()) + if(maFillGradientAttribute && !maFillGradientAttribute->isDefault()) { return true; } @@ -113,7 +113,7 @@ namespace drawinglayer::attribute const drawinglayer::attribute::SdrFillAttribute& SdrAllFillAttributesHelper::getFillAttribute() const { - if(!maFillAttribute.get()) + if(!maFillAttribute) { const_cast< SdrAllFillAttributesHelper* >(this)->maFillAttribute = std::make_shared(); @@ -124,7 +124,7 @@ namespace drawinglayer::attribute const drawinglayer::attribute::FillGradientAttribute& SdrAllFillAttributesHelper::getFillGradientAttribute() const { - if(!maFillGradientAttribute.get()) + if(!maFillGradientAttribute) { const_cast< SdrAllFillAttributesHelper* >(this)->maFillGradientAttribute = std::make_shared(); @@ -154,7 +154,7 @@ namespace drawinglayer::attribute { basegfx::BColor aRetval(rFallback); - if(maFillAttribute.get() && !maFillAttribute->isDefault()) + if(maFillAttribute && !maFillAttribute->isDefault()) { const drawinglayer::attribute::FillGradientAttribute& rFillGradientAttribute = maFillAttribute->getGradient(); const drawinglayer::attribute::FillHatchAttribute& rFillHatchAttribute = maFillAttribute->getHatch(); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 3f836d4123cd..be60f5697ca1 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -838,7 +838,7 @@ bool SdrGrafObj::HasGDIMetaFile() const bool SdrGrafObj::isEmbeddedVectorGraphicData() const { - return GraphicType::Bitmap == GetGraphicType() && GetGraphic().getVectorGraphicData().get(); + return GraphicType::Bitmap == GetGraphicType() && GetGraphic().getVectorGraphicData(); } GDIMetaFile SdrGrafObj::getMetafileFromEmbeddedVectorGraphicData() const diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index f8484a81c2e6..fb3af5dd82ed 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -307,7 +307,7 @@ void SdrTableRTFParser::FillTable() RTFCellInfoPtr xCellInfo( (*xColumn)[nIdx] ); CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) ); - if( xCell.is() && xCellInfo.get() ) + if( xCell.is() && xCellInfo ) { const SfxPoolItem *pPoolItem = nullptr; if( xCellInfo->maItemSet.GetItemState(SDRATTR_TABLE_BORDER,false,&pPoolItem)==SfxItemState::SET) diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index 30f72d7fc3ac..a69dbf12592f 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -402,7 +402,7 @@ SfxItemState SwFormat::GetItemState( sal_uInt16 nWhich, bool bSrchInParent, cons const drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFill = getSdrAllFillAttributesHelper(); // check if the new fill attributes are used - if(aFill.get() && aFill->isUsed()) + if(aFill && aFill->isUsed()) { // if yes, fill the local SvxBrushItem using the new fill attributes // as good as possible to have an instance for the pointer to point @@ -435,7 +435,7 @@ SfxItemState SwFormat::GetBackgroundState(std::unique_ptr& rItem) const drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFill = getSdrAllFillAttributesHelper(); // check if the new fill attributes are used - if(aFill.get() && aFill->isUsed()) + if(aFill && aFill->isUsed()) { // if yes, fill the local SvxBrushItem using the new fill attributes // as good as possible to have an instance for the pointer to point @@ -765,7 +765,7 @@ IDocumentChartDataProviderAccess& SwFormat::getIDocumentChartDataProviderAccess( void SwFormat::GetGrabBagItem(uno::Any& rVal) const { - if (m_pGrabBagItem.get()) + if (m_pGrabBagItem) m_pGrabBagItem->QueryValue(rVal); else rVal <<= uno::Sequence(); @@ -773,7 +773,7 @@ void SwFormat::GetGrabBagItem(uno::Any& rVal) const void SwFormat::SetGrabBagItem(const uno::Any& rVal) { - if (!m_pGrabBagItem.get()) + if (!m_pGrabBagItem) m_pGrabBagItem = std::make_shared(); m_pGrabBagItem->PutValue(rVal, 0); diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index fa58d9ed789f..d871a8033410 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -1078,7 +1078,7 @@ void SwNumRule::dumpAsXml(xmlTextWriterPtr pWriter) const void SwNumRule::GetGrabBagItem(uno::Any& rVal) const { - if (mpGrabBagItem.get()) + if (mpGrabBagItem) mpGrabBagItem->QueryValue(rVal); else rVal <<= uno::Sequence(); @@ -1086,7 +1086,7 @@ void SwNumRule::GetGrabBagItem(uno::Any& rVal) const void SwNumRule::SetGrabBagItem(const uno::Any& rVal) { - if (!mpGrabBagItem.get()) + if (!mpGrabBagItem) mpGrabBagItem = std::make_shared(); mpGrabBagItem->PutValue(rVal, 0); diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx index 3af1b80d7596..cfca5ee5b27a 100644 --- a/sw/source/core/doc/swstylemanager.cxx +++ b/sw/source/core/doc/swstylemanager.cxx @@ -45,7 +45,7 @@ void SwStyleCache::addCompletePool( StylePool& rPool ) { std::unique_ptr pIter = rPool.createIterator(); std::shared_ptr pStyle = pIter->getNext(); - while( pStyle.get() ) + while( pStyle ) { OUString aName( StylePool::nameOf(pStyle) ); mMap[ aName ] = pStyle; @@ -129,7 +129,7 @@ std::shared_ptr SwStyleManager::getByName( const OUString& rName, if( !rpCache ) rpCache.reset(new SwStyleCache()); std::shared_ptr pStyle = rpCache->getByName( rName ); - if( !pStyle.get() ) + if( !pStyle ) { // Ok, ok, it's allowed to ask for uncached styles (from UNO) but it should not be done // during loading a document @@ -147,7 +147,7 @@ void SwStyleManager::getAllStyles( std::vector> &rSt // setup iterator, which skips unused styles and ignorable items std::unique_ptr pIter = rAutoPool.createIterator( true, true ); std::shared_ptr pStyle = pIter->getNext(); - while( pStyle.get() ) + while( pStyle ) { rStyles.push_back( pStyle ); diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index 6be756061b6d..9029f9348827 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -55,7 +55,7 @@ SwNoTextNode::~SwNoTextNode() /// and graphics-attributes. void SwNoTextNode::NewAttrSet( SwAttrPool& rPool ) { - OSL_ENSURE( !mpAttrSet.get(), "AttrSet is already set" ); + OSL_ENSURE( !mpAttrSet, "AttrSet is already set" ); SwAttrSet aNewAttrSet( rPool, aNoTextNodeSetRange ); // put names of parent style and conditional style: diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index a4253380c6cd..e5b0a4061d64 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1080,7 +1080,7 @@ SwContentNode::~SwContentNode() m_aCondCollListener.EndListeningAll(); m_pCondColl = nullptr; - if ( mpAttrSet.get() && mbSetModifyAtAttr ) + if ( mpAttrSet && mbSetModifyAtAttr ) const_cast(static_cast(mpAttrSet.get()))->SetModifyAtAttr( nullptr ); } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index f6475124cddf..ae9311d2231d 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2536,7 +2536,7 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) RES_FOOTER, false, reinterpret_cast(&pF) ); // reset fill information - if (maFillAttributes.get() && supportsFullDrawingLayerFillAttributeSet()) + if (maFillAttributes && supportsFullDrawingLayerFillAttributeSet()) { SfxItemIter aIter(*static_cast(pNew)->GetChgSet()); bool bReset(false); @@ -2555,7 +2555,7 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) else if(RES_FMT_CHG == nWhich) { // reset fill information on format change (e.g. style changed) - if (maFillAttributes.get() && supportsFullDrawingLayerFillAttributeSet()) + if (maFillAttributes && supportsFullDrawingLayerFillAttributeSet()) { maFillAttributes.reset(); } @@ -3517,7 +3517,7 @@ drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFrameFormat::getSdrAllF if (supportsFullDrawingLayerFillAttributeSet()) { // create FillAttributes on demand - if(!maFillAttributes.get()) + if(!maFillAttributes) { const_cast< SwFrameFormat* >(this)->maFillAttributes = std::make_shared(GetAttrSet()); } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index f89d9166e4a9..252101334374 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1848,7 +1848,7 @@ void SwFlyFrame::ActiveUnfloatButton(SwWrtShell* pWrtSh) SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin(); SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager(); SwFrameControlPtr pControl = rMngr.GetControl(FrameControlType::FloatingTable, this); - if (pControl.get() || pControl->GetWindow()) + if (pControl || pControl->GetWindow()) { pControl->GetWindow()->MouseButtonDown(MouseEvent()); } diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 4c41de8ed325..72d673b224d4 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -351,7 +351,7 @@ bool SwFlyFreeFrame::supportsAutoContour() const { const drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes(GetFormat()->getSdrAllFillAttributesHelper()); - if(aFillAttributes.get() && aFillAttributes->isUsed()) + if(aFillAttributes && aFillAttributes->isUsed()) { return false; } diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index d43191d63ecc..b55f56775bb2 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -207,7 +207,7 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE if (mpFrame->supportsFullDrawingLayerFillAttributeSet()) { drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes(mpFrame->getSdrAllFillAttributesHelper()); - if(aFillAttributes.get() && aFillAttributes->isUsed()) + if(aFillAttributes && aFillAttributes->isUsed()) { bUseNewFillProperties = true; // use SetCompletePaint if needed diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 8c9872b7743f..a77960ee3e98 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1717,7 +1717,7 @@ bool DrawFillAttributes( const basegfx::utils::B2DClipState& rClipState, vcl::RenderContext& rOut) { - if(rFillAttributes.get() && rFillAttributes->isUsed()) + if(rFillAttributes && rFillAttributes->isUsed()) { basegfx::B2DRange aPaintRange( rPaintRegion.GetOrigin().Left(), @@ -3052,7 +3052,7 @@ void SwRootFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const& { pHiddenPage = static_cast< const SwPageFrame* >( pHiddenPage->GetPrev() ); SwFrameControlPtr pControl = rMngr.GetControl( FrameControlType::PageBreak, pHiddenPage ); - if ( pControl.get() ) + if ( pControl ) pControl->ShowAll( false ); } } @@ -3765,7 +3765,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const { bBackgroundTransparent = true; } - else if(aFillAttributes.get() && aFillAttributes->isUsed()) + else if(aFillAttributes && aFillAttributes->isUsed()) { bBackgroundTransparent = aFillAttributes->isTransparent(); } @@ -3973,7 +3973,7 @@ void SwFlyFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const& const drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes(pSwFrameFormat->getSdrAllFillAttributesHelper()); // check if the new fill attributes are used - if(aFillAttributes.get() && aFillAttributes->isUsed()) + if(aFillAttributes && aFillAttributes->isUsed()) { bPaintCompleteBack = true; } @@ -6328,7 +6328,7 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP // #i125189# We are also done when the new DrawingLayer FillAttributes are used // or the FillStyle is set (different from drawing::FillStyle_NONE) - if(pOut && aFillAttributes.get()) + if(pOut && aFillAttributes) { if(aFillAttributes->isUsed()) { @@ -7023,7 +7023,7 @@ Color SwPageFrame::GetDrawBackgrdColor() const if ( GetBackgroundBrush( aFillAttributes, pBrushItem, pDummyColor, aDummyRect, true, /*bConsiderTextBox=*/false) ) { - if(aFillAttributes.get() && aFillAttributes->isUsed()) + if(aFillAttributes && aFillAttributes->isUsed()) { // let SdrAllFillAttributesHelper do the average color calculation return Color(aFillAttributes->getAverageColor(aGlobalRetoucheColor.getBColor())); @@ -7274,7 +7274,7 @@ bool SwFrame::GetBackgroundBrush( // transparence is at 100% while no fill is the criteria for derivation bool bNewDrawingLayerFillStyleIsUsedAndNotNoFill(false); - if(rFillAttributes.get()) + if(rFillAttributes) { // the new DrawingLayer FillStyle is used if(rFillAttributes->isUsed()) diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 5442f3f87922..463e7668f4e7 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -458,7 +458,7 @@ static void checkApplyParagraphMarkFormatToNumbering(SwFont* pNumFnt, SwTextForm // TODO: apparently Word can apply Character Style too, see testParagraphMark // Check each item and in case it should be ignored, then clear it. - if (pSet.get()) + if (pSet) { std::unique_ptr const pCleanedSet = pSet->Clone(); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index d105736ad5ff..decea02c4864 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2619,7 +2619,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) /// is a background brush and its color is *not* "no fill"/"auto fill". if( GetFrame()->GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, false, /*bConsiderTextBox=*/true ) ) { - if (aFillAttributes.get() && aFillAttributes->isUsed()) + if (aFillAttributes && aFillAttributes->isUsed()) { // First see if fill attributes provide a color. aColor = Color(aFillAttributes->getAverageColor(aGlobalRetoucheColor.getBColor())); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index d0f6ea3d94e5..6200eb040abd 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1139,7 +1139,7 @@ void SwTextNode::JoinPrev() // create an AttrSet with ranges for Frame-/Para/Char-attributes void SwTextNode::NewAttrSet( SwAttrPool& rPool ) { - OSL_ENSURE( !mpAttrSet.get(), "AttrSet is set after all" ); + OSL_ENSURE( !mpAttrSet, "AttrSet is set after all" ); SwAttrSet aNewAttrSet( rPool, aTextNodeSetRange ); // put names of parent style and conditional style: @@ -3939,7 +3939,7 @@ SwFormatColl* SwTextNode::ChgFormatColl( SwFormatColl *pNewColl ) } // reset fill information on parent style change - if(maFillAttributes.get()) + if(maFillAttributes) { maFillAttributes.reset(); } @@ -5274,7 +5274,7 @@ void SwTextNode::SwClientNotify( const SwModify& rModify, const SfxHint& rHint ) } // reset fill information - if (maFillAttributes.get() && pNewValue) + if (maFillAttributes && pNewValue) { const sal_uInt16 nWhich = pNewValue->Which(); bool bReset(RES_FMT_CHG == nWhich); // ..on format change (e.g. style changed) @@ -5334,7 +5334,7 @@ SwTextNode::MakeUnoObject() drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwTextNode::getSdrAllFillAttributesHelper() const { // create SdrAllFillAttributesHelper on demand - if(!maFillAttributes.get()) + if(!maFillAttributes) { const_cast< SwTextNode* >(this)->maFillAttributes = std::make_shared(GetSwAttrSet()); } diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 2dcb0dd9d457..51b3edd81cb6 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -954,7 +954,7 @@ void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint, pNewAttr = &rNewHint; bDestroyHint = false; } - else if ( pNewStyle.get() ) + else if ( pNewStyle ) { pNewAttr = MakeTextAttr( *rNode.GetDoc(), *pNewStyle, nPorStart, nPorEnd ); diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index c79e8baf3338..cbc5f4f396d7 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -493,7 +493,7 @@ void SwTextNode::RstTextAttr( { delAttributes.push_back(pHt); - if ( pStyleHandle.get() ) + if ( pStyleHandle ) { SwTextAttr* pNew = MakeTextAttr( *GetDoc(), *pStyleHandle, nAttrStart, nAttrEnd ); @@ -508,7 +508,7 @@ void SwTextNode::RstTextAttr( pHt->SetStart(nEnd); m_pSwpHints->NoteInHistory( pHt, true ); - if ( pStyleHandle.get() && nAttrStart < nEnd ) + if ( pStyleHandle && nAttrStart < nEnd ) { SwTextAttr* pNew = MakeTextAttr( *GetDoc(), *pStyleHandle, nAttrStart, nEnd ); @@ -536,7 +536,7 @@ void SwTextNode::RstTextAttr( pHt->SetEnd(nStt); m_pSwpHints->NoteInHistory( pHt, true ); - if ( pStyleHandle.get() ) + if ( pStyleHandle ) { SwTextAttr* pNew = MakeTextAttr( *GetDoc(), *pStyleHandle, nStt, nAttrEnd ); @@ -558,7 +558,7 @@ void SwTextNode::RstTextAttr( pHt->SetEnd(nStt); m_pSwpHints->NoteInHistory( pHt, true ); - if ( pStyleHandle.get() && nStt < nEnd ) + if ( pStyleHandle && nStt < nEnd ) { SwTextAttr* pNew = MakeTextAttr( *GetDoc(), *pStyleHandle, nStt, nEnd ); diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index 5a38afee94b7..61629e087bc7 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -62,7 +62,7 @@ UndoManager::UndoManager(std::shared_ptr const & xUndoNodes, , m_pDocShell(nullptr) , m_pView(nullptr) { - assert(m_xUndoNodes.get()); + assert(bool(m_xUndoNodes)); // writer expects it to be disabled initially // Undo is enabled by SwEditShell constructor SdrUndoManager::EnableUndo(false); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index c3690beab846..5b6a296c6065 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -213,7 +213,7 @@ lcl_setAutoStyle(IStyleAccess & rStyleAccess, const uno::Any & rValue, std::shared_ptr pStyle = bPara ? rStyleAccess.getByName(uStyle, IStyleAccess::AUTO_STYLE_PARA ): rStyleAccess.getByName(uStyle, IStyleAccess::AUTO_STYLE_CHAR ); - if(!pStyle.get()) + if(!pStyle) { throw lang::IllegalArgumentException(); } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index f43ba36c59a7..fedbf6ece9ac 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3933,7 +3933,7 @@ void SwXAutoStyle::setPropertyValues( uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl( const uno::Sequence< OUString > & rPropertyNames ) { - if( !mpSet.get() ) + if( !mpSet ) { throw uno::RuntimeException(); } @@ -4131,7 +4131,7 @@ uno::Any SwXAutoStyle::getPropertyDefault( const OUString& rPropertyName ) uno::Sequence< beans::PropertyState > SwXAutoStyle::getPropertyStates( const uno::Sequence< OUString >& rPropertyNames ) { - if (!mpSet.get()) + if (!mpSet) { throw uno::RuntimeException(); } @@ -4230,7 +4230,7 @@ uno::Sequence< uno::Any > SwXAutoStyle::getPropertyDefaults( uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() { - if( !mpSet.get() ) + if( !mpSet ) throw uno::RuntimeException(); SolarMutexGuard aGuard; std::vector< beans::PropertyValue > aPropertyVector; diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index fa70b2767f09..83a02160b6ef 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1669,7 +1669,7 @@ void HTMLEndPosLst::InsertNoScript( const SfxPoolItem& rItem, { const SwFormatAutoFormat& rAutoFormat = static_cast(rItem); const std::shared_ptr& pSet = rAutoFormat.GetStyleHandle(); - if( pSet.get() ) + if( pSet ) Insert( *pSet, nStart, nEnd, rFormatInfos, true, bParaAttrs ); } break; diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index c42bc5eedfd2..9104497ccd2e 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -2859,7 +2859,7 @@ public: bool bReadOpt ); void AddContents( std::unique_ptr pNewCnts ); - bool HasFirstContents() const { return m_xCnts.get(); } + bool HasFirstContents() const { return bool(m_xCnts); } void ClearIsInSection() { m_pCurrCnts = nullptr; } bool IsInSection() const { return m_pCurrCnts!=nullptr; } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 94f4842029a0..940642a816d4 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -505,7 +505,7 @@ SwHTMLParser::~SwHTMLParser() DeleteFormImpl(); m_pFootEndNoteImpl.reset(); - OSL_ENSURE(!m_xTable.get(), "It exists still an open table"); + OSL_ENSURE(!m_xTable, "It exists still an open table"); m_pImageMaps.reset(); OSL_ENSURE( m_vPendingStack.empty(), @@ -1753,7 +1753,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken ) { if( m_nOpenParaToken != HtmlTokenId::NONE ) EndPara(); - OSL_ENSURE(!m_xTable.get(), "table in table not allowed here"); + OSL_ENSURE(!m_xTable, "table in table not allowed here"); if( !m_xTable && (IsNewDoc() || !m_pPam->GetNode().FindTableNode()) && (m_pPam->GetPoint()->nNode.GetIndex() > m_xDoc->GetNodes().GetEndOfExtras().GetIndex() || diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 16c9e518f544..f5551f90ce57 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -388,7 +388,7 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText m_nColBreakStatus = COLBRK_WRITE; // Output table/table row/table cell starts if needed - if ( pTextNodeInfo.get() ) + if ( pTextNodeInfo ) { // New cell/row? if ( m_tableReference->m_nTableDepth > 0 && !m_tableReference->m_bTableCellOpen ) @@ -912,7 +912,7 @@ void DocxAttributeOutput::SyncNodelessCells(ww8::WW8TableNodeInfoInner::Pointer_ void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t const & pInner, bool bForceEmptyParagraph ) { - if ( pInner.get() ) + if ( pInner ) { // Where are we in the table sal_uInt32 nRow = pInner->getRow(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index ebb5bd5d66d5..e2e75a4d78ab 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -382,7 +382,7 @@ bool BasicProjImportHelper::import( const uno::Reference< io::XInputStream >& rx { oox::ole::OleStorage root( mxCtx, rxIn, false ); oox::StorageRef vbaStg = root.openSubStorage( "Macros" , false ); - if ( vbaStg.get() ) + if ( vbaStg ) { oox::ole::VbaProject aVbaPrj( mxCtx, mrDocShell.GetModel(), "Writer" ); bRet = aVbaPrj.importVbaProject( *vbaStg ); diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 3cb4f4e335f9..f41121945dd2 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -302,7 +302,7 @@ bool Customization::ImportMenu( SwCTBWrapper& rWrapper, CustomToolBarImportHelpe aPopupMenu[3].Name = "ItemDescriptorContainer"; uno::Reference< container::XIndexContainer > xMenuContainer( xSCF->createInstanceWithContext( xContext ), uno::UNO_QUERY_THROW ); aPopupMenu[3].Value <<= xMenuContainer; - if ( pCust->customizationDataCTB.get() && !pCust->customizationDataCTB->ImportMenuTB( rWrapper, xMenuContainer, helper ) ) + if ( pCust->customizationDataCTB && !pCust->customizationDataCTB->ImportMenuTB( rWrapper, xMenuContainer, helper ) ) return false; SAL_INFO("sw.ww8","** there are " << xIndexContainer->getCount() << " menu items on the bar, inserting after that"); xIndexContainer->insertByIndex( xIndexContainer->getCount(), uno::makeAny( aPopupMenu ) ); @@ -326,7 +326,7 @@ bool Customization::ImportCustomToolBar( SwCTBWrapper& rWrapper, CustomToolBarIm { if ( tbidForTBD == 0x25 ) return ImportMenu( rWrapper, helper ); - if ( !customizationDataCTB.get() ) + if ( !customizationDataCTB ) return false; if ( !customizationDataCTB->IsMenuToolbar() ) { @@ -512,7 +512,7 @@ SwTBC::ImportToolBarControl( SwCTBWrapper& rWrapper, const css::uno::Reference< // cmtNil 0x7 No command. See Cid. bool bBuiltin = false; sal_Int16 cmdId = 0; - if ( cid.get() ) + if ( cid ) { const sal_uInt32 nCid = ( *cid & 0xFFFF ); @@ -541,7 +541,7 @@ SwTBC::ImportToolBarControl( SwCTBWrapper& rWrapper, const css::uno::Reference< } } - if ( tbcd.get() ) + if ( tbcd ) { std::vector< css::beans::PropertyValue > props; if ( bBuiltin ) @@ -605,7 +605,7 @@ SwTBC::ImportToolBarControl( SwCTBWrapper& rWrapper, const css::uno::Reference< OUString SwTBC::GetCustomText() { - if ( tbcd.get() ) + if ( tbcd ) return tbcd->getGeneralInfo().CustomText(); return OUString(); } diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx index ca803eaf8e80..af04be582cda 100644 --- a/sw/source/ui/vba/vbadocumentproperties.cxx +++ b/sw/source/ui/vba/vbadocumentproperties.cxx @@ -370,19 +370,19 @@ public: } uno::Any getValue() { - if ( mpPropGetSetHelper.get() ) + if ( mpPropGetSetHelper ) return mpPropGetSetHelper->getPropertyValue( msOOOPropName ); return uno::Any(); } void setValue( const uno::Any& rValue ) { - if ( mpPropGetSetHelper.get() ) + if ( mpPropGetSetHelper ) mpPropGetSetHelper->setPropertyValue( msOOOPropName, rValue ); } uno::Reference< beans::XPropertySet > getUserDefinedProperties() { uno::Reference< beans::XPropertySet > xProps; - if ( mpPropGetSetHelper.get() ) + if ( mpPropGetSetHelper ) return mpPropGetSetHelper->getUserDefinedProperties(); return xProps; } diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index e8bfe164cdca..d92879eb3c0e 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -610,7 +610,7 @@ void SwMailMergeWizardExecutor::EndDialogHdl(sal_Int32 nRet) default: // finish { std::shared_ptr xMMConfig = m_pView->GetMailMergeConfigItem(); - SwView* pSourceView = xMMConfig.get() ? xMMConfig->GetSourceView() : nullptr; + SwView* pSourceView = xMMConfig ? xMMConfig->GetSourceView() : nullptr; if(pSourceView) { xMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear(); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 88d45a8141bc..8cb4910502c5 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -6179,7 +6179,7 @@ bool SwEditWin::IsInHeaderFooter( const Point &rDocPt, FrameControlType &rContro if ( rSh.IsShowHeaderFooterSeparator( FrameControlType::Header ) ) { SwFrameControlPtr pControl = rMgr.GetControl( FrameControlType::Header, pPageFrame ); - if ( pControl.get() && pControl->Contains( aPoint ) ) + if ( pControl && pControl->Contains( aPoint ) ) { rControl = FrameControlType::Header; return true; @@ -6189,7 +6189,7 @@ bool SwEditWin::IsInHeaderFooter( const Point &rDocPt, FrameControlType &rContro if ( rSh.IsShowHeaderFooterSeparator( FrameControlType::Footer ) ) { SwFrameControlPtr pControl = rMgr.GetControl( FrameControlType::Footer, pPageFrame ); - if ( pControl.get() && pControl->Contains( aPoint ) ) + if ( pControl && pControl->Contains( aPoint ) ) { rControl = FrameControlType::Footer; return true; diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index e994505427f0..8d458f016806 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -217,7 +217,7 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr const tools::Rectangle aDefineRect(aRect); const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes = getPageFillAttributes(); - if (!rFillAttributes.get() || !rFillAttributes->isUsed()) + if (!rFillAttributes || !rFillAttributes->isUsed()) { // If there is no fill, use fallback color const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index 655df73be012..51ced99ea3cc 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -265,7 +265,7 @@ void VCLXPrinter::end( ) { ::osl::MutexGuard aGuard( Mutex ); - if (mxListener.get()) + if (mxListener) { Printer::PrintJob(mxListener, maInitJobSetup); mxListener.reset(); @@ -283,7 +283,7 @@ css::uno::Reference< css::awt::XDevice > VCLXPrinter::startPage( ) { ::osl::MutexGuard aGuard( Mutex ); - if (mxListener.get()) + if (mxListener) { mxListener->StartPage(); } @@ -294,7 +294,7 @@ void VCLXPrinter::endPage( ) { ::osl::MutexGuard aGuard( Mutex ); - if (mxListener.get()) + if (mxListener) { mxListener->EndPage(); } diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 4b7fa6897468..3c14bb4056ee 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -480,12 +480,12 @@ sal_Bool SAL_CALL librdf_GraphResult::hasMoreElements() { ::osl::MutexGuard g(m_rMutex); - return m_pStream.get() && !librdf_stream_end(m_pStream.get()); + return m_pStream && !librdf_stream_end(m_pStream.get()); } librdf_node* librdf_GraphResult::getContext_Lock() const { - if (!m_pStream.get() || librdf_stream_end(m_pStream.get())) + if (!m_pStream || librdf_stream_end(m_pStream.get())) return nullptr; librdf_node *pCtxt( #if LIBRDF_VERSION >= 10012 @@ -502,7 +502,7 @@ css::uno::Any SAL_CALL librdf_GraphResult::nextElement() { ::osl::MutexGuard g(m_rMutex); - if (m_pStream.get() && librdf_stream_end(m_pStream.get())) { + if (m_pStream && librdf_stream_end(m_pStream.get())) { throw container::NoSuchElementException(); } librdf_node * pCtxt = getContext_Lock(); diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index abb9731b6d45..cd3a56a7ae00 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -569,7 +569,7 @@ BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( BitmapAccessMode nMode ) if( nMode != BitmapAccessMode::Info ) { - if (!mpUserBuffer.get()) + if (!mpUserBuffer) { if( !AllocateUserData() ) return nullptr; diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index f6e14e55ecd8..26f743cfa311 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -72,7 +72,7 @@ bool VclFiltersTest::load(const OUString &, // other format will work (what may be wanted). For the test framework it was indirectly // intended to trigger an error when load in the sense of deep data interpretation fails, // so we need to trigger this here - if (aGraphic.getVectorGraphicData().get()) + if (aGraphic.getVectorGraphicData()) { if (aGraphic.getVectorGraphicData()->getRange().isEmpty()) { diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 54abc46a0dad..e06663706d6e 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -209,7 +209,7 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) : } ImpGraphic::ImpGraphic(const std::shared_ptr& rVectorGraphicDataPtr) -: meType( rVectorGraphicDataPtr.get() ? GraphicType::Bitmap : GraphicType::NONE ), +: meType( rVectorGraphicDataPtr ? GraphicType::Bitmap : GraphicType::NONE ), mnSizeBytes( 0 ), mbSwapOut( false ), mbDummyContext ( false ), @@ -344,7 +344,7 @@ bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const case GraphicType::Bitmap: { - if(maVectorGraphicData.get()) + if(maVectorGraphicData) { if(maVectorGraphicData == rImpGraphic.maVectorGraphicData) { @@ -489,7 +489,7 @@ bool ImpGraphic::ImplIsTransparent() const { bRet = maSwapInfo.mbIsTransparent; } - else if (meType == GraphicType::Bitmap && !maVectorGraphicData.get()) + else if (meType == GraphicType::Bitmap && !maVectorGraphicData) { bRet = mpAnimation ? mpAnimation->IsTransparent() : maBitmapEx.IsTransparent(); } @@ -505,7 +505,7 @@ bool ImpGraphic::ImplIsAlpha() const { bRet = maSwapInfo.mbIsAlpha; } - else if (maVectorGraphicData.get()) + else if (maVectorGraphicData) { bRet = true; } @@ -562,7 +562,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) if( meType == GraphicType::Bitmap ) { - if(maVectorGraphicData.get() && maBitmapEx.IsEmpty()) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { // use maBitmapEx as local buffer for rendered svg const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement(); @@ -671,7 +671,7 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet if( meType == GraphicType::Bitmap ) { - if(maVectorGraphicData.get() && maBitmapEx.IsEmpty()) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { // use maBitmapEx as local buffer for rendered svg const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement(); @@ -723,7 +723,7 @@ const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const { ensureAvailable(); if (!maMetaFile.GetActionSize() - && maVectorGraphicData.get() + && maVectorGraphicData && (VectorGraphicDataType::Emf == maVectorGraphicData->getVectorGraphicDataType() || VectorGraphicDataType::Wmf == maVectorGraphicData->getVectorGraphicDataType())) { @@ -758,7 +758,7 @@ const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const // survive copying (change this if not wanted) ImpGraphic* pThat = const_cast< ImpGraphic* >(this); - if(maVectorGraphicData.get() && !maBitmapEx) + if(maVectorGraphicData && !maBitmapEx) { // use maBitmapEx as local buffer for rendered svg pThat->maBitmapEx = getVectorGraphicReplacement(); @@ -814,7 +814,7 @@ Size ImpGraphic::ImplGetPrefSize() const case GraphicType::Bitmap: { - if(maVectorGraphicData.get() && maBitmapEx.IsEmpty()) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { if (!maExPrefSize.getWidth() || !maExPrefSize.getHeight()) { @@ -866,7 +866,7 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize ) { // used when importing a writer FlyFrame with SVG as graphic, added conversion // to allow setting the PrefSize at the BitmapEx to hold it - if(maVectorGraphicData.get() && maBitmapEx.IsEmpty()) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { maExPrefSize = rPrefSize; } @@ -912,7 +912,7 @@ MapMode ImpGraphic::ImplGetPrefMapMode() const case GraphicType::Bitmap: { - if(maVectorGraphicData.get() && maBitmapEx.IsEmpty()) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { // svg not yet buffered in maBitmapEx, return default PrefMapMode aMapMode = MapMode(MapUnit::Map100thMM); @@ -951,7 +951,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode ) case GraphicType::Bitmap: { - if(maVectorGraphicData.get()) + if(maVectorGraphicData) { // ignore for Vector Graphic Data. If this is really used (except the grfcache) // it can be extended by using maBitmapEx as buffer for getVectorGraphicReplacement() @@ -989,7 +989,7 @@ sal_uLong ImpGraphic::ImplGetSizeBytes() const if( meType == GraphicType::Bitmap ) { - if(maVectorGraphicData.get()) + if(maVectorGraphicData) { std::pair tmp(maVectorGraphicData->getSizeBytes()); if (VectorGraphicData::State::UNPARSED == tmp.first) @@ -1024,7 +1024,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const case GraphicType::Bitmap: { - if(maVectorGraphicData.get() && !maBitmapEx) + if(maVectorGraphicData && !maBitmapEx) { // use maEx as local buffer for rendered svg const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement(); @@ -1061,7 +1061,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, case GraphicType::Bitmap: { - if(maVectorGraphicData.get() && maBitmapEx.IsEmpty()) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { // use maEx as local buffer for rendered svg const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement(); @@ -1208,7 +1208,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) { if( meType == GraphicType::Bitmap ) { - if(maVectorGraphicData.get() && maBitmapEx.IsEmpty()) + if(maVectorGraphicData && maBitmapEx.IsEmpty()) { // use maBitmapEx as local buffer for rendered svg maBitmapEx = getVectorGraphicReplacement(); @@ -1820,7 +1820,7 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic) case GraphicType::Bitmap: { - if(rImpGraphic.getVectorGraphicData().get()) + if(rImpGraphic.getVectorGraphicData()) { // stream out Vector Graphic defining data (length, byte array and evtl. path) // this is used e.g. in swapping out graphic data and in transporting it over UNO API diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index b067475c7620..da7e78dcbcd9 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -389,8 +389,8 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc case PDFExtOutDevDataSync::CreateControl: { std::shared_ptr< PDFWriter::AnyWidget > pControl( mControls.front() ); - SAL_WARN_IF( !pControl.get(), "vcl", "PageSyncData::PlaySyncPageAct: invalid widget!" ); - if ( pControl.get() ) + SAL_WARN_IF( !pControl, "vcl", "PageSyncData::PlaySyncPageAct: invalid widget!" ); + if ( pControl ) rWriter.CreateControl( *pControl ); mControls.pop_front(); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 10758d84d639..a09a5fcf5599 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9193,7 +9193,7 @@ void PDFWriterImpl::createEmbeddedFile(const Graphic& rGraphic, ReferenceXObject // no pdf data. rEmit.m_nBitmapObject = nBitmapObject; - if (!rGraphic.getVectorGraphicData().get() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf) + if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf) return; sal_uInt32 nLength = rGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength(); @@ -9268,7 +9268,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const { m_aJPGs.emplace( m_aJPGs.begin() ); JPGEmit& rEmit = m_aJPGs.front(); - if (!rGraphic.getVectorGraphicData().get() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject) + if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject) rEmit.m_nObject = createObject(); rEmit.m_aID = aID; rEmit.m_pStream = std::move( pStream ); @@ -9372,7 +9372,7 @@ const BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap, co m_aBitmaps.push_front( BitmapEmit() ); m_aBitmaps.front().m_aID = aID; m_aBitmaps.front().m_aBitmap = aBitmap; - if (!rGraphic.getVectorGraphicData().get() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject) + if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject) m_aBitmaps.front().m_nObject = createObject(); createEmbeddedFile(rGraphic, m_aBitmaps.front().m_aReferenceXObject, m_aBitmaps.front().m_nObject); it = m_aBitmaps.begin(); diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 460a30d5203a..4ebabaa5b0b5 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -227,7 +227,7 @@ namespace vcl { bool vcl::Region::IsEmpty() const { - return !mbIsNull && !mpB2DPolyPolygon.get() && !mpPolyPolygon.get() && !mpRegionBand.get(); + return !mbIsNull && !mpB2DPolyPolygon && !mpPolyPolygon && !mpRegionBand; } diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx index 9c7173158184..d8c6e774d363 100644 --- a/vcl/source/graphic/UnoGraphicProvider.cxx +++ b/vcl/source/graphic/UnoGraphicProvider.cxx @@ -596,7 +596,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, const uno::Sequence< beans::Prope } if ( rGraphic.GetType() == GraphicType::Bitmap ) { - if(rGraphic.getVectorGraphicData().get()) + if(rGraphic.getVectorGraphicData()) { // embedded Vector Graphic Data, no need to scale. Also no method to apply crop data currently } diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 5e14545b9e11..5cc8cc745d95 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -257,7 +257,7 @@ sal_Bool WriterFilter::filter(const uno::Sequence& rDescri pDocStream, writerfilter::ooxml::OOXMLStream::VBAPROJECT)); oox::StorageRef xVbaPrjStrg = std::make_shared<::oox::ole::OleStorage>( m_xContext, pVBAProjectStream->getDocumentStream(), false); - if (xVbaPrjStrg.get() && xVbaPrjStrg->isStorage()) + if (xVbaPrjStrg && xVbaPrjStrg->isStorage()) { ::oox::ole::VbaProject aVbaProject(m_xContext, xModel, "Writer"); uno::Reference xFrame = aMediaDesc.getUnpackedValueOrDefault( diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index e174a0973bd8..1624b023ff34 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -838,7 +838,7 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference pAttributes( ParseRDFa(i_rAbout, i_rProperty, i_rContent, i_rDatatype) ); - if (pAttributes.get()) + if (pAttributes) { AddRDFa(i_xObject, pAttributes); } diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index b2ffc284cfd2..8df080843e63 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -355,7 +355,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) OUString sDefaultCellStyle; // table:style-name - if( xTableInfo.get() ) + if( xTableInfo ) { Reference< XInterface > xKey( xCellRange, UNO_QUERY ); const OUString sStyleName( xTableInfo->maRowStyleMap[xKey] ); @@ -400,7 +400,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if ( xColumnProperties.is() ) { // table:style-name - if( rTableInfo.get() ) + if( rTableInfo ) { Reference< XInterface > xKey( xColumnProperties, UNO_QUERY ); const OUString sStyleName( rTableInfo->maColumnStyleMap[xKey] ); @@ -426,7 +426,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) try { - if( rTableInfo.get() ) + if( rTableInfo ) { // table:style-name Reference< XInterface > xKey( xCell, UNO_QUERY ); diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index c9442ae769f2..0c29b44e0a7f 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -593,7 +593,7 @@ void XMLTableImportContext::EndElement() { for( const std::shared_ptr< MergeInfo >& xInfo : maMergeInfos ) { - if( xInfo.get() ) try + if( xInfo ) try { Reference< XCellRange > xRange( mxTable->getCellRangeByPosition( xInfo->mnStartColumn, xInfo->mnStartRow, xInfo->mnEndColumn, xInfo->mnEndRow ) ); Reference< XMergeableCellRange > xCursor( mxTable->createCursorByRange( xRange ), UNO_QUERY_THROW ); -- cgit v1.2.3