[Libreoffice-commits] core.git: cui/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 23 07:35:59 UTC 2021


 cui/source/dialogs/AdditionsDialog.cxx |    6 ++----
 cui/source/options/webconninfo.cxx     |    5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit c2a0896183f33fab5f643400b171b031af5e468e
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Tue Feb 23 08:36:20 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Feb 23 08:35:19 2021 +0100

    loplugin:refcounting in cui
    
    Change-Id: I09b71657f9f5fef733cbaae8a2eda457735b50cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111368
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/dialogs/AdditionsDialog.cxx b/cui/source/dialogs/AdditionsDialog.cxx
index a6f21fe6bdda..4ea381e385db 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -755,14 +755,12 @@ IMPL_LINK_NOARG(AdditionsItem, InstallHdl, weld::Button&, void)
         return;
     }
 
-    TmpRepositoryCommandEnv* pCmdEnv = new TmpRepositoryCommandEnv();
-    uno::Reference<ucb::XCommandEnvironment> xCmdEnv(static_cast<cppu::OWeakObject*>(pCmdEnv),
-                                                     uno::UNO_QUERY);
+    rtl::Reference<TmpRepositoryCommandEnv> pCmdEnv = new TmpRepositoryCommandEnv();
     uno::Reference<task::XAbortChannel> xAbortChannel;
     try
     {
         m_pParentDialog->m_xExtensionManager->addExtension(
-            aExtensionFile, uno::Sequence<beans::NamedValue>(), "user", xAbortChannel, xCmdEnv);
+            aExtensionFile, uno::Sequence<beans::NamedValue>(), "user", xAbortChannel, pCmdEnv);
         m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLEDBUTTON));
     }
     catch (const ucb::CommandFailedException)
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index 1d3abe82f860..b8ae35dba1e3 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -178,13 +178,12 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, ChangePasswordHdl, weld::Button&, void)
             OUString aURL = m_xPasswordsLB->get_text(nEntry, 0);
             OUString aUserName = m_xPasswordsLB->get_text(nEntry, 1);
 
-            ::comphelper::SimplePasswordRequest* pPasswordRequest
+            rtl::Reference<::comphelper::SimplePasswordRequest> pPasswordRequest
                   = new ::comphelper::SimplePasswordRequest;
-            uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest );
 
             uno::Reference< task::XInteractionHandler > xInteractionHandler =
                 task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), m_xDialog->GetXWindow());
-            xInteractionHandler->handle( rRequest );
+            xInteractionHandler->handle( pPasswordRequest );
 
             if ( pPasswordRequest->isPassword() )
             {


More information about the Libreoffice-commits mailing list