diff options
-rw-r--r-- | vcl/inc/svdata.hxx | 6 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 4 | ||||
-rw-r--r-- | vcl/source/components/dtranscomp.cxx | 11 | ||||
-rw-r--r-- | vcl/source/helper/lazydelete.cxx | 10 |
4 files changed, 15 insertions, 16 deletions
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index ad09439f60e1..cf5433483c7a 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -35,7 +35,7 @@ #include "salwtype.hxx" #include "displayconnectiondispatch.hxx" -#include <list> +#include <vector> #include <unordered_map> #include <boost/functional/hash.hpp> #include "ControlCacheKey.hxx" @@ -130,7 +130,7 @@ struct ImplSVAppData LocaleConfigurationListener* mpCfgListener = nullptr; VclEventListeners* mpEventListeners = nullptr; // listeners for vcl events (eg, extended toolkit) SVAppKeyListeners* mpKeyListeners = nullptr; // listeners for key events only (eg, extended toolkit) - std::list<ImplPostEventPair> maPostedEventList; + std::vector<ImplPostEventPair> maPostedEventList; ImplAccelManager* mpAccelMgr = nullptr; // Accelerator Manager OUString* mpAppName = nullptr; // Application name OUString* mpAppFileName = nullptr; // Abs. Application FileName @@ -362,7 +362,7 @@ struct ImplSVData css::uno::Reference< css::lang::XComponent > mxAccessBridge; vcl::SettingsConfigItem* mpSettingsConfigItem = nullptr; - std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList = nullptr; + std::vector< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList = nullptr; std::unordered_map< int, OUString >* mpPaperNames = nullptr; css::uno::Reference<css::i18n::XCharacterClassification> m_xCharClass; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index ab5a82dee4dd..ad5beddb1c83 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -954,7 +954,7 @@ IMPL_STATIC_LINK( Application, PostEventHandler, void*, pCallData, void ) // remove this event from list of posted events, watch for destruction of internal data auto svdata = ImplGetSVData(); - ::std::list< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() ); + ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() ); while( aIter != svdata->maAppData.maPostedEventList.end() ) { @@ -974,7 +974,7 @@ void Application::RemoveMouseAndKeyEvents( vcl::Window* pWin ) // remove all events for specific window, watch for destruction of internal data auto svdata = ImplGetSVData(); - ::std::list< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() ); + ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() ); while( aIter != svdata->maAppData.maPostedEventList.end() ) { 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< diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx index a458987325fe..3fa7be908c92 100644 --- a/vcl/source/helper/lazydelete.cxx +++ b/vcl/source/helper/lazydelete.cxx @@ -63,7 +63,8 @@ DeleteOnDeinitBase::~DeleteOnDeinitBase() { ImplSVData* pSVData = ImplGetSVData(); if( pSVData && pSVData->mpDeinitDeleteList != nullptr ) - pSVData->mpDeinitDeleteList->remove( this ); + pSVData->mpDeinitDeleteList->erase(std::remove(pSVData->mpDeinitDeleteList->begin(), pSVData->mpDeinitDeleteList->end(), this), + pSVData->mpDeinitDeleteList->end()); } void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer ) @@ -75,7 +76,7 @@ void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer ) return; if( pSVData->mpDeinitDeleteList == nullptr ) - pSVData->mpDeinitDeleteList = new std::list< DeleteOnDeinitBase* >; + pSVData->mpDeinitDeleteList = new std::vector< DeleteOnDeinitBase* >; pSVData->mpDeinitDeleteList->push_back( i_pContainer ); } @@ -84,10 +85,9 @@ void DeleteOnDeinitBase::ImplDeleteOnDeInit() ImplSVData* pSVData = ImplGetSVData(); if( pSVData->mpDeinitDeleteList ) { - for( std::list< vcl::DeleteOnDeinitBase* >::iterator it = pSVData->mpDeinitDeleteList->begin(); - it != pSVData->mpDeinitDeleteList->end(); ++it ) + for (auto const& deinitDelete : *(pSVData->mpDeinitDeleteList)) { - (*it)->doCleanup(); + deinitDelete->doCleanup(); } delete pSVData->mpDeinitDeleteList; pSVData->mpDeinitDeleteList = nullptr; |