summaryrefslogtreecommitdiff
path: root/vcl/source/components
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-02 21:50:30 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-11-03 07:15:41 +0100
commit526c8f7240812f857d54dc23398ee7845b0be36d (patch)
tree86c2b0c28f28a68b4a32706531c86fac4623c17b /vcl/source/components
parentb80403167935550a4dd97f31b79d2bdcb97e4e88 (diff)
Replace some lists by vectors (vcl)
Change-Id: Ic31f4f5a2f44e39ee965e7c3fc6a2246bbb10076 Reviewed-on: https://gerrit.libreoffice.org/44237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl/source/components')
-rw-r--r--vcl/source/components/dtranscomp.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index f0f02a97252b..46ca921d3def 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -59,7 +59,7 @@ class GenericClipboard :
osl::Mutex m_aMutex;
Reference< css::datatransfer::XTransferable > m_aContents;
Reference< css::datatransfer::clipboard::XClipboardOwner > m_aOwner;
- std::list< Reference< css::datatransfer::clipboard::XClipboardListener > > m_aListeners;
+ std::vector< Reference< css::datatransfer::clipboard::XClipboardListener > > m_aListeners;
public:
@@ -143,7 +143,7 @@ void GenericClipboard::setContents(
m_aContents = xTrans;
m_aOwner = xClipboardOwner;
- std::list< Reference< datatransfer::clipboard::XClipboardListener > > aListeners( m_aListeners );
+ std::vector< Reference< datatransfer::clipboard::XClipboardListener > > aListeners( m_aListeners );
datatransfer::clipboard::ClipboardEvent aEv;
aEv.Contents = m_aContents;
@@ -151,10 +151,9 @@ void GenericClipboard::setContents(
if( xOldOwner.is() && xOldOwner != xClipboardOwner )
xOldOwner->lostOwnership( this, xOldContents );
- for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it =
- aListeners.begin(); it != aListeners.end() ; ++it )
+ for (auto const& listener : aListeners)
{
- (*it)->changedContents( aEv );
+ listener->changedContents( aEv );
}
}
@@ -179,7 +178,7 @@ void GenericClipboard::removeClipboardListener( const Reference< datatransfer::c
{
osl::ClearableMutexGuard aGuard( m_aMutex );
- m_aListeners.remove( listener );
+ m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), listener), m_aListeners.end());
}
class ClipboardFactory : public ::cppu::WeakComponentImplHelper<