include/ucbhelper/interactionrequest.hxx                    |  151 +------
 package/source/xstor/oseekinstream.cxx                      |   40 -
 package/source/xstor/oseekinstream.hxx                      |   12 
 sfx2/source/doc/docfile.cxx                                 |   16 
 svl/source/passwordcontainer/passwordcontainer.cxx          |    2 
 ucb/source/core/ucbcmds.cxx                                 |    6 
 ucb/source/ucp/cmis/auth_provider.cxx                       |    4 
 ucb/source/ucp/gio/gio_mount.cxx                            |    2 
 ucb/source/ucp/tdoc/tdoc_content.cxx                        |    4 
 ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx                |   75 ---
 ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx            |    2 
 ucbhelper/source/provider/interactionrequest.cxx            |  245 ------------
 ucbhelper/source/provider/simpleinteractionrequest.cxx      |   10 
 ucbhelper/source/provider/simplenameclashresolverequest.cxx |   60 --
 unotools/source/ucbhelper/ucblockbytes.cxx                  |    3 
 15 files changed, 64 insertions(+), 568 deletions(-)

New commits:
commit 16a534c61752aadbcb83bf876f752f444f471d2a
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Dec 9 00:12:34 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Dec 9 05:26:39 2024 +0100

    Simplify OInputSeekStream
    
    Change-Id: Ie8da09ad8f3e4425aaeb87f907e47a4e2148f164
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178118
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/package/source/xstor/oseekinstream.cxx 
b/package/source/xstor/oseekinstream.cxx
index f5e3d644d673..c791b96fe5e2 100644
--- a/package/source/xstor/oseekinstream.cxx
+++ b/package/source/xstor/oseekinstream.cxx
@@ -32,7 +32,7 @@ OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl,
                                     uno::Reference < io::XInputStream > const 
& xStream,
                                     const uno::Sequence< beans::PropertyValue 
>& aProps,
                                     sal_Int32 nStorageType )
-: OInputCompStream( pImpl, xStream, aProps, nStorageType )
+    : OInputSeekStream_BASE(pImpl, xStream, aProps, nStorageType)
 {
     m_xSeekable.set( m_xStream, uno::UNO_QUERY );
     OSL_ENSURE( m_xSeekable.is(), "No seeking support!" );
@@ -41,7 +41,7 @@ OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl,
 OInputSeekStream::OInputSeekStream( uno::Reference < io::XInputStream > const 
& xStream,
                                     const uno::Sequence< beans::PropertyValue 
>& aProps,
                                     sal_Int32 nStorageType )
-: OInputCompStream( xStream, aProps, nStorageType )
+    : OInputSeekStream_BASE(xStream, aProps, nStorageType)
 {
     m_xSeekable.set( m_xStream, uno::UNO_QUERY );
     OSL_ENSURE( m_xSeekable.is(), "No seeking support!" );
@@ -51,42 +51,6 @@ OInputSeekStream::~OInputSeekStream()
 {
 }
 
-uno::Sequence< uno::Type > SAL_CALL OInputSeekStream::getTypes()
-{
-    static cppu::OTypeCollection 
aTypeCollection(cppu::UnoType<io::XSeekable>::get(),
-                                                   
OInputCompStream::getTypes());
-
-    return aTypeCollection.getTypes();
-}
-
-uno::Any SAL_CALL OInputSeekStream::queryInterface( const uno::Type& rType )
-{
-    // Attention:
-    //  Don't use mutex or guard in this method!!! Is a method of XInterface.
-
-    uno::Any aReturn( ::cppu::queryInterface( rType,
-                                           static_cast< io::XSeekable* >( this 
) ) );
-
-    if ( aReturn.hasValue() )
-    {
-        return aReturn ;
-    }
-
-    return OInputCompStream::queryInterface( rType ) ;
-}
-
-void SAL_CALL OInputSeekStream::acquire()
-        noexcept
-{
-    OInputCompStream::acquire();
-}
-
-void SAL_CALL OInputSeekStream::release()
-        noexcept
-{
-    OInputCompStream::release();
-}
-
 void SAL_CALL OInputSeekStream::seek( sal_Int64 location )
 {
     ::osl::MutexGuard aGuard( m_xMutex->GetMutex() );
diff --git a/package/source/xstor/oseekinstream.hxx 
b/package/source/xstor/oseekinstream.hxx
index a77289e9a3ed..8ecc55964c45 100644
--- a/package/source/xstor/oseekinstream.hxx
+++ b/package/source/xstor/oseekinstream.hxx
@@ -24,8 +24,8 @@
 
 #include "ocompinstream.hxx"
 
-class OInputSeekStream final : public OInputCompStream
-                        , public css::io::XSeekable
+using OInputSeekStream_BASE = cppu::ImplInheritanceHelper<OInputCompStream, 
css::io::XSeekable>;
+class OInputSeekStream final : public OInputSeekStream_BASE
 {
     css::uno::Reference < css::io::XSeekable > m_xSeekable;
 
@@ -41,18 +41,10 @@ public:
 
     virtual ~OInputSeekStream() override;
 
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType 
) override;
-    virtual void SAL_CALL acquire() noexcept override;
-    virtual void SAL_CALL release() noexcept override;
-
     //XSeekable
     virtual void SAL_CALL seek( sal_Int64 location ) override;
     virtual sal_Int64 SAL_CALL getPosition() override;
     virtual sal_Int64 SAL_CALL getLength() override;
-
 };
 
 #endif
commit e512091e89f2489e8b4a5dd5a19880b508c6867b
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Dec 8 23:50:13 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Dec 9 05:26:24 2024 +0100

    Simplify InteractionContinuation and derivatives
    
    Change-Id: Ib7294cc09255f7563ae14488ab7fb56d02092dc4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178117
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/include/ucbhelper/interactionrequest.hxx 
b/include/ucbhelper/interactionrequest.hxx
index 166e7ce137b6..ae8bf4d6dcef 100644
--- a/include/ucbhelper/interactionrequest.hxx
+++ b/include/ucbhelper/interactionrequest.hxx
@@ -130,7 +130,7 @@ public:
   * method the way that they simply call recordSelection() which is provided by
   * this class.
   */
-class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionContinuation : public 
cppu::OWeakObject
+class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionContinuation : public 
cppu::WeakImplHelper<>
 {
     InteractionRequest* m_pRequest;
 
@@ -150,138 +150,84 @@ public:
 };
 
 
+using InteractionAbort_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                          
css::task::XInteractionAbort>;
 /**
   * This class implements a standard interaction continuation, namely the
   * interface XInteractionAbort. Instances of this class can be passed
   * along with an interaction request to indicate the possibility to abort
   * the operation that caused the request.
   */
-class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionAbort final : public 
InteractionContinuation,
-                         public css::lang::XTypeProvider,
-                         public css::task::XInteractionAbort
+class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionAbort final : public 
InteractionAbort_BASE
 {
 public:
     InteractionAbort( InteractionRequest * pRequest )
-    : InteractionContinuation( pRequest ) {}
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire() noexcept override
-    { OWeakObject::acquire(); }
-    virtual void SAL_CALL release() noexcept override
-    { OWeakObject::release(); }
-
-    // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL
-    getTypes() override;
-    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
-    getImplementationId() override;
+    : InteractionAbort_BASE( pRequest ) {}
 
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
 };
 
 
+using InteractionRetry_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                          
css::task::XInteractionRetry>;
 /**
   * This class implements a standard interaction continuation, namely the
   * interface XInteractionRetry. Instances of this class can be passed
   * along with an interaction request to indicate the possibility to retry
   * the operation that caused the request.
   */
-class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionRetry final : public 
InteractionContinuation,
-                         public css::lang::XTypeProvider,
-                         public css::task::XInteractionRetry
+class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionRetry final : public 
InteractionRetry_BASE
 {
 public:
     InteractionRetry( InteractionRequest * pRequest )
-    : InteractionContinuation( pRequest ) {}
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire() noexcept override
-    { OWeakObject::acquire(); }
-    virtual void SAL_CALL release() noexcept override
-    { OWeakObject::release(); }
-
-    // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL
-    getTypes() override;
-    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
-    getImplementationId() override;
+    : InteractionRetry_BASE( pRequest ) {}
 
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
 };
 
 
+using InteractionApprove_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                            
css::task::XInteractionApprove>;
 /**
   * This class implements a standard interaction continuation, namely the
   * interface XInteractionApprove. Instances of this class can be passed
   * along with an interaction request to indicate the possibility to approve
   * the request.
   */
-class UCBHELPER_DLLPUBLIC InteractionApprove final : public 
InteractionContinuation,
-                           public css::lang::XTypeProvider,
-                           public css::task::XInteractionApprove
+class UCBHELPER_DLLPUBLIC InteractionApprove final : public 
InteractionApprove_BASE
 {
 public:
     InteractionApprove( InteractionRequest * pRequest )
-    : InteractionContinuation( pRequest ) {}
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire() noexcept override
-    { OWeakObject::acquire(); }
-    virtual void SAL_CALL release() noexcept override
-    { OWeakObject::release(); }
-
-    // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL
-    getTypes() override;
-    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
-    getImplementationId() override;
+    : InteractionApprove_BASE( pRequest ) {}
 
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
 };
 
 
+using InteractionDisapprove_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                               
css::task::XInteractionDisapprove>;
 /**
   * This class implements a standard interaction continuation, namely the
   * interface XInteractionDisapprove. Instances of this class can be passed
   * along with an interaction request to indicate the possibility to disapprove
   * the request.
   */
-class UCBHELPER_DLLPUBLIC InteractionDisapprove final : public 
InteractionContinuation,
-                              public css::lang::XTypeProvider,
-                              public css::task::XInteractionDisapprove
+class UCBHELPER_DLLPUBLIC InteractionDisapprove final : public 
InteractionDisapprove_BASE
 {
 public:
     InteractionDisapprove( InteractionRequest * pRequest )
-    : InteractionContinuation( pRequest ) {}
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire() noexcept override
-    { OWeakObject::acquire(); }
-    virtual void SAL_CALL release() noexcept override
-    { OWeakObject::release(); }
-
-    // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL
-    getTypes() override;
-    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
-    getImplementationId() override;
+    : InteractionDisapprove_BASE( pRequest ) {}
 
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
 };
 
 
+using InteractionSupplyAuthentication_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                                         
css::ucb::XInteractionSupplyAuthentication2>;
 /**
   * This class implements a standard interaction continuation, namely the
   * interface XInteractionSupplyAuthentication. Instances of this class can be
@@ -289,9 +235,7 @@ public:
   * interaction handler to supply the missing authentication data.
   */
 class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication final :
-                  public InteractionContinuation,
-                  public css::lang::XTypeProvider,
-                  public css::ucb::XInteractionSupplyAuthentication2
+                  public InteractionSupplyAuthentication_BASE
 {
     css::uno::Sequence< css::ucb::RememberAuthentication >
                   m_aRememberPasswordModes;
@@ -355,20 +299,6 @@ public:
                     const css::ucb::RememberAuthentication  
eDefaultRememberAccountMode,
                     bool bCanUseSystemCredentials );
 
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire() noexcept override
-    { OWeakObject::acquire(); }
-    virtual void SAL_CALL release() noexcept override
-    { OWeakObject::release(); }
-
-    // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL
-    getTypes() override;
-    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
-    getImplementationId() override;
-
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
 
@@ -461,7 +391,7 @@ inline 
InteractionSupplyAuthentication::InteractionSupplyAuthentication(
     const css::uno::Sequence< css::ucb::RememberAuthentication > & 
rRememberAccountModes,
     const css::ucb::RememberAuthentication eDefaultRememberAccountMode,
     bool bCanUseSystemCredentials )
-: InteractionContinuation( pRequest ),
+: InteractionSupplyAuthentication_BASE( pRequest ),
   m_aRememberPasswordModes( rRememberPasswordModes ),
   m_aRememberAccountModes( rRememberAccountModes ),
   m_eRememberPasswordMode( eDefaultRememberPasswordMode ),
@@ -477,6 +407,8 @@ inline 
InteractionSupplyAuthentication::InteractionSupplyAuthentication(
 }
 
 
+using InteractionReplaceExistingData_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                                        
css::ucb::XInteractionReplaceExistingData>;
 /**
   * This class implements a standard interaction continuation, namely the
   * interface XInteractionReplaceExistingData. Instances of this class can be
@@ -484,49 +416,26 @@ inline 
InteractionSupplyAuthentication::InteractionSupplyAuthentication(
   * replace existing data.
   */
 class InteractionReplaceExistingData final :
-                  public InteractionContinuation,
-                  public css::lang::XTypeProvider,
-                  public css::ucb::XInteractionReplaceExistingData
+                  public InteractionReplaceExistingData_BASE
 {
 public:
     InteractionReplaceExistingData( InteractionRequest * pRequest )
-    : InteractionContinuation( pRequest ) {}
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire() noexcept override
-    { OWeakObject::acquire(); }
-    virtual void SAL_CALL release() noexcept override
-    { OWeakObject::release(); }
-
-    // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL
-    getTypes() override;
-    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
-    getImplementationId() override;
+    : InteractionReplaceExistingData_BASE( pRequest ) {}
 
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
 };
 
+using InteractionAuthFallback_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                                 
css::ucb::XInteractionAuthFallback>;
 class UCBHELPER_DLLPUBLIC InteractionAuthFallback final :
-                  public InteractionContinuation,
-                  public css::ucb::XInteractionAuthFallback
+                  public InteractionAuthFallback_BASE
 {
     OUString m_aCode;
 
 public:
     InteractionAuthFallback( InteractionRequest * pRequest )
-    : InteractionContinuation( pRequest ) {}
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire() noexcept override
-    { OWeakObject::acquire(); }
-    virtual void SAL_CALL release() noexcept override
-    { OWeakObject::release(); }
+    : InteractionAuthFallback_BASE( pRequest ) {}
 
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
@@ -535,8 +444,6 @@ public:
     virtual void SAL_CALL setCode( const OUString& code ) override;
     /// @throws css::uno::RuntimeException
     const OUString& getCode() const;
-
-
 };
 
 
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 13711a5a31c5..4b637f2405cf 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -589,7 +589,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& 
aInitDate )
         xHandler->handle( xInteractionRequestImpl );
 
         ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = 
xInteractionRequestImpl->getSelection();
-        if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), 
uno::UNO_QUERY ).is() )
+        if ( uno::Reference< task::XInteractionAbort >( 
cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() )
         {
             SetError(ERRCODE_ABORT);
         }
@@ -1170,11 +1170,11 @@ SfxMedium::ShowLockResult 
SfxMedium::ShowLockedDocumentDialog(const LockFileEntr
 
         bool bOpenReadOnly = false;
         ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = 
xInteractionRequestImpl->getSelection();
-        if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), 
uno::UNO_QUERY ).is() )
+        if ( uno::Reference< task::XInteractionAbort >( 
cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() )
         {
             SetError(ERRCODE_ABORT);
         }
-        else if ( uno::Reference< task::XInteractionDisapprove >( 
xSelected.get(), uno::UNO_QUERY ).is() )
+        else if ( uno::Reference< task::XInteractionDisapprove >( 
cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() )
         {
             // own lock on loading, user has selected to ignore the lock
             // own lock on saving, user has selected to ignore the lock
@@ -1188,12 +1188,12 @@ SfxMedium::ShowLockResult 
SfxMedium::ShowLockedDocumentDialog(const LockFileEntr
             else
                 nResult = ShowLockResult::Succeeded;
         }
-        else if (uno::Reference< task::XInteractionRetry >(xSelected.get(), 
uno::UNO_QUERY).is())
+        else if (uno::Reference< task::XInteractionRetry 
>(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is())
         {
             // User decided to ignore the alien (stale?) lock file without 
filesystem lock
             nResult = ShowLockResult::Succeeded;
         }
-        else if (uno::Reference< task::XInteractionApprove >( xSelected.get(), 
uno::UNO_QUERY ).is())
+        else if (uno::Reference< task::XInteractionApprove >( 
cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is())
         {
             bOpenReadOnly = true;
         }
@@ -1264,12 +1264,12 @@ bool SfxMedium::ShowLockFileProblemDialog(MessageDlg 
nWhichDlg)
         ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = 
xIgnoreRequestImpl->getSelection();
         bool bReadOnly = true;
 
-        if (uno::Reference<task::XInteractionAbort>(xSelected.get(), 
uno::UNO_QUERY).is())
+        if 
(uno::Reference<task::XInteractionAbort>(cppu::getXWeak(xSelected.get()), 
uno::UNO_QUERY).is())
         {
             SetError(ERRCODE_ABORT);
             bReadOnly = false;
         }
-        else if (!uno::Reference<task::XInteractionApprove>(xSelected.get(), 
uno::UNO_QUERY).is())
+        else if 
(!uno::Reference<task::XInteractionApprove>(cppu::getXWeak(xSelected.get()), 
uno::UNO_QUERY).is())
         {
             // user selected "Notify"
             pImpl->m_bNotifyWhenEditable = true;
@@ -4940,7 +4940,7 @@ IMPL_STATIC_LINK(SfxMedium, ShowReloadEditableDialog, 
void*, p, void)
             xHandler->handle(xInteractionRequestImpl);
             ::rtl::Reference<::ucbhelper::InteractionContinuation> xSelected
                 = xInteractionRequestImpl->getSelection();
-            if (uno::Reference<task::XInteractionApprove>(xSelected.get(), 
uno::UNO_QUERY).is())
+            if 
(uno::Reference<task::XInteractionApprove>(cppu::getXWeak(xSelected.get()), 
uno::UNO_QUERY).is())
             {
                 for (SfxViewFrame* pFrame = SfxViewFrame::GetFirst(); pFrame;
                      pFrame = SfxViewFrame::GetNext(*pFrame))
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx 
b/svl/source/passwordcontainer/passwordcontainer.cxx
index 447909ab4944..31e6535c4163 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -828,7 +828,7 @@ OUString PasswordContainer::RequestPasswordFromUser( 
PasswordRequestMode aRMode,
 
         if ( xSelection.is() )
         {
-            Reference< XInteractionAbort > xAbort( xSelection.get(), UNO_QUERY 
);
+            Reference< XInteractionAbort > xAbort( xSelection->getXWeak(), 
UNO_QUERY );
             if ( !xAbort.is() )
             {
                 const ::rtl::Reference< 
ucbhelper::InteractionSupplyAuthentication > & xSupp
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index e5be74883fa0..7995e6746629 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -376,7 +376,7 @@ NameClashContinuation interactiveNameClashResolve(
             {
                 // Handler handled the request.
                 uno::Reference< task::XInteractionAbort > xAbort(
-                    xSelection.get(), uno::UNO_QUERY );
+                    xSelection->getXWeak(), uno::UNO_QUERY );
                 if ( xAbort.is() )
                 {
                     // Abort.
@@ -387,7 +387,7 @@ NameClashContinuation interactiveNameClashResolve(
                     uno::Reference<
                         ucb::XInteractionReplaceExistingData >
                             xReplace(
-                                xSelection.get(), uno::UNO_QUERY );
+                                xSelection->getXWeak(), uno::UNO_QUERY );
                     if ( xReplace.is() )
                     {
                         // Try again: Replace existing data.
@@ -398,7 +398,7 @@ NameClashContinuation interactiveNameClashResolve(
                         uno::Reference<
                             ucb::XInteractionSupplyName >
                                 xSupplyName(
-                                    xSelection.get(), uno::UNO_QUERY );
+                                    xSelection->getXWeak(), uno::UNO_QUERY );
                         if ( xSupplyName.is() )
                         {
                             // Try again: Use new name.
diff --git a/ucb/source/ucp/cmis/auth_provider.cxx 
b/ucb/source/ucp/cmis/auth_provider.cxx
index 3123ae64d430..6c6a4535e0bc 100644
--- a/ucb/source/ucp/cmis/auth_provider.cxx
+++ b/ucb/source/ucp/cmis/auth_provider.cxx
@@ -48,7 +48,7 @@ namespace cmis
                 {
                     // Handler handled the request.
                     uno::Reference< task::XInteractionAbort > xAbort(
-                        xSelection.get(), uno::UNO_QUERY );
+                        xSelection->getXWeak(), uno::UNO_QUERY );
                     if ( !xAbort.is() )
                     {
                         const rtl::Reference<
@@ -91,7 +91,7 @@ namespace cmis
                 if (xSelection.is())
                 {
                     // Handler handled the request.
-                    uno::Reference<task::XInteractionAbort> 
xAbort(xSelection.get(),
+                    uno::Reference<task::XInteractionAbort> 
xAbort(xSelection->getXWeak(),
                                                                    
uno::UNO_QUERY);
                     if (!xAbort.is())
                     {
diff --git a/ucb/source/ucp/gio/gio_mount.cxx b/ucb/source/ucp/gio/gio_mount.cxx
index 1d2dbcea8142..11e4117deb82 100644
--- a/ucb/source/ucp/gio/gio_mount.cxx
+++ b/ucb/source/ucp/gio/gio_mount.cxx
@@ -157,7 +157,7 @@ static void ooo_mount_operation_ask_password 
(GMountOperation *op,
         return;
     }
 
-    css::uno::Reference< css::task::XInteractionAbort > 
xAbort(xSelection.get(), css::uno::UNO_QUERY );
+    css::uno::Reference< css::task::XInteractionAbort > 
xAbort(xSelection->getXWeak(), css::uno::UNO_QUERY );
     if ( xAbort.is() )
     {
         g_mount_operation_reply (op, G_MOUNT_OPERATION_ABORTED);
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx 
b/ucb/source/ucp/tdoc/tdoc_content.cxx
index 6580c8af6b67..dcc2653beade 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -2627,7 +2627,7 @@ static OUString obtainPassword(
             {
                 // Handler handled the request.
                 uno::Reference< task::XInteractionAbort > xAbort(
-                    xSelection.get(), uno::UNO_QUERY );
+                    xSelection->getXWeak(), uno::UNO_QUERY );
                 if ( xAbort.is() )
                 {
                     throw ucb::CommandFailedException(
@@ -2637,7 +2637,7 @@ static OUString obtainPassword(
                 }
 
                 uno::Reference< task::XInteractionPassword > xPassword(
-                    xSelection.get(), uno::UNO_QUERY );
+                    xSelection->getXWeak(), uno::UNO_QUERY );
                 if ( xPassword.is() )
                 {
                     return xPassword->getPassword();
diff --git a/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx 
b/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx
index 412b39fe8a62..76ceff75f1d0 100644
--- a/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_passwordrequest.cxx
@@ -37,25 +37,13 @@ namespace tdoc_ucp
 {
     namespace {
 
-    class InteractionSupplyPassword :
-                      public ucbhelper::InteractionContinuation,
-                      public lang::XTypeProvider,
-                      public task::XInteractionPassword
+    using InteractionSupplyPassword_BASE = 
cppu::ImplInheritanceHelper<ucbhelper::InteractionContinuation,
+                                                                       
task::XInteractionPassword>;
+    class InteractionSupplyPassword : public InteractionSupplyPassword_BASE
     {
     public:
         explicit InteractionSupplyPassword( ucbhelper::InteractionRequest * 
pRequest )
-            : InteractionContinuation( pRequest ) {}
-
-        // XInterface
-        virtual uno::Any SAL_CALL queryInterface( const uno::Type & rType ) 
override;
-        virtual void SAL_CALL acquire()
-            noexcept override;
-        virtual void SAL_CALL release()
-            noexcept override;
-
-        // XTypeProvider
-        virtual uno::Sequence< uno::Type > SAL_CALL getTypes() override;
-        virtual uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
+            : InteractionSupplyPassword_BASE( pRequest ) {}
 
         // XInteractionContinuation
         virtual void SAL_CALL select() override;
@@ -76,61 +64,6 @@ namespace tdoc_ucp
 // InteractionSupplyPassword Implementation.
 
 
-// XInterface methods.
-
-
-// virtual
-void SAL_CALL InteractionSupplyPassword::acquire()
-    noexcept
-{
-    OWeakObject::acquire();
-}
-
-
-// virtual
-void SAL_CALL InteractionSupplyPassword::release()
-    noexcept
-{
-    OWeakObject::release();
-}
-
-
-// virtual
-uno::Any SAL_CALL
-InteractionSupplyPassword::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-                static_cast< lang::XTypeProvider * >( this ),
-                static_cast< task::XInteractionContinuation * >( this ),
-                static_cast< task::XInteractionPassword * >( this ) );
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-
-// XTypeProvider methods.
-
-
-// virtual
-uno::Sequence< sal_Int8 > SAL_CALL
-InteractionSupplyPassword::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-
-// virtual
-uno::Sequence< uno::Type > SAL_CALL InteractionSupplyPassword::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<task::XInteractionPassword>::get() );
-
-    return s_aCollection.getTypes();
-}
-
-
 // XInteractionContinuation methods.
 
 
diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx 
b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
index 5fc9eccc1acd..e24c98fc3e77 100644
--- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
@@ -80,7 +80,7 @@ int DAVAuthListener_Impl::authenticate(
             {
                 // Handler handled the request.
                 uno::Reference< task::XInteractionAbort > xAbort(
-                    xSelection.get(), uno::UNO_QUERY );
+                    xSelection->getXWeak(), uno::UNO_QUERY );
                 if ( !xAbort.is() )
                 {
                     const rtl::Reference<
diff --git a/ucbhelper/source/provider/interactionrequest.cxx 
b/ucbhelper/source/provider/interactionrequest.cxx
index 0ac7ec94995c..1e4ca4dab319 100644
--- a/ucbhelper/source/provider/interactionrequest.cxx
+++ b/ucbhelper/source/provider/interactionrequest.cxx
@@ -143,44 +143,6 @@ void InteractionContinuation::recordSelection()
 // InteractionAbort Implementation.
 
 
-// XInterface methods.
-
-
-// virtual
-uno::Any SAL_CALL
-InteractionAbort::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-                static_cast< lang::XTypeProvider * >( this ),
-                static_cast< task::XInteractionContinuation * >( this ),
-                static_cast< task::XInteractionAbort * >( this ) );
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-
-// XTypeProvider methods.
-
-
-// virtual
-uno::Sequence< sal_Int8 > SAL_CALL InteractionAbort::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-
-// virtual
-uno::Sequence< uno::Type > SAL_CALL InteractionAbort::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<task::XInteractionAbort>::get() );
-
-    return s_aCollection.getTypes();
-}
-
-
 // XInteractionContinuation methods.
 
 
@@ -194,44 +156,6 @@ void SAL_CALL InteractionAbort::select()
 // InteractionRetry Implementation.
 
 
-// XInterface methods.
-
-
-// virtual
-uno::Any SAL_CALL
-InteractionRetry::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-                static_cast< lang::XTypeProvider * >( this ),
-                static_cast< task::XInteractionContinuation * >( this ),
-                static_cast< task::XInteractionRetry * >( this ) );
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-
-// XTypeProvider methods.
-
-
-// virtual
-uno::Sequence< sal_Int8 > SAL_CALL InteractionRetry::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-
-// virtual
-uno::Sequence< uno::Type > SAL_CALL InteractionRetry::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<task::XInteractionRetry>::get() );
-
-    return s_aCollection.getTypes();
-}
-
-
 // XInteractionContinuation methods.
 
 
@@ -245,44 +169,6 @@ void SAL_CALL InteractionRetry::select()
 // InteractionApprove Implementation.
 
 
-// XInterface methods.
-
-
-// virtual
-uno::Any SAL_CALL
-InteractionApprove::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-                static_cast< lang::XTypeProvider * >( this ),
-                static_cast< task::XInteractionContinuation * >( this ),
-                static_cast< task::XInteractionApprove * >( this ) );
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-
-// XTypeProvider methods.
-
-
-// virtual
-uno::Sequence< sal_Int8 > SAL_CALL InteractionApprove::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-
-// virtual
-uno::Sequence< uno::Type > SAL_CALL InteractionApprove::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<task::XInteractionApprove>::get() );
-
-    return s_aCollection.getTypes();
-}
-
-
 // XInteractionContinuation methods.
 
 
@@ -296,44 +182,6 @@ void SAL_CALL InteractionApprove::select()
 // InteractionDisapprove Implementation.
 
 
-// XInterface methods.
-
-
-// virtual
-uno::Any SAL_CALL
-InteractionDisapprove::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-                static_cast< lang::XTypeProvider * >( this ),
-                static_cast< task::XInteractionContinuation * >( this ),
-                static_cast< task::XInteractionDisapprove * >( this ) );
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-
-// XTypeProvider methods.
-
-
-// virtual
-uno::Sequence< sal_Int8 > SAL_CALL InteractionDisapprove::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-
-// virtual
-uno::Sequence< uno::Type > SAL_CALL InteractionDisapprove::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<task::XInteractionDisapprove>::get() );
-
-    return s_aCollection.getTypes();
-}
-
-
 // XInteractionContinuation methods.
 
 
@@ -347,46 +195,6 @@ void SAL_CALL InteractionDisapprove::select()
 // InteractionSupplyAuthentication Implementation.
 
 
-// XInterface methods.
-
-
-// virtual
-uno::Any SAL_CALL
-InteractionSupplyAuthentication::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-            static_cast< lang::XTypeProvider * >( this ),
-            static_cast< task::XInteractionContinuation * >( this ),
-            static_cast< ucb::XInteractionSupplyAuthentication * >( this ),
-            static_cast< ucb::XInteractionSupplyAuthentication2 * >( this ));
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-
-// XTypeProvider methods.
-
-
-// virtual
-uno::Sequence< sal_Int8 > SAL_CALL
-InteractionSupplyAuthentication::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-
-// virtual
-uno::Sequence< uno::Type > SAL_CALL InteractionSupplyAuthentication::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<ucb::XInteractionSupplyAuthentication2>::get() );
-
-    return s_aCollection.getTypes();
-}
-
-
 // XInteractionContinuation methods.
 
 
@@ -538,45 +346,6 @@ void SAL_CALL 
InteractionSupplyAuthentication::setUseSystemCredentials(
 // InteractionReplaceExistingData Implementation.
 
 
-// XInterface methods.
-
-
-// virtual
-uno::Any SAL_CALL
-InteractionReplaceExistingData::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-                static_cast< lang::XTypeProvider * >( this ),
-                static_cast< task::XInteractionContinuation * >( this ),
-                static_cast< ucb::XInteractionReplaceExistingData * >( this ) 
);
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-
-// XTypeProvider methods.
-
-
-// virtual
-uno::Sequence< sal_Int8 > SAL_CALL
-InteractionReplaceExistingData::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-
-// virtual
-uno::Sequence< uno::Type > SAL_CALL InteractionReplaceExistingData::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<ucb::XInteractionReplaceExistingData>::get() );
-
-    return s_aCollection.getTypes();
-}
-
-
 // XInteractionContinuation methods.
 
 
@@ -588,20 +357,6 @@ void SAL_CALL InteractionReplaceExistingData::select()
 
 // InteractionAuthFallback Implementation
 
-// XInterface methods.
-
-// virtual
-uno::Any SAL_CALL
-InteractionAuthFallback::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-            static_cast< task::XInteractionContinuation * >( this ),
-            static_cast< ucb::XInteractionAuthFallback * >( this ));
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
 // XInteractionContinuation methods.
 
 // virtual
diff --git a/ucbhelper/source/provider/simpleinteractionrequest.cxx 
b/ucbhelper/source/provider/simpleinteractionrequest.cxx
index d846be5d352b..ce18d17625b2 100644
--- a/ucbhelper/source/provider/simpleinteractionrequest.cxx
+++ b/ucbhelper/source/provider/simpleinteractionrequest.cxx
@@ -62,25 +62,23 @@ ContinuationFlags SimpleInteractionRequest::getResponse() 
const
     rtl::Reference< InteractionContinuation > xSelection = getSelection();
     if ( xSelection.is() )
     {
-        InteractionContinuation * pSelection = xSelection.get();
-
         uno::Reference< task::XInteractionAbort > xAbort(
-                                        pSelection, uno::UNO_QUERY );
+                                        xSelection->getXWeak(), uno::UNO_QUERY 
);
         if ( xAbort.is() )
             return ContinuationFlags::Abort;
 
         uno::Reference< task::XInteractionRetry > xRetry(
-                                        pSelection, uno::UNO_QUERY );
+                                        xSelection->getXWeak(), uno::UNO_QUERY 
);
         if ( xRetry.is() )
             return ContinuationFlags::Retry;
 
         uno::Reference< task::XInteractionApprove > xApprove(
-                                        pSelection, uno::UNO_QUERY );
+                                        xSelection->getXWeak(), uno::UNO_QUERY 
);
         if ( xApprove.is() )
             return ContinuationFlags::Approve;
 
         uno::Reference< task::XInteractionDisapprove > xDisapprove(
-                                        pSelection, uno::UNO_QUERY );
+                                        xSelection->getXWeak(), uno::UNO_QUERY 
);
         if ( xDisapprove.is() )
             return ContinuationFlags::Disapprove;
 
diff --git a/ucbhelper/source/provider/simplenameclashresolverequest.cxx 
b/ucbhelper/source/provider/simplenameclashresolverequest.cxx
index 652bdcdbb187..a563983d13cb 100644
--- a/ucbhelper/source/provider/simplenameclashresolverequest.cxx
+++ b/ucbhelper/source/provider/simplenameclashresolverequest.cxx
@@ -27,35 +27,21 @@ using namespace com::sun::star;
 
 namespace ucbhelper {
 
+using InteractionSupplyName_BASE = 
cppu::ImplInheritanceHelper<InteractionContinuation,
+                                                               
css::ucb::XInteractionSupplyName>;
 /**
   * This class implements a standard interaction continuation, namely the
   * interface XInteractionSupplyName. Instances of this class can be passed
   * along with an interaction request to indicate the possibility to
   * supply a new name.
   */
-class InteractionSupplyName : public InteractionContinuation,
-                              public css::lang::XTypeProvider,
-                              public css::ucb::XInteractionSupplyName
+class InteractionSupplyName : public InteractionSupplyName_BASE
 {
     OUString m_aName;
 
 public:
     explicit InteractionSupplyName( InteractionRequest * pRequest )
-    : InteractionContinuation( pRequest ) {}
-
-    // XInterface
-    virtual css::uno::Any SAL_CALL
-    queryInterface( const css::uno::Type & rType ) override;
-    virtual void SAL_CALL acquire()
-        noexcept override;
-    virtual void SAL_CALL release()
-        noexcept override;
-
-    // XTypeProvider
-    virtual css::uno::Sequence< css::uno::Type > SAL_CALL
-    getTypes() override;
-    virtual css::uno::Sequence< sal_Int8 > SAL_CALL
-    getImplementationId() override;
+    : InteractionSupplyName_BASE( pRequest ) {}
 
     // XInteractionContinuation
     virtual void SAL_CALL select() override;
@@ -74,44 +60,6 @@ public:
     const OUString & getName() const { return m_aName; }
 };
 
-void SAL_CALL InteractionSupplyName::acquire()
-    noexcept
-{
-    OWeakObject::acquire();
-}
-
-void SAL_CALL InteractionSupplyName::release()
-    noexcept
-{
-    OWeakObject::release();
-}
-
-uno::Any SAL_CALL
-InteractionSupplyName::queryInterface( const uno::Type & rType )
-{
-    uno::Any aRet = cppu::queryInterface( rType,
-                static_cast< lang::XTypeProvider * >( this ),
-                static_cast< task::XInteractionContinuation * >( this ),
-                static_cast< ucb::XInteractionSupplyName * >( this ) );
-
-    return aRet.hasValue()
-            ? aRet : InteractionContinuation::queryInterface( rType );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL InteractionSupplyName::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-uno::Sequence< uno::Type > SAL_CALL InteractionSupplyName::getTypes()
-{
-    static cppu::OTypeCollection s_aCollection(
-                cppu::UnoType<lang::XTypeProvider>::get(),
-                cppu::UnoType<ucb::XInteractionSupplyName>::get() );
-
-    return s_aCollection.getTypes();
-}
-
 void SAL_CALL InteractionSupplyName::select()
 {
     recordSelection();
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx 
b/unotools/source/ucbhelper/ucblockbytes.cxx
index f6cc30e0b49f..e56c058c1b69 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -750,8 +750,7 @@ static bool UCBOpenContentSync(
                     rtl::Reference< ucbhelper::InteractionContinuation > ref
                         = xIR->getSelection();
                     if(ref.is()) {
-                        Reference<XInterface> xInt(ref);
-                        xRet.set(xInt,UNO_QUERY);
+                        xRet.set(ref->getXWeak(), UNO_QUERY);
                     }
                 }
 

Reply via email to