[Libreoffice-commits] core.git: 2 commits - sax/qa sax/source xmlscript/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 18 07:17:25 UTC 2021


 sax/qa/cppunit/parser.cxx                        |    2 +-
 sax/qa/cppunit/xmlimport.cxx                     |    8 ++++----
 sax/source/expatwrap/sax_expat.cxx               |    2 +-
 sax/source/fastparser/fastparser.cxx             |    5 ++---
 sax/source/fastparser/legacyfastparser.cxx       |   10 +++++-----
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx  |    6 +++---
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx |    2 +-
 xmlscript/source/xmllib_imexp/xmllib_export.cxx  |    6 +++---
 xmlscript/source/xmllib_imexp/xmllib_import.cxx  |    2 +-
 9 files changed, 21 insertions(+), 22 deletions(-)

New commits:
commit d8326e80c6f5a6d393c1d18479c31c81ca1d9239
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Wed Feb 17 18:24:47 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Feb 18 08:16:49 2021 +0100

    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 at collabora.co.uk>

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 );
 }
commit 466ec5aa2afca2d8eb3ee509bbb7753f2aec7544
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Wed Feb 17 18:24:36 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Feb 18 08:16:36 2021 +0100

    loplugin:referencecasting in xmlscript
    
    Change-Id: Ib5c1f471e0b69e4474d06b4fb55c933d701a1d9d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111080
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 23dc6c0a90fc..77f606728d0a 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -1360,7 +1360,7 @@ void StyleBag::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOu
     for (auto const & _style : _styles)
     {
         Reference< xml::sax::XAttributeList > xAttr( _style->createElement() );
-        static_cast< ElementDescriptor * >( xAttr.get() )->dump( xOut.get() );
+        static_cast< ElementDescriptor * >( xAttr.get() )->dump( xOut );
     }
     xOut->ignorableWhitespace( OUString() );
     xOut->endElement( aStylesName );
@@ -1396,7 +1396,7 @@ void exportDialogModel(
     xOut->ignorableWhitespace( OUString() );
     xOut->startElement( aWindowName, xWindow );
      // dump out events
-    pWindow->dumpSubElements( xOut.get() );
+    pWindow->dumpSubElements( xOut );
     // dump out stylebag
     all_styles.dump( xOut );
 
@@ -1407,7 +1407,7 @@ void exportDialogModel(
         xOut->ignorableWhitespace( OUString() );
         xOut->startElement( aBBoardName, xElem );
 
-        pElem->dumpSubElements( xOut.get() );
+        pElem->dumpSubElements( xOut );
         // end bulletinboard
         xOut->ignorableWhitespace( OUString() );
         xOut->endElement( aBBoardName );
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index 4b9251494f70..8a7ade47d61a 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -136,7 +136,7 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /
                 // try the XEmbeddedScripts interface
                 Reference< document::XEmbeddedScripts > xDocumentScripts( m_xModel, UNO_QUERY );
                 if ( xDocumentScripts.is() )
-                    xLibContainer.set( xDocumentScripts->getBasicLibraries().get() );
+                    xLibContainer = xDocumentScripts->getBasicLibraries();
 
                 if ( !xLibContainer.is() )
                 {
diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
index 828db4ee2e64..33e531ac14c5 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
@@ -79,7 +79,7 @@ exportLibraryContainer(
             pLibElement->addAttribute( XMLNS_LIBRARY_PREFIX ":readonly", rLib.bReadOnly ? sTrueStr : sFalseStr );
         }
 
-        pLibElement->dump( xOut.get() );
+        pLibElement->dump( xOut );
     }
 
     xOut->ignorableWhitespace( OUString() );
@@ -123,10 +123,10 @@ exportLibrary(
         pElement->addAttribute( XMLNS_LIBRARY_PREFIX ":name",
                                     rElementName );
 
-        pLibElement->addSubElement( pElement.get() );
+        pLibElement->addSubElement( pElement );
     }
 
-    pLibElement->dump( xOut.get() );
+    pLibElement->dump( xOut );
 
     xOut->endDocument();
 }
diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
index 5e063430e3bb..02c46a65f239 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
@@ -33,7 +33,7 @@ namespace xmlscript
 
 Reference< xml::input::XElement > LibElementBase::getParent()
 {
-    return mxParent.get();
+    return mxParent;
 }
 
 OUString LibElementBase::getLocalName()


More information about the Libreoffice-commits mailing list