diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-05-26 20:42:08 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-05-26 22:33:02 +0200 |
commit | fe6cce01c88d045a1fcf09acf049c34c22299b02 (patch) | |
tree | c118594a43386096bca55179f31b2b61e64dfa48 /oox | |
parent | b894a3d7f991dd248dfd8935b31da8bccfd130b2 (diff) |
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 <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'oox')
25 files changed, 107 insertions, 107 deletions
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<table::TableProperties>(); 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<TextBody>( *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<SharedConfigData>( 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<TextListStyle>(); 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<TextListStyle>(); 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<oox::drawingml::ClrMap>() : std::make_shared<oox::drawingml::ClrMap>( *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; |