diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-15 20:02:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-16 07:52:03 +0100 |
commit | 99bc040b134c8cece576196fb338954ced7c0f24 (patch) | |
tree | fd9da19888fbbec2c41a71ae8419acbe285fd5a2 /oox | |
parent | d5bb28663dbca1ce48c22f4e7ac1ee6e7a6f597f (diff) |
loplugin:referencecasting in oox..package
Change-Id: I4276c6c45cb2478afbc0231a15c402ddcafd00a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110950
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/contexthandler2.cxx | 2 | ||||
-rw-r--r-- | oox/source/core/recordparser.cxx | 5 | ||||
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 10 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/backgroundproperties.cxx | 2 |
5 files changed, 9 insertions, 12 deletions
diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index b7924cc9fa4a..8ce9784b99ef 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -92,7 +92,7 @@ Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( // #i76091# process collected characters (calls onCharacters() if needed) processCollectedChars(); ContextHandlerRef xContext = onCreateContext( nElement, AttributeList( rxAttribs ) ); - return Reference< XFastContextHandler >( xContext.get() ); + return xContext; } void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) diff --git a/oox/source/core/recordparser.cxx b/oox/source/core/recordparser.cxx index 6d9d7b4e6004..d6f35facaf65 100644 --- a/oox/source/core/recordparser.cxx +++ b/oox/source/core/recordparser.cxx @@ -131,7 +131,7 @@ ContextHandlerRef ContextStack::getCurrentContext() const { if( !maStack.empty() ) return maStack.back().second; - return mxHandler.get(); + return mxHandler; } void ContextStack::pushContext( const RecordInfo& rRecInfo, const ContextHandlerRef& rxContext ) @@ -241,8 +241,7 @@ void RecordParser::parseStream( const RecordInputSource& rInputSource ) throw SAXException(); // start the document - Reference< XLocator > xLocator( mxLocator.get() ); - mxHandler->setDocumentLocator( xLocator ); + mxHandler->setDocumentLocator( mxLocator ); mxHandler->startDocument(); // parse the stream diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index fd425f3940ba..bb63873f5540 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -374,8 +374,7 @@ bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHan } // get the XFastDocumentHandler interface from the fragment handler - Reference< XFastDocumentHandler > xDocHandler( rxHandler.get() ); - if( !xDocHandler.is() ) + if( !rxHandler.is() ) return false; // try to import XML stream @@ -403,7 +402,7 @@ bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHan // own try/catch block for showing parser failure assertion with fragment path if( xInStrm.is() ) try { - rParser.setDocumentHandler(xDocHandler); + rParser.setDocumentHandler(rxHandler); rParser.parseStream(xInStrm, aFragmentPath); return true; } @@ -456,14 +455,13 @@ Reference<XDocument> XmlFilterBase::importFragment( const OUString& aFragmentPat bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& rxHandler, const Reference< XFastSAXSerializable >& rxSerializer ) { - Reference< XFastDocumentHandler > xDocHandler( rxHandler.get() ); - if( !xDocHandler.is() ) + if( !rxHandler.is() ) return false; // try to import XML stream try { - rxSerializer->fastSerialize( xDocHandler, + rxSerializer->fastSerialize( rxHandler, mxImpl->maFastParser.getTokenHandler(), Sequence< StringPair >(), NamespaceIds::get() ); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 86c57f86acc1..a6316cee1278 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -5016,7 +5016,7 @@ void DrawingML::WriteFromTo(const uno::Reference<css::drawing::XShape>& rXShape, awt::Point aTopLeft = rXShape->getPosition(); awt::Size aSize = rXShape->getSize(); - SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape.get()); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape); if (pObj) { Degree100 nRotation = pObj->GetRotateAngle(); diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx index 2ffde9e5e038..9fe25661205d 100644 --- a/oox/source/ppt/backgroundproperties.cxx +++ b/oox/source/ppt/backgroundproperties.cxx @@ -42,7 +42,7 @@ BackgroundPropertiesContext::BackgroundPropertiesContext( FragmentHandler2 const return this; } - return ::oox::drawingml::FillPropertiesContext::createFillContext( *this, aElementToken, rAttribs, mrFillProperties ).get(); + return ::oox::drawingml::FillPropertiesContext::createFillContext( *this, aElementToken, rAttribs, mrFillProperties ); } } |