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

Julien Nabet serval2412 at yahoo.fr
Tue Dec 5 06:03:07 UTC 2017


 sw/source/uibase/dbui/maildispatcher.cxx |   28 ++++++++++++++--------------
 sw/source/uibase/inc/maildispatcher.hxx  |    5 +++--
 2 files changed, 17 insertions(+), 16 deletions(-)

New commits:
commit 102f257ee007aecaccbf1370a3c89104d87fe43f
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Dec 4 21:57:42 2017 +0100

    Replace list by vector for MailDispatcherListenerContainer_t (sw)
    
    Change-Id: Iac66ae6cb9f95133ef705850c246309db41872dc
    Reviewed-on: https://gerrit.libreoffice.org/45826
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sw/source/uibase/dbui/maildispatcher.cxx b/sw/source/uibase/dbui/maildispatcher.cxx
index 89678bc34529..ae789beb30c5 100644
--- a/sw/source/uibase/dbui/maildispatcher.cxx
+++ b/sw/source/uibase/dbui/maildispatcher.cxx
@@ -27,7 +27,7 @@
 
 using namespace ::com::sun::star;
 
-typedef std::list< ::rtl::Reference<IMailDispatcherListener> > MailDispatcherListenerContainer_t;
+typedef std::vector< ::rtl::Reference<IMailDispatcherListener> > MailDispatcherListenerContainer_t;
 
 namespace /* private */
 {
@@ -153,8 +153,8 @@ void MailDispatcher::start()
         m_aWakeupCondition.set();
         thread_status_guard.clear();
 
-        MailDispatcherListenerContainer_t aClonedListenerList(cloneListener());
-        std::for_each( aClonedListenerList.begin(), aClonedListenerList.end(),
+        MailDispatcherListenerContainer_t aClonedListenerVector(cloneListener());
+        std::for_each( aClonedListenerVector.begin(), aClonedListenerVector.end(),
                        GenericEventNotifier(&IMailDispatcherListener::started, this) );
     }
 }
@@ -173,8 +173,8 @@ void MailDispatcher::stop()
         m_aWakeupCondition.reset();
         thread_status_guard.clear();
 
-        MailDispatcherListenerContainer_t aClonedListenerList(cloneListener());
-        std::for_each( aClonedListenerList.begin(), aClonedListenerList.end(),
+        MailDispatcherListenerContainer_t aClonedListenerVector(cloneListener());
+        std::for_each( aClonedListenerVector.begin(), aClonedListenerVector.end(),
                        GenericEventNotifier(&IMailDispatcherListener::stopped, this) );
     }
 }
@@ -195,13 +195,13 @@ void MailDispatcher::addListener(::rtl::Reference<IMailDispatcherListener> const
     OSL_PRECOND(!m_bShutdownRequested, "MailDispatcher thread is shuting down already");
 
     ::osl::MutexGuard guard( m_aListenerContainerMutex );
-    m_aListenerList.push_back( listener );
+    m_aListenerVector.push_back( listener );
 }
 
-std::list< ::rtl::Reference<IMailDispatcherListener> > MailDispatcher::cloneListener()
+std::vector< ::rtl::Reference<IMailDispatcherListener> > MailDispatcher::cloneListener()
 {
     ::osl::MutexGuard guard( m_aListenerContainerMutex );
-    return m_aListenerList;
+    return m_aListenerVector;
 }
 
 void MailDispatcher::sendMailMessageNotifyListener(uno::Reference<mail::XMailMessage> const & message)
@@ -209,20 +209,20 @@ void MailDispatcher::sendMailMessageNotifyListener(uno::Reference<mail::XMailMes
     try
     {
         m_xMailserver->sendMailMessage( message );
-        MailDispatcherListenerContainer_t aClonedListenerList(cloneListener());
-        std::for_each( aClonedListenerList.begin(), aClonedListenerList.end(),
+        MailDispatcherListenerContainer_t aClonedListenerVector(cloneListener());
+        std::for_each( aClonedListenerVector.begin(), aClonedListenerVector.end(),
                        MailDeliveryNotifier(this, message) );
     }
     catch (const mail::MailException& ex)
     {
-        MailDispatcherListenerContainer_t aClonedListenerList(cloneListener());
-        std::for_each( aClonedListenerList.begin(), aClonedListenerList.end(),
+        MailDispatcherListenerContainer_t aClonedListenerVector(cloneListener());
+        std::for_each( aClonedListenerVector.begin(), aClonedListenerVector.end(),
                        MailDeliveryErrorNotifier(this, message, ex.Message) );
     }
     catch (const uno::RuntimeException& ex)
     {
-        MailDispatcherListenerContainer_t aClonedListenerList(cloneListener());
-        std::for_each( aClonedListenerList.begin(), aClonedListenerList.end(),
+        MailDispatcherListenerContainer_t aClonedListenerVector(cloneListener());
+        std::for_each( aClonedListenerVector.begin(), aClonedListenerVector.end(),
                        MailDeliveryErrorNotifier(this, message, ex.Message) );
     }
 }
diff --git a/sw/source/uibase/inc/maildispatcher.hxx b/sw/source/uibase/inc/maildispatcher.hxx
index ddcb48e30ce6..af7494b19d87 100644
--- a/sw/source/uibase/inc/maildispatcher.hxx
+++ b/sw/source/uibase/inc/maildispatcher.hxx
@@ -28,6 +28,7 @@
 #include <salhelper/simplereferenceobject.hxx>
 
 #include <list>
+#include <vector>
 
 #include <swdllapi.h>
 
@@ -136,13 +137,13 @@ protected:
     virtual void SAL_CALL onTerminated() override;
 
 private:
-    std::list< ::rtl::Reference<IMailDispatcherListener> > cloneListener();
+    std::vector< ::rtl::Reference<IMailDispatcherListener> > cloneListener();
     void sendMailMessageNotifyListener(css::uno::Reference< css::mail::XMailMessage> const & message);
 
 private:
     css::uno::Reference< css::mail::XSmtpService> m_xMailserver;
     std::list< css::uno::Reference< css::mail::XMailMessage > > m_aXMessageList;
-    std::list< ::rtl::Reference<IMailDispatcherListener> > m_aListenerList;
+    std::vector< ::rtl::Reference<IMailDispatcherListener> > m_aListenerVector;
     ::osl::Mutex m_aMessageContainerMutex;
     ::osl::Mutex m_aListenerContainerMutex;
     ::osl::Mutex m_aThreadStatusMutex;


More information about the Libreoffice-commits mailing list