summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-12-04 21:57:42 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-12-05 07:01:53 +0100
commit102f257ee007aecaccbf1370a3c89104d87fe43f (patch)
tree630b4e47837575ee65be3a1ac9e1fcf514a04798 /sw/source
parent1c893292849bf699f3c9411461248f67fa35d027 (diff)
Replace list by vector for MailDispatcherListenerContainer_t (sw)
Change-Id: Iac66ae6cb9f95133ef705850c246309db41872dc Reviewed-on: https://gerrit.libreoffice.org/45826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/dbui/maildispatcher.cxx28
-rw-r--r--sw/source/uibase/inc/maildispatcher.hxx5
2 files changed, 17 insertions, 16 deletions
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;