[Libreoffice-commits] core.git: compilerplugins/clang sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 18 05:26:01 UTC 2019


 compilerplugins/clang/virtualdead.unusedparams.results |    6 --
 sw/source/ui/dbui/mmoutputtypepage.cxx                 |    8 +--
 sw/source/uibase/dbui/dbmgr.cxx                        |    5 --
 sw/source/uibase/dbui/maildispatcher.cxx               |   36 ++---------------
 sw/source/uibase/inc/imaildsplistener.hxx              |    4 -
 5 files changed, 12 insertions(+), 47 deletions(-)

New commits:
commit 6fe42f2050948f1d12bfb804e4c8fe1b82a6aa1d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Oct 17 13:09:47 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Oct 18 07:25:00 2019 +0200

    loplugin:virtualdead unused params in IMailDispatcherListener
    
    Change-Id: I0cc6a813db88efc98673400447d98e50c32bc720
    Reviewed-on: https://gerrit.libreoffice.org/80962
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/virtualdead.unusedparams.results b/compilerplugins/clang/virtualdead.unusedparams.results
index 041439172418..6f7c786361d9 100644
--- a/compilerplugins/clang/virtualdead.unusedparams.results
+++ b/compilerplugins/clang/virtualdead.unusedparams.results
@@ -346,12 +346,6 @@ sw/source/filter/xml/xmlexpit.hxx:84
 sw/source/filter/xml/xmlimpit.hxx:48
     _Bool SvXMLImportItemMapper::handleSpecialItem(const struct SvXMLItemMapEntry &,class SfxPoolItem &,class SfxItemSet &,const class rtl::OUString &,const class SvXMLUnitConverter &,const class SvXMLNamespaceMap &,)
     111110
-sw/source/uibase/inc/imaildsplistener.hxx:44
-    void IMailDispatcherListener::idle(class rtl::Reference<class MailDispatcher>,)
-    0
-sw/source/uibase/inc/imaildsplistener.hxx:50
-    void IMailDispatcherListener::mailDelivered(class rtl::Reference<class MailDispatcher>,class com::sun::star::uno::Reference<class com::sun::star::mail::XMailMessage>,)
-    01
 vcl/inc/outdev.h:122
     _Bool ImplGlyphFallbackFontSubstitution::FindFontSubstitute(class FontSelectPattern &,class LogicalFontInstance *,class rtl::OUString &,)const
     101
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index cdf6fa59b065..e5d0b2e8528d 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -121,9 +121,8 @@ class SwMailDispatcherListener_Impl : public IMailDispatcherListener
 public:
     explicit SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg);
 
-    virtual void idle(::rtl::Reference<MailDispatcher> xMailDispatcher) override;
-    virtual void mailDelivered(::rtl::Reference<MailDispatcher> xMailDispatcher,
-                uno::Reference< mail::XMailMessage> xMailMessage) override;
+    virtual void idle() override;
+    virtual void mailDelivered(uno::Reference< mail::XMailMessage> xMailMessage) override;
     virtual void mailDeliveryError(::rtl::Reference<MailDispatcher> xMailDispatcher,
                 uno::Reference< mail::XMailMessage> xMailMessage, const OUString& sErrorMessage) override;
 
@@ -135,14 +134,13 @@ SwMailDispatcherListener_Impl::SwMailDispatcherListener_Impl(SwSendMailDialog& r
 {
 }
 
-void SwMailDispatcherListener_Impl::idle(::rtl::Reference<MailDispatcher> /*xMailDispatcher*/)
+void SwMailDispatcherListener_Impl::idle()
 {
     SolarMutexGuard aGuard;
     m_rSendMailDialog.AllMailsSent();
 }
 
 void SwMailDispatcherListener_Impl::mailDelivered(
-                        ::rtl::Reference<MailDispatcher> /*xMailDispatcher*/,
                         uno::Reference< mail::XMailMessage> xMailMessage)
 {
     SolarMutexGuard aGuard;
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 4eeb3a32a3a9..c127143bf848 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1078,10 +1078,9 @@ public:
     explicit MailDispatcherListener_Impl( SwDBManager &rDBManager )
         : m_rDBManager( rDBManager ) {}
 
-    virtual void idle( ::rtl::Reference<MailDispatcher> ) override {}
+    virtual void idle() override {}
 
-    virtual void mailDelivered( ::rtl::Reference<MailDispatcher>,
-                 uno::Reference< mail::XMailMessage> xMessage ) override
+    virtual void mailDelivered( uno::Reference< mail::XMailMessage> xMessage ) override
     {
         osl::MutexGuard aGuard( m_rDBManager.m_pImpl->m_aAllEmailSendMutex );
         if ( m_rDBManager.m_pImpl->m_xLastMessage == xMessage )
diff --git a/sw/source/uibase/dbui/maildispatcher.cxx b/sw/source/uibase/dbui/maildispatcher.cxx
index e55e61bfb8ae..185d0d74eb55 100644
--- a/sw/source/uibase/dbui/maildispatcher.cxx
+++ b/sw/source/uibase/dbui/maildispatcher.cxx
@@ -31,43 +31,17 @@ typedef std::vector< ::rtl::Reference<IMailDispatcherListener> > MailDispatcherL
 
 namespace /* private */
 {
-    /* Generic event notifier for started,
-       stopped, and idle events which are
-       very similarly */
-    class GenericEventNotifier
-    {
-    public:
-        // pointer to virtual function typedef
-        typedef void (IMailDispatcherListener::*GenericNotificationFunc_t)(::rtl::Reference<MailDispatcher>);
-
-        GenericEventNotifier(
-            GenericNotificationFunc_t notification_function,
-            ::rtl::Reference<MailDispatcher> const & mail_dispatcher) :
-            notification_function_(notification_function),
-            mail_dispatcher_(mail_dispatcher)
-        {}
-
-        void operator() (::rtl::Reference<IMailDispatcherListener> const & listener) const
-        { (listener.get()->*notification_function_)(mail_dispatcher_); }
-
-    private:
-        GenericNotificationFunc_t notification_function_;
-        ::rtl::Reference<MailDispatcher> mail_dispatcher_;
-    };
-
     class MailDeliveryNotifier
     {
     public:
-        MailDeliveryNotifier(::rtl::Reference<MailDispatcher> const & xMailDispatcher, uno::Reference<mail::XMailMessage> const & message) :
-            mail_dispatcher_(xMailDispatcher),
+        MailDeliveryNotifier(uno::Reference<mail::XMailMessage> const & message) :
             message_(message)
         {}
 
         void operator() (::rtl::Reference<IMailDispatcherListener> const & listener) const
-        { listener->mailDelivered(mail_dispatcher_, message_); }
+        { listener->mailDelivered(message_); }
 
     private:
-        ::rtl::Reference<MailDispatcher> mail_dispatcher_;
         uno::Reference<mail::XMailMessage> message_;
     };
 
@@ -203,7 +177,7 @@ void MailDispatcher::sendMailMessageNotifyListener(uno::Reference<mail::XMailMes
         m_xMailserver->sendMailMessage( message );
         MailDispatcherListenerContainer_t aClonedListenerVector(cloneListener());
         std::for_each( aClonedListenerVector.begin(), aClonedListenerVector.end(),
-                       MailDeliveryNotifier(this, message) );
+                       MailDeliveryNotifier(message) );
     }
     catch (const mail::MailException& ex)
     {
@@ -258,8 +232,8 @@ void MailDispatcher::run()
             message_container_guard.clear();
             thread_status_guard.clear();
             MailDispatcherListenerContainer_t aListenerListcloned( cloneListener() );
-            std::for_each( aListenerListcloned.begin(), aListenerListcloned.end(),
-                           GenericEventNotifier(&IMailDispatcherListener::idle, this) );
+            for( const auto & l : aListenerListcloned)
+                l->idle();
         }
     }
 }
diff --git a/sw/source/uibase/inc/imaildsplistener.hxx b/sw/source/uibase/inc/imaildsplistener.hxx
index d995662fe758..8852a8800999 100644
--- a/sw/source/uibase/inc/imaildsplistener.hxx
+++ b/sw/source/uibase/inc/imaildsplistener.hxx
@@ -41,13 +41,13 @@ public:
         Called when there are no more mail messages
         to deliver.
     */
-    virtual void idle(::rtl::Reference<MailDispatcher> xMailDispatcher) = 0;
+    virtual void idle() = 0;
 
     /**
         Called for every mail message that has been
         successfully delivered.
     */
-    virtual void mailDelivered(::rtl::Reference<MailDispatcher> xMailDispatcher, css::uno::Reference< css::mail::XMailMessage> xMailMessage) = 0;
+    virtual void mailDelivered(css::uno::Reference< css::mail::XMailMessage> xMailMessage) = 0;
 
     /**
         Called for every mail message whose delivery


More information about the Libreoffice-commits mailing list