Kaydet (Commit) 526c8f72 authored tarafından Julien Nabet's avatar Julien Nabet

Replace some lists by vectors (vcl)

Change-Id: Ic31f4f5a2f44e39ee965e7c3fc6a2246bbb10076
Reviewed-on: https://gerrit.libreoffice.org/44237Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst b8040316
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "salwtype.hxx" #include "salwtype.hxx"
#include "displayconnectiondispatch.hxx" #include "displayconnectiondispatch.hxx"
#include <list> #include <vector>
#include <unordered_map> #include <unordered_map>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
#include "ControlCacheKey.hxx" #include "ControlCacheKey.hxx"
...@@ -130,7 +130,7 @@ struct ImplSVAppData ...@@ -130,7 +130,7 @@ struct ImplSVAppData
LocaleConfigurationListener* mpCfgListener = nullptr; LocaleConfigurationListener* mpCfgListener = nullptr;
VclEventListeners* mpEventListeners = nullptr; // listeners for vcl events (eg, extended toolkit) VclEventListeners* mpEventListeners = nullptr; // listeners for vcl events (eg, extended toolkit)
SVAppKeyListeners* mpKeyListeners = nullptr; // listeners for key events only (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 ImplAccelManager* mpAccelMgr = nullptr; // Accelerator Manager
OUString* mpAppName = nullptr; // Application name OUString* mpAppName = nullptr; // Application name
OUString* mpAppFileName = nullptr; // Abs. Application FileName OUString* mpAppFileName = nullptr; // Abs. Application FileName
...@@ -362,7 +362,7 @@ struct ImplSVData ...@@ -362,7 +362,7 @@ struct ImplSVData
css::uno::Reference< css::lang::XComponent > mxAccessBridge; css::uno::Reference< css::lang::XComponent > mxAccessBridge;
vcl::SettingsConfigItem* mpSettingsConfigItem = nullptr; vcl::SettingsConfigItem* mpSettingsConfigItem = nullptr;
std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList = nullptr; std::vector< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList = nullptr;
std::unordered_map< int, OUString >* mpPaperNames = nullptr; std::unordered_map< int, OUString >* mpPaperNames = nullptr;
css::uno::Reference<css::i18n::XCharacterClassification> m_xCharClass; css::uno::Reference<css::i18n::XCharacterClassification> m_xCharClass;
......
...@@ -954,7 +954,7 @@ IMPL_STATIC_LINK( Application, PostEventHandler, void*, pCallData, void ) ...@@ -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 // remove this event from list of posted events, watch for destruction of internal data
auto svdata = ImplGetSVData(); 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() ) while( aIter != svdata->maAppData.maPostedEventList.end() )
{ {
...@@ -974,7 +974,7 @@ void Application::RemoveMouseAndKeyEvents( vcl::Window* pWin ) ...@@ -974,7 +974,7 @@ void Application::RemoveMouseAndKeyEvents( vcl::Window* pWin )
// remove all events for specific window, watch for destruction of internal data // remove all events for specific window, watch for destruction of internal data
auto svdata = ImplGetSVData(); 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() ) while( aIter != svdata->maAppData.maPostedEventList.end() )
{ {
......
...@@ -59,7 +59,7 @@ class GenericClipboard : ...@@ -59,7 +59,7 @@ class GenericClipboard :
osl::Mutex m_aMutex; osl::Mutex m_aMutex;
Reference< css::datatransfer::XTransferable > m_aContents; Reference< css::datatransfer::XTransferable > m_aContents;
Reference< css::datatransfer::clipboard::XClipboardOwner > m_aOwner; 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: public:
...@@ -143,7 +143,7 @@ void GenericClipboard::setContents( ...@@ -143,7 +143,7 @@ void GenericClipboard::setContents(
m_aContents = xTrans; m_aContents = xTrans;
m_aOwner = xClipboardOwner; 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; datatransfer::clipboard::ClipboardEvent aEv;
aEv.Contents = m_aContents; aEv.Contents = m_aContents;
...@@ -151,10 +151,9 @@ void GenericClipboard::setContents( ...@@ -151,10 +151,9 @@ void GenericClipboard::setContents(
if( xOldOwner.is() && xOldOwner != xClipboardOwner ) if( xOldOwner.is() && xOldOwner != xClipboardOwner )
xOldOwner->lostOwnership( this, xOldContents ); xOldOwner->lostOwnership( this, xOldContents );
for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it = for (auto const& listener : aListeners)
aListeners.begin(); it != aListeners.end() ; ++it )
{ {
(*it)->changedContents( aEv ); listener->changedContents( aEv );
} }
} }
...@@ -179,7 +178,7 @@ void GenericClipboard::removeClipboardListener( const Reference< datatransfer::c ...@@ -179,7 +178,7 @@ void GenericClipboard::removeClipboardListener( const Reference< datatransfer::c
{ {
osl::ClearableMutexGuard aGuard( m_aMutex ); 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< class ClipboardFactory : public ::cppu::WeakComponentImplHelper<
......
...@@ -63,7 +63,8 @@ DeleteOnDeinitBase::~DeleteOnDeinitBase() ...@@ -63,7 +63,8 @@ DeleteOnDeinitBase::~DeleteOnDeinitBase()
{ {
ImplSVData* pSVData = ImplGetSVData(); ImplSVData* pSVData = ImplGetSVData();
if( pSVData && pSVData->mpDeinitDeleteList != nullptr ) 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 ) void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer )
...@@ -75,7 +76,7 @@ void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer ) ...@@ -75,7 +76,7 @@ void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer )
return; return;
if( pSVData->mpDeinitDeleteList == nullptr ) if( pSVData->mpDeinitDeleteList == nullptr )
pSVData->mpDeinitDeleteList = new std::list< DeleteOnDeinitBase* >; pSVData->mpDeinitDeleteList = new std::vector< DeleteOnDeinitBase* >;
pSVData->mpDeinitDeleteList->push_back( i_pContainer ); pSVData->mpDeinitDeleteList->push_back( i_pContainer );
} }
...@@ -84,10 +85,9 @@ void DeleteOnDeinitBase::ImplDeleteOnDeInit() ...@@ -84,10 +85,9 @@ void DeleteOnDeinitBase::ImplDeleteOnDeInit()
ImplSVData* pSVData = ImplGetSVData(); ImplSVData* pSVData = ImplGetSVData();
if( pSVData->mpDeinitDeleteList ) if( pSVData->mpDeinitDeleteList )
{ {
for( std::list< vcl::DeleteOnDeinitBase* >::iterator it = pSVData->mpDeinitDeleteList->begin(); for (auto const& deinitDelete : *(pSVData->mpDeinitDeleteList))
it != pSVData->mpDeinitDeleteList->end(); ++it )
{ {
(*it)->doCleanup(); deinitDelete->doCleanup();
} }
delete pSVData->mpDeinitDeleteList; delete pSVData->mpDeinitDeleteList;
pSVData->mpDeinitDeleteList = nullptr; pSVData->mpDeinitDeleteList = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment