fpicker/source/office/RemoteFilesDialog.cxx  |   10 ++++------
 fpicker/source/office/iodlg.cxx              |    5 ++---
 include/ucbhelper/interceptedinteraction.hxx |    5 ++++-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 9a61e9a3356874a23a697ace57a53e3ada505d87
Author:     Noel <noel.gran...@collabora.co.uk>
AuthorDate: Sun Feb 21 20:02:21 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Feb 23 07:30:05 2021 +0100

    loplugin:refcounting in fpicker
    
    Change-Id: Ia14d2a874d559c4438a33c8a46ec6076802cd637
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111285
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx 
b/fpicker/source/office/RemoteFilesDialog.cxx
index 30115abd93e8..1282d47115a3 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -683,11 +683,10 @@ IMPL_LINK ( RemoteFilesDialog, EditServiceMenuHdl, const 
OString&, rIdent, void
                     {
                         OUString sUserName = aURLEntries.UserList[0].UserName;
 
-                        ::comphelper::SimplePasswordRequest* pPasswordRequest
+                        rtl::Reference<::comphelper::SimplePasswordRequest> 
pPasswordRequest
                             = new ::comphelper::SimplePasswordRequest;
-                        Reference< XInteractionRequest > rRequest( 
pPasswordRequest );
 
-                        xInteractionHandler->handle( rRequest );
+                        xInteractionHandler->handle( pPasswordRequest );
 
                         if ( pPasswordRequest->isPassword() )
                         {
@@ -1180,10 +1179,9 @@ bool RemoteFilesDialog::ContentIsDocument( const 
OUString& rURL )
             // It's a webdav URL, so use the same open sequence as in normal 
open process.
             // Let's use a comphelper::StillReadWriteInteraction to trap 
errors here without showing the user.
             // This sequence will result in an exception if the target URL 
resource is not present
-            comphelper::StillReadWriteInteraction* pInteraction = new 
comphelper::StillReadWriteInteraction(xInteractionHandler,xInteractionHandler);
-            css::uno::Reference< css::task::XInteractionHandler > 
xInteraction(static_cast< css::task::XInteractionHandler* >(pInteraction), 
css::uno::UNO_QUERY);
+            rtl::Reference<comphelper::StillReadWriteInteraction> pInteraction 
= new 
comphelper::StillReadWriteInteraction(xInteractionHandler,xInteractionHandler);
 
-            Reference< XCommandEnvironment > xEnv = new 
::ucbhelper::CommandEnvironment( xInteraction, Reference< XProgressHandler >() 
);
+            Reference< XCommandEnvironment > xEnv = new 
::ucbhelper::CommandEnvironment( pInteraction, Reference< XProgressHandler >() 
);
             ::ucbhelper::Content aContent( rURL, xEnv, m_xContext );
 
             aContent.openStream();
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index cbb354ecf585..fe199ae5a530 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1401,14 +1401,13 @@ void SvtFileDialog::displayIOException( const OUString& 
_rURL, IOErrorCode _eCod
         aException.Classification = InteractionClassification_ERROR;
 
         // let and interaction handler handle this exception
-        ::comphelper::OInteractionRequest* pRequest = nullptr;
-        Reference< css::task::XInteractionRequest > xRequest = pRequest =
+        rtl::Reference<::comphelper::OInteractionRequest> pRequest =
             new ::comphelper::OInteractionRequest( makeAny( aException ) );
         pRequest->addContinuation( new ::comphelper::OInteractionAbort( ) );
 
         Reference< XInteractionHandler2 > xHandler(
             InteractionHandler::createWithParent( 
::comphelper::getProcessComponentContext(), nullptr ) );
-        xHandler->handle( xRequest );
+        xHandler->handle( pRequest );
     }
     catch( const Exception& )
     {
diff --git a/include/ucbhelper/interceptedinteraction.hxx 
b/include/ucbhelper/interceptedinteraction.hxx
index b6a410ca3dba..85699c1d534b 100644
--- a/include/ucbhelper/interceptedinteraction.hxx
+++ b/include/ucbhelper/interceptedinteraction.hxx
@@ -41,7 +41,10 @@ namespace ucbhelper{
               only
             - or as base class if interactions must be modified.
  */
-class UCBHELPER_DLLPUBLIC InterceptedInteraction : public 
::cppu::WeakImplHelper< css::task::XInteractionHandler >
+// extra struct to work around MSVC linking issue
+struct InterceptedInteraction_Base : public ::cppu::WeakImplHelper< 
css::task::XInteractionHandler > {};
+
+class UCBHELPER_DLLPUBLIC InterceptedInteraction : public 
InterceptedInteraction_Base
 {
 
     // types
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to