[Libreoffice-commits] core.git: ucb/source xmlscript/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 7 08:16:43 UTC 2020


 ucb/source/ucp/tdoc/tdoc_storage.cxx            |    4 ++--
 xmlscript/source/xmllib_imexp/xmllib_export.cxx |    8 +++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 7224bb9bcdd24b0f07eae9c0b5d71a8b9e7926ea
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Apr 7 08:46:05 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 7 10:16:11 2020 +0200

    loplugin:unusedvariableplus in ucb,xmlscript
    
    Change-Id: I8fac8c7766df7c6be489280fcac2a423183429c3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91790
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx
index 014065416cb5..49493ec7b73f 100644
--- a/ucb/source/ucp/tdoc/tdoc_storage.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx
@@ -179,9 +179,9 @@ StorageElementFactory::createStorage( const OUString & rUri,
     }
     else if ( osl_atomic_increment( &aIt->second->m_refCount ) > 1 )
     {
-        rtl::Reference< Storage > xElement( aIt->second );
+        uno::Reference< embed::XStorage > xElement( aIt->second );
         osl_atomic_decrement( &aIt->second->m_refCount );
-        return aIt->second;
+        return xElement;
     }
     else
     {
diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
index 97764e4292c2..f7a3b17ddc46 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
@@ -62,8 +62,7 @@ exportLibraryContainer(
     {
         LibDescriptor& rLib = pLibArray->mpLibs[i];
 
-        XMLElement* pLibElement = new XMLElement( XMLNS_LIBRARY_PREFIX ":library" );
-        Reference< xml::sax::XAttributeList > xLibElementAttribs = static_cast< xml::sax::XAttributeList* >( pLibElement );
+        rtl::Reference<XMLElement> pLibElement(new XMLElement( XMLNS_LIBRARY_PREFIX ":library" ));
 
         pLibElement->addAttribute( XMLNS_LIBRARY_PREFIX ":name", rLib.aName );
 
@@ -119,13 +118,12 @@ exportLibrary(
 
     for( const auto& rElementName : rLib.aElementNames )
     {
-        XMLElement* pElement = new XMLElement( XMLNS_LIBRARY_PREFIX ":element" );
-        Reference< xml::sax::XAttributeList > xElementAttribs = static_cast< xml::sax::XAttributeList* >( pElement );
+        rtl::Reference<XMLElement> pElement(new XMLElement( XMLNS_LIBRARY_PREFIX ":element" ));
 
         pElement->addAttribute( XMLNS_LIBRARY_PREFIX ":name",
                                     rElementName );
 
-        pLibElement->addSubElement( pElement );
+        pLibElement->addSubElement( pElement.get() );
     }
 
     pLibElement->dump( xOut.get() );


More information about the Libreoffice-commits mailing list