[Libreoffice-commits] core.git: sfx2/inc sfx2/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 16 13:46:27 UTC 2021


 sfx2/inc/preventduplicateinteraction.hxx     |    4 -
 sfx2/source/appl/appuno.cxx                  |   10 ++--
 sfx2/source/control/bindings.cxx             |    4 -
 sfx2/source/control/statcach.cxx             |    2 
 sfx2/source/dialog/filedlghelper.cxx         |    2 
 sfx2/source/doc/DocumentMetadataAccess.cxx   |   58 +++++++++++++--------------
 sfx2/source/doc/docfile.cxx                  |    6 +-
 sfx2/source/doc/objmisc.cxx                  |    2 
 sfx2/source/doc/objserv.cxx                  |    4 -
 sfx2/source/doc/objstor.cxx                  |    3 -
 sfx2/source/doc/objxtor.cxx                  |    6 +-
 sfx2/source/doc/sfxbasemodel.cxx             |    4 -
 sfx2/source/sidebar/SidebarController.cxx    |    4 -
 sfx2/source/sidebar/SidebarDockingWindow.cxx |    2 
 sfx2/source/view/classificationhelper.cxx    |    3 -
 sfx2/source/view/frame2.cxx                  |    2 
 sfx2/source/view/frmload.cxx                 |   12 ++---
 sfx2/source/view/ipclient.cxx                |   12 ++---
 sfx2/source/view/viewfrm.cxx                 |    3 -
 sfx2/source/view/viewsh.cxx                  |    2 
 20 files changed, 71 insertions(+), 74 deletions(-)

New commits:
commit 97fa8702c6f8325685bdfb46f6197b9739ebe327
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Tue Feb 16 12:56:09 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Feb 16 14:45:40 2021 +0100

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

diff --git a/sfx2/inc/preventduplicateinteraction.hxx b/sfx2/inc/preventduplicateinteraction.hxx
index edd503d0129e..970a93b159ef 100644
--- a/sfx2/inc/preventduplicateinteraction.hxx
+++ b/sfx2/inc/preventduplicateinteraction.hxx
@@ -127,7 +127,7 @@ public:
         : m_xDesktop(css::frame::Desktop::create(rContext), css::uno::UNO_QUERY_THROW)
         , m_xListener(new WarningDialogsParent)
     {
-        m_xDesktop->addTerminateListener(m_xListener.get());
+        m_xDesktop->addTerminateListener(m_xListener);
     }
 
     const css::uno::Reference<css::awt::XWindow>& GetDialogParent() const
@@ -137,7 +137,7 @@ public:
 
     ~WarningDialogsParentScope()
     {
-        m_xDesktop->removeTerminateListener(m_xListener.get());
+        m_xDesktop->removeTerminateListener(m_xListener);
     }
 };
 
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 559cadd8f534..413dd7d41736 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1735,7 +1735,7 @@ uno::Any SAL_CALL RequestFilterOptions::getRequest()
 uno::Sequence< uno::Reference< task::XInteractionContinuation > >
     SAL_CALL RequestFilterOptions::getContinuations()
 {
-    return { m_xAbort.get(), m_xOptions.get() };
+    return { m_xAbort, m_xOptions };
 }
 
 
@@ -1774,7 +1774,7 @@ uno::Any SAL_CALL RequestPackageReparation_Impl::getRequest()
 uno::Sequence< uno::Reference< task::XInteractionContinuation > >
     SAL_CALL RequestPackageReparation_Impl::getContinuations()
 {
-    return { m_xApprove.get(), m_xDisapprove.get() };
+    return { m_xApprove, m_xDisapprove };
 }
 
 RequestPackageReparation::RequestPackageReparation( const OUString& aName )
@@ -1793,7 +1793,7 @@ bool RequestPackageReparation::isApproved() const
 
 css::uno::Reference < task::XInteractionRequest > RequestPackageReparation::GetRequest()
 {
-    return mxImpl.get();
+    return mxImpl;
 }
 
 
@@ -1824,7 +1824,7 @@ uno::Any SAL_CALL NotifyBrokenPackage_Impl::getRequest()
 uno::Sequence< uno::Reference< task::XInteractionContinuation > >
     SAL_CALL NotifyBrokenPackage_Impl::getContinuations()
 {
-    return { m_xAbort.get() };
+    return { m_xAbort };
 }
 
 NotifyBrokenPackage::NotifyBrokenPackage( const OUString& aName )
@@ -1838,7 +1838,7 @@ NotifyBrokenPackage::~NotifyBrokenPackage()
 
 css::uno::Reference < task::XInteractionRequest > NotifyBrokenPackage::GetRequest()
 {
-    return mxImpl.get();
+    return mxImpl;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 32021d47285c..6ac0bb9c59cc 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1552,7 +1552,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, std::unique_ptr<SfxPoolI
 
                 SfxItemState eState = SfxItemState::SET;
                 rtl::Reference<BindDispatch_Impl> xBind(new BindDispatch_Impl( xDisp, aURL, pCache, pSlot ));
-                xDisp->addStatusListener( xBind.get(), aURL );
+                xDisp->addStatusListener( xBind, aURL );
                 if ( !xBind->GetStatus().IsEnabled )
                 {
                     eState = SfxItemState::DISABLED;
@@ -1590,7 +1590,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, std::unique_ptr<SfxPoolI
                         rpState.reset(new SfxVoidItem( nSlot ));
                 }
 
-                xDisp->removeStatusListener( xBind.get(), aURL );
+                xDisp->removeStatusListener( xBind, aURL );
                 xBind->Release();
                 xBind.clear();
                 if ( bDeleteCache )
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index b71b96a62579..6942818096ea 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -283,7 +283,7 @@ const SfxSlotServer* SfxStateCache::GetSlotServer( SfxDispatcher &rDispat , cons
                 // flags must be set before adding StatusListener because the dispatch object will set the state
                 bSlotDirty = false;
                 bCtrlDirty = true;
-                xDisp->addStatusListener( mxDispatch.get(), aURL );
+                xDisp->addStatusListener( mxDispatch, aURL );
             }
             else if ( rDispat.GetFrame() )
             {
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 69afa482fa10..f70ecec1146a 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -2657,7 +2657,7 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter,
 
     ::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest( new ::comphelper::DocPasswordRequest( eType, css::task::PasswordRequestMode_PASSWORD_CREATE, aURL, bool( pCurrentFilter->GetFilterFlags() & SfxFilterFlags::PASSWORDTOMODIFY ) ) );
 
-    uno::Reference< css::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
+    uno::Reference< css::task::XInteractionRequest > rRequest( pPasswordRequest );
     do
     {
         xInteractionHandler->handle( rRequest );
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index e030a0dc111b..1c3d87d8c5b0 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -320,17 +320,17 @@ addFile(struct DocumentMetadataAccess_Impl const & i_rImpl,
         const uno::Reference<rdf::XURI> xURI( getURIForStream(
             i_rImpl, i_rPath) );
 
-        i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI.get(),
+        i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI,
             getURI<rdf::URIs::PKG_HASPART>(i_rImpl.m_xContext),
-            xURI.get());
-        i_rImpl.m_xManifest->addStatement(xURI.get(),
+            xURI);
+        i_rImpl.m_xManifest->addStatement(xURI,
             getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
-            i_xType.get());
+            i_xType);
         if (i_pTypes) {
             for (const auto& rType : *i_pTypes) {
-                i_rImpl.m_xManifest->addStatement(xURI.get(),
+                i_rImpl.m_xManifest->addStatement(xURI,
                     getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
-                    rType.get());
+                    rType);
             }
         }
     } catch (const uno::RuntimeException &) {
@@ -355,7 +355,7 @@ addContentOrStylesFileImpl(struct DocumentMetadataAccess_Impl const & i_rImpl,
     } else {
         return false;
     }
-    addFile(i_rImpl, xType.get(), i_rPath, nullptr);
+    addFile(i_rImpl, xType, i_rPath, nullptr);
     return true;
 }
 
@@ -377,10 +377,10 @@ removeFile(struct DocumentMetadataAccess_Impl const & i_rImpl,
 {
     if (!i_xPart.is()) throw uno::RuntimeException();
     try {
-        i_rImpl.m_xManifest->removeStatements(i_rImpl.m_xBaseURI.get(),
+        i_rImpl.m_xManifest->removeStatements(i_rImpl.m_xBaseURI,
             getURI<rdf::URIs::PKG_HASPART>(i_rImpl.m_xContext),
-            i_xPart.get());
-        i_rImpl.m_xManifest->removeStatements(i_xPart.get(),
+            i_xPart);
+        i_rImpl.m_xManifest->removeStatements(i_xPart,
             getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext), nullptr);
     } catch (const uno::RuntimeException &) {
         throw;
@@ -398,7 +398,7 @@ getAllParts(struct DocumentMetadataAccess_Impl const & i_rImpl)
     ::std::vector< uno::Reference< rdf::XURI > > ret;
     try {
         const uno::Reference<container::XEnumeration> xEnum(
-            i_rImpl.m_xManifest->getStatements( i_rImpl.m_xBaseURI.get(),
+            i_rImpl.m_xManifest->getStatements( i_rImpl.m_xBaseURI,
                 getURI<rdf::URIs::PKG_HASPART>(i_rImpl.m_xContext), nullptr),
             uno::UNO_SET_THROW);
         while (xEnum->hasMoreElements()) {
@@ -430,9 +430,9 @@ isPartOfType(struct DocumentMetadataAccess_Impl const & i_rImpl,
     if (!i_xPart.is() || !i_xType.is()) throw uno::RuntimeException();
     try {
         const uno::Reference<container::XEnumeration> xEnum(
-            i_rImpl.m_xManifest->getStatements(i_xPart.get(),
+            i_rImpl.m_xManifest->getStatements(i_xPart,
                 getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
-                i_xType.get()),
+                i_xType),
             uno::UNO_SET_THROW);
         return xEnum->hasMoreElements();
     } catch (const uno::RuntimeException &) {
@@ -453,7 +453,7 @@ getAllParts(struct DocumentMetadataAccess_Impl const& i_rImpl,
     try
     {
         const uno::Reference<container::XEnumeration> xEnum(
-            i_rImpl.m_xManifest->getStatements(i_rImpl.m_xBaseURI.get(),
+            i_rImpl.m_xManifest->getStatements(i_rImpl.m_xBaseURI,
                                                getURI<rdf::URIs::PKG_HASPART>(i_rImpl.m_xContext),
                                                nullptr),
             uno::UNO_SET_THROW);
@@ -470,7 +470,7 @@ getAllParts(struct DocumentMetadataAccess_Impl const& i_rImpl,
 
             const uno::Reference<container::XEnumeration> xEnum2(
                 i_rImpl.m_xManifest->getStatements(
-                    xPart.get(), getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext), i_xType.get()),
+                    xPart, getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext), i_xType),
                 uno::UNO_SET_THROW);
             if (xEnum2->hasMoreElements())
                 ret.emplace_back(xPart);
@@ -534,10 +534,10 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException,
     ::rtl::Reference< ::comphelper::OInteractionAbort > pAbort(
         new ::comphelper::OInteractionAbort );
 
-    pRequest->addContinuation( pApprove.get() );
-    pRequest->addContinuation( pAbort.get() );
+    pRequest->addContinuation( pApprove );
+    pRequest->addContinuation( pAbort );
     // actually call the handler
-    i_xHandler->handle( pRequest.get() );
+    i_xHandler->handle( pRequest );
     if (pRetry->wasSelected()) {
         return true;
     } else if (pApprove->wasSelected()) {
@@ -774,9 +774,9 @@ retry:
         i_rImpl.m_xRepository->createGraph(xManifest), uno::UNO_SET_THROW);
 
     // document statement
-    i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI.get(),
+    i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI,
         getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
-        getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get());
+        getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext));
 
     OSL_ENSURE(i_rImpl.m_xBaseURI.is(), "base URI is null");
     OSL_ENSURE(i_rImpl.m_xRepository.is(), "repository is null");
@@ -802,9 +802,9 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl)
             uno::UNO_SET_THROW);
 
         // insert the document statement
-        i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI.get(),
+        i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI,
             getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext),
-            getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get());
+            getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext));
     } catch (const uno::Exception &) {
         css::uno::Any anyEx = cppu::getCaughtException();
         throw lang::WrappedTargetRuntimeException(
@@ -1029,7 +1029,7 @@ DocumentMetadataAccess::removeMetadataFile(
     }
 
     // remove file from manifest
-    removeFile(*m_pImpl, i_xGraphName.get());
+    removeFile(*m_pImpl, i_xGraphName);
 }
 
 void SAL_CALL
@@ -1064,9 +1064,9 @@ DocumentMetadataAccess::removeContentOrStylesFile(
         const uno::Reference<rdf::XURI> xPart(
             getURIForStream(*m_pImpl, i_rFileName) );
         const uno::Reference<container::XEnumeration> xEnum(
-            m_pImpl->m_xManifest->getStatements( m_pImpl->m_xBaseURI.get(),
+            m_pImpl->m_xManifest->getStatements( m_pImpl->m_xBaseURI,
                 getURI<rdf::URIs::PKG_HASPART>(m_pImpl->m_xContext),
-                xPart.get()),
+                xPart),
             uno::UNO_SET_THROW);
         if (!xEnum->hasMoreElements()) {
             throw container::NoSuchElementException(
@@ -1150,18 +1150,18 @@ void SAL_CALL DocumentMetadataAccess::loadMetadataFromStorage(
                     const uno::Reference <rdf::XURI> xName(
                         getURIForStream(*m_pImpl, relName) );
                     // add missing type statement
-                    m_pImpl->m_xManifest->addStatement(xName.get(),
+                    m_pImpl->m_xManifest->addStatement(xName,
                         getURI<rdf::URIs::RDF_TYPE>(m_pImpl->m_xContext),
-                        xContentFile.get());
+                        xContentFile);
                 }
             } else if (isStylesFile(relName)) {
                 if (!isPartOfType(*m_pImpl, rxPart, xStylesFile)) {
                     const uno::Reference <rdf::XURI> xName(
                         getURIForStream(*m_pImpl, relName) );
                     // add missing type statement
-                    m_pImpl->m_xManifest->addStatement(xName.get(),
+                    m_pImpl->m_xManifest->addStatement(xName,
                         getURI<rdf::URIs::RDF_TYPE>(m_pImpl->m_xContext),
-                        xStylesFile.get());
+                        xStylesFile);
                 }
             } else if (isReservedFile(relName)) {
                 SAL_WARN("sfx", "loadMetadataFromStorage: reserved file name in manifest");
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 767a4b8ce6a7..2654bd0eda94 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -416,7 +416,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
         aContinuations[1] = new ::ucbhelper::InteractionApprove( xInteractionRequestImpl.get() );
         xInteractionRequestImpl->setContinuations( aContinuations );
 
-        xHandler->handle( xInteractionRequestImpl.get() );
+        xHandler->handle( xInteractionRequestImpl );
 
         ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
         if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
@@ -994,7 +994,7 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const LockFileEntr
         }
         xInteractionRequestImpl->setContinuations( aContinuations );
 
-        xHandler->handle( xInteractionRequestImpl.get() );
+        xHandler->handle( xInteractionRequestImpl );
 
         ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
         if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
@@ -1075,7 +1075,7 @@ bool SfxMedium::ShowLockFileProblemDialog(MessageDlg nWhichDlg)
         aContinuations[1] = new ::ucbhelper::InteractionApprove(xIgnoreRequestImpl.get());
         xIgnoreRequestImpl->setContinuations(aContinuations);
 
-        xHandler->handle(xIgnoreRequestImpl.get());
+        xHandler->handle(xIgnoreRequestImpl);
 
         ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection();
         bool bReadOnly = uno::Reference< task::XInteractionApprove >(xSelected.get(), uno::UNO_QUERY).is();
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 90758ff28bf7..4f34d7d2440a 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1409,7 +1409,7 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
         }
 
         // ry to protect the invocation context's undo manager (if present), just in case the script tampers with it
-        ::framework::DocumentUndoGuard aUndoGuard( _rxScriptContext.get() );
+        ::framework::DocumentUndoGuard aUndoGuard( _rxScriptContext );
 
         // obtain the script, and execute it
         Reference< provider::XScript > xScript( xScriptProvider->getScript( _rScriptURL ), UNO_SET_THROW );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 70d4ba462dd2..f9c1605c25a1 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -205,7 +205,7 @@ bool SfxInstanceCloseGuard_Impl::Init_Impl( const uno::Reference< util::XCloseab
         try
         {
             m_xPreventer = new SfxClosePreventer_Impl();
-            xCloseable->addCloseListener( m_xPreventer.get() );
+            xCloseable->addCloseListener( m_xPreventer );
             m_xCloseable = xCloseable;
             bResult = true;
         }
@@ -225,7 +225,7 @@ SfxInstanceCloseGuard_Impl::~SfxInstanceCloseGuard_Impl()
 
     try
     {
-        m_xCloseable->removeCloseListener( m_xPreventer.get() );
+        m_xCloseable->removeCloseListener( m_xPreventer );
     }
     catch( uno::Exception& )
     {
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index e6aaa4658977..bcda0a10debb 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3732,8 +3732,7 @@ bool SfxObjectShell::QueryAllowExoticFormat_Impl( const uno::Reference< task::XI
     {
         // Display a warning and let the user decide
         rtl::Reference<ExoticFileLoadException> xException(new ExoticFileLoadException( rURL, rFilterUIName ));
-        uno::Reference< task::XInteractionRequest > xReq( xException.get() );
-        xHandler->handle( xReq );
+        xHandler->handle( xException );
         return xException->isApprove();
     }
     // No interaction handler, default is to continue to load
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index a746d1ac89fb..f079afdea704 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -706,7 +706,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
 
         BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
         if ( pBasMgr )
-            return pBasMgr->GetDialogLibraryContainer().get();
+            return pBasMgr->GetDialogLibraryContainer();
     }
     catch (const css::ucb::ContentCreationException&)
     {
@@ -730,7 +730,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
 
             BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
             if ( pBasMgr )
-                return pBasMgr->GetScriptLibraryContainer().get();
+                return pBasMgr->GetScriptLibraryContainer();
         }
         catch (const css::ucb::ContentCreationException&)
         {
@@ -843,7 +843,7 @@ void SfxObjectShell::SetBaseModel( SfxBaseModel* pModel )
 
 css::uno::Reference< css::frame::XModel > SfxObjectShell::GetBaseModel() const
 {
-    return pImpl->pBaseModel.get();
+    return pImpl->pBaseModel;
 }
 
 void SfxObjectShell::SetAutoStyleFilterIndex(sal_uInt16 nSet)
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index dcd5fd6a6aaa..e1c457d2f338 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1702,7 +1702,7 @@ Reference< XUndoManager > SAL_CALL SfxBaseModel::getUndoManager(  )
     SfxModelGuard aGuard( *this );
     if ( !m_pData->m_pDocumentUndoManager.is() )
         m_pData->m_pDocumentUndoManager.set( new ::sfx2::DocumentUndoManager( *this ) );
-    return m_pData->m_pDocumentUndoManager.get();
+    return m_pData->m_pDocumentUndoManager;
 }
 
 
@@ -3368,7 +3368,7 @@ void SfxBaseModel::ListenForStorage_Impl( const Reference< embed::XStorage >& xS
         }
 
         // no need to deregister the listening for old storage since it should be disposed automatically
-        xModifiable->addModifyListener( m_pData->m_pStorageModifyListen.get() );
+        xModifiable->addModifyListener( m_pData->m_pStorageModifyListen );
     }
 }
 
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index ae12e361a6ba..b46de16deb08 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -151,7 +151,7 @@ rtl::Reference<SidebarController> SidebarController::create(SidebarDockingWindow
 
     const css::uno::Reference<css::frame::XFrame>& rxFrame = pViewFrame->GetFrame().GetFrameInterface();
     registerSidebarForFrame(instance.get(), rxFrame->getController());
-    rxFrame->addFrameActionListener(instance.get());
+    rxFrame->addFrameActionListener(instance);
     // Listen for window events.
     instance->mpParentWindow->AddEventListener(LINK(instance.get(), SidebarController, WindowEventHandler));
 
@@ -165,7 +165,7 @@ rtl::Reference<SidebarController> SidebarController::create(SidebarDockingWindow
     const util::URL aURL (Tools::GetURL(gsReadOnlyCommandName));
     instance->mxReadOnlyModeDispatch = Tools::GetDispatch(rxFrame, aURL);
     if (instance->mxReadOnlyModeDispatch.is())
-        instance->mxReadOnlyModeDispatch->addStatusListener(instance.get(), aURL);
+        instance->mxReadOnlyModeDispatch->addStatusListener(instance, aURL);
 
     //first UpdateConfigurations call will SwitchToDeck
 
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 9958e7943aee..8fb8a584cefe 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -126,7 +126,7 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, SidebarChi
     else
     {
         const SfxViewFrame* pViewFrame = pSfxBindings->GetDispatcher()->GetFrame();
-        mpSidebarController.set(sfx2::sidebar::SidebarController::create(this, pViewFrame).get());
+        mpSidebarController = sfx2::sidebar::SidebarController::create(this, pViewFrame);
     }
 }
 
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index c36856a5d624..d0bed6f97a67 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -399,8 +399,7 @@ void SfxClassificationHelper::Impl::parsePolicy()
 
     uno::Reference<xml::sax::XParser> xParser = xml::sax::Parser::create(xComponentContext);
     rtl::Reference<SfxClassificationParser> xClassificationParser(new SfxClassificationParser());
-    uno::Reference<xml::sax::XDocumentHandler> xHandler(xClassificationParser.get());
-    xParser->setDocumentHandler(xHandler);
+    xParser->setDocumentHandler(xClassificationParser);
     try
     {
         xParser->parseStream(aParserInput);
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index 1e5b6b2c3d39..3e96664527e0 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -230,7 +230,7 @@ SfxFrame* SfxFrame::CreateHidden( SfxObjectShell const & rDoc, vcl::Window& rWin
         Reference < XFrame2 > xFrame = Frame::create( xContext );
 
         Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW );
-        xFrame->initialize( xWin.get() );
+        xFrame->initialize( xWin );
         xDesktop->getFrames()->append( xFrame );
 
         if ( xWin->isActive() )
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index bb9c3218da21..b18b76efdd7c 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -469,13 +469,13 @@ void SfxFrameLoader_Impl::impl_handleCaughtError_nothrow( const Any& i_rCaughtEr
             return;
         ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( i_rCaughtError ) );
         ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove );
-        pRequest->addContinuation( pApprove.get() );
+        pRequest->addContinuation( pApprove );
 
         const Reference< XInteractionHandler2 > xHandler( xInteraction, UNO_QUERY );
     #if OSL_DEBUG_LEVEL > 0
         const bool bHandled =
     #endif
-        xHandler.is() && xHandler->handleInteractionRequest( pRequest.get() );
+        xHandler.is() && xHandler->handleInteractionRequest( pRequest );
 
     #if OSL_DEBUG_LEVEL > 0
         if ( !bHandled )
@@ -578,11 +578,11 @@ Reference< XController2 > SfxFrameLoader_Impl::impl_createDocumentView( const Re
     ), UNO_SET_THROW );
 
     // introduce model/view/controller to each other
-    xController->attachModel( i_rModel.get() );
-    i_rModel->connectController( xController.get() );
-    i_rFrame->setComponent( xController->getComponentWindow(), xController.get() );
+    xController->attachModel( i_rModel );
+    i_rModel->connectController( xController );
+    i_rFrame->setComponent( xController->getComponentWindow(), xController );
     xController->attachFrame( i_rFrame );
-    i_rModel->setCurrentController( xController.get() );
+    i_rModel->setCurrentController( xController );
 
     return xController;
 }
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 2f05207c1d02..89f57c7983fa 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -695,8 +695,8 @@ void SfxInPlaceClient::SetObject( const uno::Reference < embed::XEmbeddedObject
         {
             if ( GetObject()->getCurrentState() != embed::EmbedStates::LOADED )
                 SetObjectState( embed::EmbedStates::RUNNING );
-            m_xImp->m_xObject->removeEventListener( m_xImp.get() );
-            m_xImp->m_xObject->removeStateChangeListener( m_xImp.get() );
+            m_xImp->m_xObject->removeEventListener( m_xImp );
+            m_xImp->m_xObject->removeStateChangeListener( m_xImp );
             try
             {
                 m_xImp->m_xObject->setClientSite( nullptr );
@@ -718,12 +718,12 @@ void SfxInPlaceClient::SetObject( const uno::Reference < embed::XEmbeddedObject
     {
         // as soon as an object was connected to a client it has to be checked whether the object wants
         // to be activated
-        rObject->addStateChangeListener( m_xImp.get() );
-        rObject->addEventListener( m_xImp.get() );
+        rObject->addStateChangeListener( m_xImp );
+        rObject->addEventListener( m_xImp );
 
         try
         {
-            rObject->setClientSite( m_xImp.get() );
+            rObject->setClientSite( m_xImp );
         }
         catch( uno::Exception& )
         {
@@ -947,7 +947,7 @@ ErrCode SfxInPlaceClient::DoVerb(sal_Int32 nVerb)
                 m_pViewSh->GetViewFrame()->GetFrame().LockResize_Impl(true);
                 try
                 {
-                    m_xImp->m_xObject->setClientSite( m_xImp.get() );
+                    m_xImp->m_xObject->setClientSite( m_xImp );
 
                     m_xImp->m_xObject->doVerb( nVerb );
                 }
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index fd073fb253e1..170ce543da3b 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -236,8 +236,7 @@ bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler >
                  aPath,
                  true ) );
 
-            uno::Reference< css::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
-            xHandler->handle( rRequest );
+            xHandler->handle( pPasswordRequest );
 
             if ( pPasswordRequest->isPassword() )
             {
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 41bec12ba05f..4aa8f4d3d792 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1778,7 +1778,7 @@ void SfxViewShell::SetController( SfxBaseController* pController )
 
 Reference < XController > SfxViewShell::GetController() const
 {
-    return pImpl->m_pController.get();
+    return pImpl->m_pController;
 }
 
 SfxBaseController* SfxViewShell::GetBaseController_Impl() const


More information about the Libreoffice-commits mailing list