diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-17 18:24:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-18 08:16:49 +0100 |
commit | d8326e80c6f5a6d393c1d18479c31c81ca1d9239 (patch) | |
tree | e04dde7fb89e7202c89e57e39fe11dcd90ebf17f /sax | |
parent | 466ec5aa2afca2d8eb3ee509bbb7753f2aec7544 (diff) |
loplugin:referencecasting in sax
Change-Id: Ie7371b2c6ed340ce8417af03aa4f7b60890392ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111081
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/qa/cppunit/parser.cxx | 2 | ||||
-rw-r--r-- | sax/qa/cppunit/xmlimport.cxx | 8 | ||||
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 2 | ||||
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 5 | ||||
-rw-r--r-- | sax/source/fastparser/legacyfastparser.cxx | 10 |
5 files changed, 13 insertions, 14 deletions
diff --git a/sax/qa/cppunit/parser.cxx b/sax/qa/cppunit/parser.cxx index b0997bab3abe..261091fe8769 100644 --- a/sax/qa/cppunit/parser.cxx +++ b/sax/qa/cppunit/parser.cxx @@ -67,7 +67,7 @@ void ParserTest::setUp() test::BootstrapFixture::setUp(); mxTokenHandler.set( new DummyTokenHandler() ); mxParser.set( new sax_fastparser::FastSaxParser() ); - mxParser->setTokenHandler( mxTokenHandler.get() ); + mxParser->setTokenHandler( mxTokenHandler ); } uno::Reference< io::XInputStream > ParserTest::createStream(const OString& sInput) diff --git a/sax/qa/cppunit/xmlimport.cxx b/sax/qa/cppunit/xmlimport.cxx index 459dcd09bd27..3da498ecded4 100644 --- a/sax/qa/cppunit/xmlimport.cxx +++ b/sax/qa/cppunit/xmlimport.cxx @@ -350,10 +350,10 @@ void XMLImportTest::setUp() Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); m_xDocumentHandler.set( new TestDocumentHandler() ); m_xParser = Parser::create( xContext ); - m_xParser->setDocumentHandler( m_xDocumentHandler.get() ); + m_xParser->setDocumentHandler( m_xDocumentHandler ); m_xLegacyFastParser.set( xContext->getServiceManager()->createInstanceWithContext ( "com.sun.star.xml.sax.LegacyFastParser", xContext ), UNO_QUERY ); - m_xLegacyFastParser->setDocumentHandler( m_xDocumentHandler.get() ); + m_xLegacyFastParser->setDocumentHandler( m_xDocumentHandler ); Reference< XFastTokenHandler > xTokenHandler; xTokenHandler.set( new DummyTokenHandler ); @@ -438,14 +438,14 @@ void XMLImportTest::testIllegalNamespaceUse() { rtl::Reference< NSDocumentHandler > m_xNSDocumentHandler; m_xNSDocumentHandler.set( new NSDocumentHandler() ); - m_xParser->setDocumentHandler( m_xNSDocumentHandler.get() ); + m_xParser->setDocumentHandler( m_xNSDocumentHandler ); InputSource source; source.sSystemId = "internal"; source.aInputStream = createStreamFromFile( m_sDirPath + "multiplepfx.xml" ); m_xParser->parseStream(source); - m_xLegacyFastParser->setDocumentHandler( m_xNSDocumentHandler.get() ); + m_xLegacyFastParser->setDocumentHandler( m_xNSDocumentHandler ); source.aInputStream = createStreamFromFile( m_sDirPath + "multiplepfx.xml" ); m_xLegacyFastParser->parseStream(source); } diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 885d9757dc43..6017dc354001 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -718,7 +718,7 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis , CALL_ELEMENT_HANDLER_AND_CARE_FOR_EXCEPTIONS( pImpl , rDocumentHandler->startElement( XML_CHAR_TO_OUSTRING( pwName ) , - pImpl->rAttrList.get() ) ); + pImpl->rAttrList ) ); } void SaxExpatParser_Impl::callbackEndElement( void *pvThis , const XML_Char *pwName ) diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index e225f17a1621..f35e56e8ab7f 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -433,7 +433,7 @@ void Entity::startElement( Event const *pEvent ) try { - Reference< XFastAttributeList > xAttr( pEvent->mxAttributes.get() ); + Reference< XFastAttributeList > xAttr( pEvent->mxAttributes ); Reference< XFastContextHandler > xContext; if ( mxNamespaceHandler.is() ) @@ -834,8 +834,7 @@ void FastSaxParserImpl::parseStream(const InputSource& rStructSource) // start the document if( rEntity.mxDocumentHandler.is() ) { - Reference< XLocator > xLoc( mxDocumentLocator.get() ); - rEntity.mxDocumentHandler->setDocumentLocator( xLoc ); + rEntity.mxDocumentHandler->setDocumentLocator( mxDocumentLocator ); rEntity.mxDocumentHandler->startDocument(); } diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx index e1aac8df6c9c..c748eb057fbe 100644 --- a/sax/source/fastparser/legacyfastparser.cxx +++ b/sax/source/fastparser/legacyfastparser.cxx @@ -180,7 +180,7 @@ CallbackDocumentHandler::CallbackDocumentHandler( Reference< XDocumentHandler > Reference< XFastTokenHandler > const & xTokenHandler) { m_xDocumentHandler.set( xDocumentHandler ); - m_aNamespaceHandler.set( rNamespaceHandler.get() ); + m_aNamespaceHandler = rNamespaceHandler; m_xTokenHandler.set( xTokenHandler ); } @@ -244,7 +244,7 @@ void SAL_CALL CallbackDocumentHandler::startUnknownElement( const OUString& /*Na rAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); } - m_xDocumentHandler->startElement( Name, rAttrList.get() ); + m_xDocumentHandler->startElement( Name, rAttrList ); } void SAL_CALL CallbackDocumentHandler::endFastElement( sal_Int32 nElement ) @@ -283,7 +283,7 @@ void SAL_CALL CallbackDocumentHandler::characters( const OUString& aChars ) SaxLegacyFastParser::SaxLegacyFastParser( ) : m_aNamespaceHandler( new NamespaceHandler ), m_xParser(FastParser::create(::comphelper::getProcessComponentContext() )) { - m_xParser->setNamespaceHandler( m_aNamespaceHandler.get() ); + m_xParser->setNamespaceHandler( m_aNamespaceHandler ); } void SAL_CALL SaxLegacyFastParser::initialize(Sequence< Any > const& rArguments ) @@ -316,8 +316,8 @@ void SAL_CALL SaxLegacyFastParser::initialize(Sequence< Any > const& rArguments void SaxLegacyFastParser::parseStream( const InputSource& structSource ) { - m_xParser->setFastDocumentHandler( new CallbackDocumentHandler( m_xDocumentHandler.get(), - m_aNamespaceHandler.get(), m_xTokenHandler.get() ) ); + m_xParser->setFastDocumentHandler( new CallbackDocumentHandler( m_xDocumentHandler, + m_aNamespaceHandler, m_xTokenHandler ) ); m_xParser->setTokenHandler( m_xTokenHandler ); m_xParser->parseStream( structSource ); } |