[Libreoffice-commits] core.git: UnoControls/source unoidl/source unotools/source unoxml/qa unoxml/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 16 19:18:31 UTC 2021


 UnoControls/source/controls/progressmonitor.cxx |    4 ++--
 UnoControls/source/controls/statusindicator.cxx |    4 ++--
 unoidl/source/sourceprovider-parser.y           |    2 +-
 unoidl/source/unoidl-write.cxx                  |   22 +++++++++++-----------
 unotools/source/config/confignode.cxx           |    2 +-
 unotools/source/misc/closeveto.cxx              |    4 ++--
 unotools/source/ucbhelper/ucblockbytes.cxx      |    2 +-
 unoxml/qa/unit/domtest.cxx                      |   24 ++++++++----------------
 unoxml/source/dom/attributesmap.cxx             |   12 ++++++------
 unoxml/source/dom/childlist.cxx                 |    3 +--
 unoxml/source/dom/document.cxx                  |    6 +++---
 unoxml/source/dom/documentbuilder.cxx           |    8 ++------
 unoxml/source/dom/element.cxx                   |    4 ++--
 unoxml/source/dom/elementlist.cxx               |    4 +---
 unoxml/source/dom/node.cxx                      |   24 +++++++-----------------
 unoxml/source/events/eventdispatcher.cxx        |    2 +-
 unoxml/source/rdf/librdf_repository.cxx         |    7 +++----
 unoxml/source/xpath/nodelist.cxx                |    3 +--
 18 files changed, 55 insertions(+), 82 deletions(-)

New commits:
commit 9bd827270646be509060ddb92be4eae20b277b91
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Tue Feb 16 15:47:57 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Feb 16 20:17:39 2021 +0100

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

diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index 9902758f8536..05296e35915b 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -87,7 +87,7 @@ ProgressMonitor::ProgressMonitor( const css::uno::Reference< XComponentContext >
     addControl ( CONTROLNAME_TEXT, xRef_Topic_Bottom        );
     addControl ( CONTROLNAME_TEXT, xRef_Text_Bottom         );
     addControl ( CONTROLNAME_BUTTON, xRef_Button            );
-    addControl ( CONTROLNAME_PROGRESSBAR, m_xProgressBar.get() );
+    addControl ( CONTROLNAME_PROGRESSBAR, m_xProgressBar );
 
     // FixedText make it automatically visible by himself ... but not the progressbar !!!
     // it must be set explicitly
@@ -494,7 +494,7 @@ void SAL_CALL ProgressMonitor::dispose ()
     removeControl ( xRef_Topic_Bottom   );
     removeControl ( xRef_Text_Bottom    );
     removeControl ( xRef_Button         );
-    removeControl ( m_xProgressBar.get() );
+    removeControl ( m_xProgressBar );
 
     // don't use "...->clear ()" or "... = XFixedText ()"
     // when other hold a reference at this object !!!
diff --git a/UnoControls/source/controls/statusindicator.cxx b/UnoControls/source/controls/statusindicator.cxx
index 3ce92b94ceed..f41088caca3d 100644
--- a/UnoControls/source/controls/statusindicator.cxx
+++ b/UnoControls/source/controls/statusindicator.cxx
@@ -59,7 +59,7 @@ StatusIndicator::StatusIndicator( const css::uno::Reference< XComponentContext >
     xTextControl->setModel( css::uno::Reference< XControlModel >( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_MODELNAME, rxContext ), UNO_QUERY ) );
     // ... and add controls to basecontainercontrol!
     addControl( CONTROLNAME_TEXT, xTextControl    );
-    addControl( CONTROLNAME_PROGRESSBAR, m_xProgressBar.get() );
+    addControl( CONTROLNAME_PROGRESSBAR, m_xProgressBar );
     // FixedText make it automatically visible by himself ... but not the progressbar !!!
     // it must be set explicitly
     m_xProgressBar->setVisible( true );
@@ -305,7 +305,7 @@ void SAL_CALL StatusIndicator::dispose ()
     css::uno::Reference< XControl >  xTextControl     ( m_xText       , UNO_QUERY );
 
     removeControl( xTextControl     );
-    removeControl( m_xProgressBar.get() );
+    removeControl( m_xProgressBar );
 
     // don't use "...->clear ()" or "... = XFixedText ()"
     // when other hold a reference at this object !!!
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y
index 9d1dd5ae49d0..326d0dd7a8c9 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -1560,7 +1560,7 @@ interfaceDefn:
           YYERROR;
       }
       data->entities[data->currentName] = unoidl::detail::SourceProviderEntity(
-          pad.get());
+          pad);
   }
   '{' interfaceMembers '}' ';'
   {
diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx
index 1afca0e218b0..8ffcaa040d7d 100644
--- a/unoidl/source/unoidl-write.cxx
+++ b/unoidl/source/unoidl-write.cxx
@@ -467,7 +467,7 @@ sal_uInt64 writeMap(
                 bool ann = !ent2->getAnnotations().empty() ||
                     hasNotEmptyAnnotations(ent2->getMembers());
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 write32(file, ent2->getMembers().size());
                 for (auto & j: ent2->getMembers()) {
                     writeIdxName(file, j.name);
@@ -486,7 +486,7 @@ sal_uInt64 writeMap(
                     hasNotEmptyAnnotations(ent2->getDirectMembers());
                 i.second.dataOffset = getOffset(file);
                 writeKind(
-                    file, ent2.get(), ann, !ent2->getDirectBase().isEmpty());
+                    file, ent2, ann, !ent2->getDirectBase().isEmpty());
                 if (!ent2->getDirectBase().isEmpty()) {
                     writeIdxName(file, ent2->getDirectBase());
                 }
@@ -509,7 +509,7 @@ sal_uInt64 writeMap(
                 bool ann = !ent2->getAnnotations().empty() ||
                     hasNotEmptyAnnotations(ent2->getMembers());
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 write32(file, ent2->getTypeParameters().size());
                 for (auto & j: ent2->getTypeParameters()) {
                     writeIdxName(file, j);
@@ -537,7 +537,7 @@ sal_uInt64 writeMap(
                     hasNotEmptyAnnotations(ent2->getDirectMembers());
                 i.second.dataOffset = getOffset(file);
                 writeKind(
-                    file, ent2.get(), ann, !ent2->getDirectBase().isEmpty());
+                    file, ent2, ann, !ent2->getDirectBase().isEmpty());
                 if (!ent2->getDirectBase().isEmpty()) {
                     writeIdxName(file, ent2->getDirectBase());
                 }
@@ -561,7 +561,7 @@ sal_uInt64 writeMap(
                     hasNotEmptyAnnotations(ent2->getDirectAttributes()) ||
                     hasNotEmptyAnnotations(ent2->getDirectMethods());
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 write32(file, ent2->getDirectMandatoryBases().size());
                 for (auto & j: ent2->getDirectMandatoryBases()) {
                     writeIdxName(file, j.name);
@@ -622,7 +622,7 @@ sal_uInt64 writeMap(
                         i.second.entity.get()));
                 bool ann = !ent2->getAnnotations().empty();
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 writeIdxName(file, ent2->getType());
                 writeAnnotations(file, ann, ent2->getAnnotations());
                 break;
@@ -709,7 +709,7 @@ sal_uInt64 writeMap(
                 }
                 bool ann = !ent2->getAnnotations().empty();
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 write32(file, cmap.size());
                     // overflow from std::map::size_type -> sal_uInt64 is
                     // unrealistic
@@ -733,7 +733,7 @@ sal_uInt64 writeMap(
                 if (!dfltCtor && !ann)
                     ann = hasNotEmptyAnnotations(ent2->getConstructors());
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann, dfltCtor);
+                writeKind(file, ent2, ann, dfltCtor);
                 writeIdxName(file, ent2->getBase());
                 if (!dfltCtor) {
                     write32(file, ent2->getConstructors().size());
@@ -777,7 +777,7 @@ sal_uInt64 writeMap(
                     hasNotEmptyAnnotations(ent2->getDirectOptionalBaseInterfaces()) ||
                     hasNotEmptyAnnotations(ent2->getDirectProperties());
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 write32(file, ent2->getDirectMandatoryBaseServices().size());
                 for (auto & j: ent2->getDirectMandatoryBaseServices()) {
                     writeIdxName(file, j.name);
@@ -815,7 +815,7 @@ sal_uInt64 writeMap(
                         i.second.entity.get()));
                 bool ann = !ent2->getAnnotations().empty();
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 writeIdxName(file, ent2->getBase());
                 writeAnnotations(file, ann, ent2->getAnnotations());
                 break;
@@ -827,7 +827,7 @@ sal_uInt64 writeMap(
                         i.second.entity.get()));
                 bool ann = !ent2->getAnnotations().empty();
                 i.second.dataOffset = getOffset(file);
-                writeKind(file, ent2.get(), ann);
+                writeKind(file, ent2, ann);
                 writeIdxName(file, ent2->getBase());
                 writeAnnotations(file, ann, ent2->getAnnotations());
                 break;
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index 7c604d1067dc..8c6b21000fae 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -490,7 +490,7 @@ namespace utl
 
     OConfigurationTreeRoot::OConfigurationTreeRoot( const Reference<XComponentContext> & i_rContext, const OUString& i_rNodePath, const bool i_bUpdatable )
         :OConfigurationNode( lcl_createConfigurationRoot( lcl_getConfigProvider( i_rContext ),
-            i_rNodePath, i_bUpdatable, -1 ).get() )
+                                i_rNodePath, i_bUpdatable, -1 ) )
         ,m_xCommitter()
     {
         if ( i_bUpdatable )
diff --git a/unotools/source/misc/closeveto.cxx b/unotools/source/misc/closeveto.cxx
index bf2cb83829b6..02e5dc5faaea 100644
--- a/unotools/source/misc/closeveto.cxx
+++ b/unotools/source/misc/closeveto.cxx
@@ -105,7 +105,7 @@ namespace utl
             ENSURE_OR_RETURN_VOID( i_data.xCloseable.is(), "CloseVeto: the component is not closeable!" );
 
             i_data.pListener = new CloseListener_Impl(hasOwnership);
-            i_data.xCloseable->addCloseListener( i_data.pListener.get() );
+            i_data.xCloseable->addCloseListener( i_data.pListener );
         }
 
         void lcl_deinit( CloseVeto_Data const & i_data )
@@ -113,7 +113,7 @@ namespace utl
             if ( !i_data.xCloseable.is() )
                 return;
 
-            i_data.xCloseable->removeCloseListener( i_data.pListener.get() );
+            i_data.xCloseable->removeCloseListener( i_data.pListener );
             if ( i_data.pListener->hasOwnership() )
             {
                 try
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 5074989d6083..3748b4a8ee80 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -751,7 +751,7 @@ static bool UCBOpenContentSync(
                     rtl::Reference< ucbhelper::InteractionContinuation > ref
                         = ir->getSelection();
                     if(ref.is()) {
-                        Reference<XInterface> xInt(ref.get());
+                        Reference<XInterface> xInt(ref);
                         xRet.set(xInt,UNO_QUERY);
                     }
                 }
diff --git a/unoxml/qa/unit/domtest.cxx b/unoxml/qa/unit/domtest.cxx
index 1b1daa56b1f9..c6501547183c 100644
--- a/unoxml/qa/unit/domtest.cxx
+++ b/unoxml/qa/unit/domtest.cxx
@@ -207,7 +207,7 @@ struct BasicTest : public test::BootstrapFixture
         mxValidInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile))) );
         mxWarningInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(warningTestFile), SAL_N_ELEMENTS(warningTestFile))) );
         mxErrorInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(errorTestFile), SAL_N_ELEMENTS(errorTestFile))) );
-        mxDomBuilder->setErrorHandler(mxErrHandler.get());
+        mxDomBuilder->setErrorHandler(mxErrHandler);
     }
 
     void validInputTest()
@@ -215,9 +215,7 @@ struct BasicTest : public test::BootstrapFixture
         try
         {
             CPPUNIT_ASSERT_MESSAGE("Valid input file did not result in XDocument #1",
-                mxDomBuilder->parse(
-                    uno::Reference<io::XInputStream>(
-                        mxValidInStream.get())).is());
+                mxDomBuilder->parse(mxValidInStream).is());
             CPPUNIT_ASSERT_MESSAGE("Valid input file resulted in parse errors",
                 mxErrHandler->noErrors());
         }
@@ -233,9 +231,7 @@ struct BasicTest : public test::BootstrapFixture
         {
             // We DON'T expect exception here, as mxWarningInStream is valid XML Doc
             CPPUNIT_ASSERT_MESSAGE("Valid input file did not result in XDocument #2",
-                mxDomBuilder->parse(
-                    uno::Reference<io::XInputStream>(
-                        mxWarningInStream.get())).is());
+                mxDomBuilder->parse(mxWarningInStream).is());
         }
         catch (const css::xml::sax::SAXParseException& )
         {
@@ -253,9 +249,7 @@ struct BasicTest : public test::BootstrapFixture
         {
             // We expect exception here, as mxErrorInStream is invalid XML Doc
             CPPUNIT_ASSERT_MESSAGE("Invalid input file result in XDocument #2!",
-                !mxDomBuilder->parse(
-                    uno::Reference<io::XInputStream>(
-                        mxErrorInStream.get())).is());
+                !mxDomBuilder->parse(mxErrorInStream).is());
             CPPUNIT_ASSERT_MESSAGE("No exception is thrown in unclean input file", false);
         }
         catch (const css::xml::sax::SAXParseException&)
@@ -295,7 +289,7 @@ struct SerializerTest : public test::BootstrapFixture
         uno::Reference<XDocumentBuilder> xDB( getMultiServiceFactory()->createInstance("com.sun.star.xml.dom.DocumentBuilder"), uno::UNO_QUERY_THROW );
         mxDomBuilder.set( xDB );
         mxInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile))) );
-        mxDomBuilder->setErrorHandler(mxErrHandler.get());
+        mxDomBuilder->setErrorHandler(mxErrHandler);
         mxHandler.set( new DocumentHandler );
         mxTokHandler.set( new TokenHandler );
 
@@ -313,9 +307,7 @@ struct SerializerTest : public test::BootstrapFixture
         try
         {
             uno::Reference< xml::dom::XDocument > xDoc =
-                mxDomBuilder->parse(
-                    uno::Reference<io::XInputStream>(
-                        mxInStream.get()));
+                mxDomBuilder->parse(mxInStream);
             CPPUNIT_ASSERT_MESSAGE("Valid input file did not result in XDocument",
                 xDoc.is());
             CPPUNIT_ASSERT_MESSAGE("Valid input file resulted in parse errors",
@@ -331,8 +323,8 @@ struct SerializerTest : public test::BootstrapFixture
             CPPUNIT_ASSERT_MESSAGE("XFastSAXSerializable not supported",
                 xSaxSerializer.is());
 
-            xFastSaxSerializer->fastSerialize(mxHandler.get(),
-                mxTokHandler.get(),
+            xFastSaxSerializer->fastSerialize(mxHandler,
+                mxTokHandler,
                 uno::Sequence< beans::StringPair >(),
                 maRegisteredNamespaces);
         }
diff --git a/unoxml/source/dom/attributesmap.cxx b/unoxml/source/dom/attributesmap.cxx
index eef8c09f7b0b..575fa96c2ce0 100644
--- a/unoxml/source/dom/attributesmap.cxx
+++ b/unoxml/source/dom/attributesmap.cxx
@@ -78,8 +78,8 @@ namespace DOM
             {
                 if( strcmp(reinterpret_cast<char const *>(pName), reinterpret_cast<char const *>(cur->name)) == 0)
                 {
-                    aNode.set( m_pElement->GetOwnerDocument().GetCNode(
-                                   reinterpret_cast<xmlNodePtr>(cur)).get() );
+                    aNode = m_pElement->GetOwnerDocument().GetCNode(
+                                   reinterpret_cast<xmlNodePtr>(cur));
                     break;
                 }
                 cur = cur->next;
@@ -113,8 +113,8 @@ namespace DOM
                 if( strcmp(reinterpret_cast<char const *>(pName), reinterpret_cast<char const *>(cur->name)) == 0 &&
                     cur->ns == pNs)
                 {
-                    aNode.set( m_pElement->GetOwnerDocument().GetCNode(
-                                  reinterpret_cast<xmlNodePtr>(cur)).get() );
+                    aNode = m_pElement->GetOwnerDocument().GetCNode(
+                                  reinterpret_cast<xmlNodePtr>(cur));
                     break;
                 }
                 cur = cur->next;
@@ -141,8 +141,8 @@ namespace DOM
             {
                 if (count == index)
                 {
-                    aNode.set( m_pElement->GetOwnerDocument().GetCNode(
-                                reinterpret_cast<xmlNodePtr>(cur)).get() );
+                    aNode = m_pElement->GetOwnerDocument().GetCNode(
+                                reinterpret_cast<xmlNodePtr>(cur));
                     break;
                 }
                 count++;
diff --git a/unoxml/source/dom/childlist.cxx b/unoxml/source/dom/childlist.cxx
index ec3811fa9161..6f62f0144dbb 100644
--- a/unoxml/source/dom/childlist.cxx
+++ b/unoxml/source/dom/childlist.cxx
@@ -75,8 +75,7 @@ namespace DOM
             while (cur != nullptr)
             {
                 if (index-- == 0) {
-                    return Reference< XNode >(
-                            m_pNode->GetOwnerDocument().GetCNode(cur).get());
+                    return m_pNode->GetOwnerDocument().GetCNode(cur);
                 }
                 cur = cur->next;
             }
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 8d56510da81f..db93dcad847a 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -249,7 +249,7 @@ namespace DOM
         if (pCNode != nullptr) {
             bool const bInserted = m_NodeMap.emplace(
                         pNode,
-                        ::std::make_pair(WeakReference<XNode>(pCNode.get()), pCNode.get())
+                        ::std::make_pair(WeakReference<XNode>(pCNode), pCNode.get())
                 ).second;
             OSL_ASSERT(bInserted);
             if (!bInserted) {
@@ -423,7 +423,7 @@ namespace DOM
                     reinterpret_cast<xmlNodePtr>(pAttr)).get()));
         if (!pCAttr.is()) { throw RuntimeException(); }
         pCAttr->m_bUnlinked = true;
-        return pCAttr.get();
+        return pCAttr;
     };
 
     // Creates an attribute of the given qualified name and namespace URI.
@@ -458,7 +458,7 @@ namespace DOM
         pCAttr->m_pNamespace.reset( new stringpair_t(oUri, oPrefix) );
         pCAttr->m_bUnlinked = true;
 
-        return pCAttr.get();
+        return pCAttr;
     };
 
     // Creates a CDATASection node whose value is the specified string.
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index 3a4ddc5fe821..8d42ad5f9b75 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -133,9 +133,7 @@ namespace DOM
 
         // create a new document
         xmlDocPtr pDocument = xmlNewDoc(reinterpret_cast<const xmlChar*>("1.0"));
-        Reference< XDocument > const xRet(
-                CDocument::CreateCDocument(pDocument).get());
-        return xRet;
+        return CDocument::CreateCDocument(pDocument);
     }
 
     static OUString make_error_message(xmlParserCtxtPtr ctxt)
@@ -361,9 +359,7 @@ namespace DOM
         if (pDoc == nullptr) {
             throwEx(pContext.get());
         }
-        Reference< XDocument > const xRet(
-                CDocument::CreateCDocument(pDoc).get());
-        return xRet;
+        return CDocument::CreateCDocument(pDoc);
     }
 
     Reference< XDocument > SAL_CALL CDocumentBuilder::parseURI(const OUString& sUri)
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx
index f5dd67304d6b..988d7f1b9c32 100644
--- a/unoxml/source/dom/element.cxx
+++ b/unoxml/source/dom/element.cxx
@@ -144,7 +144,7 @@ namespace DOM
         Reference<XFastContextHandler> xParentHandler(i_rContext.mxCurrentHandler);
         try
         {
-            Reference< XFastAttributeList > xAttr( i_rContext.mxAttribList.get() );
+            Reference< XFastAttributeList > xAttr( i_rContext.mxAttribList );
             if( nElementToken == FastToken::DONTKNOW )
             {
                 const OUString aNamespace;
@@ -472,7 +472,7 @@ namespace DOM
         }
 
         ::rtl::Reference<CNode> const pCNode(
-            comphelper::getUnoTunnelImplementation<CNode>(Reference<XNode>(oldAttr.get())));
+            comphelper::getUnoTunnelImplementation<CNode>(Reference<XNode>(oldAttr)));
         if (!pCNode.is()) { throw RuntimeException(); }
 
         xmlNodePtr const pNode = pCNode->GetNodePtr();
diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx
index 290438b2ca28..c0ffb0f87929 100644
--- a/unoxml/source/dom/elementlist.cxx
+++ b/unoxml/source/dom/elementlist.cxx
@@ -176,9 +176,7 @@ namespace DOM
         if (m_nodevector.size() <= o3tl::make_unsigned(index)) {
             throw RuntimeException();
         }
-        Reference< XNode > const xRet(
-            m_pElement->GetOwnerDocument().GetCNode(m_nodevector[index]).get());
-        return xRet;
+        return m_pElement->GetOwnerDocument().GetCNode(m_nodevector[index]);
     }
 
     // tree mutations can change the list
diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index 68a834c1a8b4..8abe73e707b3 100644
--- a/unoxml/source/dom/node.cxx
+++ b/unoxml/source/dom/node.cxx
@@ -371,7 +371,7 @@ namespace DOM
         // dispatch subtree modified for this node
         dispatchSubtreeModified();
 
-        return pNode.get();
+        return pNode;
     }
 
     /**
@@ -389,7 +389,7 @@ namespace DOM
             xmlCopyNode(m_aNodePtr, bDeep ? 1 : 0));
         if (!pNode.is()) { return nullptr; }
         pNode->m_bUnlinked = true; // not linked yet
-        return pNode.get();
+        return pNode;
     }
 
     /**
@@ -426,9 +426,7 @@ namespace DOM
         if (nullptr == m_aNodePtr) {
             return nullptr;
         }
-        Reference< XNode > const xNode(
-                GetOwnerDocument().GetCNode(m_aNodePtr->children).get());
-        return xNode;
+        return GetOwnerDocument().GetCNode(m_aNodePtr->children);
     }
 
     /**
@@ -441,9 +439,7 @@ namespace DOM
         if (nullptr == m_aNodePtr) {
             return nullptr;
         }
-        Reference< XNode > const xNode(
-            GetOwnerDocument().GetCNode(xmlGetLastChild(m_aNodePtr)).get());
-        return xNode;
+        return GetOwnerDocument().GetCNode(xmlGetLastChild(m_aNodePtr));
     }
 
     /**
@@ -484,9 +480,7 @@ namespace DOM
         if (nullptr == m_aNodePtr) {
             return nullptr;
         }
-        Reference< XNode > const xNode(
-                GetOwnerDocument().GetCNode(m_aNodePtr->next).get());
-        return xNode;
+        return GetOwnerDocument().GetCNode(m_aNodePtr->next);
     }
 
     /**
@@ -557,9 +551,7 @@ namespace DOM
         if (nullptr == m_aNodePtr) {
             return nullptr;
         }
-        Reference< XNode > const xNode(
-                GetOwnerDocument().GetCNode(m_aNodePtr->parent).get());
-        return xNode;
+        return GetOwnerDocument().GetCNode(m_aNodePtr->parent);
     }
 
     /**
@@ -592,9 +584,7 @@ namespace DOM
         if (nullptr == m_aNodePtr) {
             return nullptr;
         }
-        Reference< XNode > const xNode(
-                GetOwnerDocument().GetCNode(m_aNodePtr->prev).get());
-        return xNode;
+        return GetOwnerDocument().GetCNode(m_aNodePtr->prev);
     }
 
     /**
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index cc5fb159d3c8..fc396ee9dc76 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -197,7 +197,7 @@ namespace DOM::events {
             while (cur != nullptr)
             {
                 Reference< XEventTarget > const xRef(
-                        rDocument.GetCNode(cur).get());
+                        rDocument.GetCNode(cur));
                 captureVector.emplace_back(xRef, cur);
                 cur = cur->parent;
             }
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index 13a10b4edb41..85b05260484a 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -1057,7 +1057,7 @@ librdf_Repository::importGraph(::sal_Int16 i_Format,
             "librdf_model_context_add_statements failed", *this);
     }
 
-    return uno::Reference<rdf::XNamedGraph>(pGraph.get());
+    return pGraph;
 }
 
 void addChaffWhenEncryptedStorage(const uno::Reference< io::XOutputStream > &rStream, unsigned char* pBuffer, size_t length)
@@ -1273,7 +1273,7 @@ librdf_Repository::getGraph(const uno::Reference< rdf::XURI > & i_xGraphName)
     ::osl::MutexGuard g(m_aMutex);
     const NamedGraphMap_t::iterator iter( m_NamedGraphs.find(contextU) );
     if (iter != m_NamedGraphs.end()) {
-        return uno::Reference<rdf::XNamedGraph>(iter->second.get());
+        return iter->second;
     } else {
         return nullptr;
     }
@@ -1306,8 +1306,7 @@ librdf_Repository::createGraph(const uno::Reference< rdf::XURI > & i_xGraphName)
     }
     m_NamedGraphs.insert(std::make_pair(contextU,
         new librdf_NamedGraph(this, i_xGraphName)));
-    return uno::Reference<rdf::XNamedGraph>(
-        m_NamedGraphs.find(contextU)->second.get());
+    return m_NamedGraphs.find(contextU)->second;
 }
 
 void SAL_CALL
diff --git a/unoxml/source/xpath/nodelist.cxx b/unoxml/source/xpath/nodelist.cxx
index 1298a5fa82c6..1b306aabc8d7 100644
--- a/unoxml/source/xpath/nodelist.cxx
+++ b/unoxml/source/xpath/nodelist.cxx
@@ -65,8 +65,7 @@ namespace XPath
             return nullptr;
         }
         xmlNodePtr const pNode = xmlXPathNodeSetItem(m_pNodeSet, index);
-        Reference< XNode > const xNode(m_pDocument->GetCNode(pNode).get());
-        return xNode;
+        return m_pDocument->GetCNode(pNode);
     }
 }
 


More information about the Libreoffice-commits mailing list