diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-10-13 22:24:26 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-10-14 00:10:21 +0200 |
commit | 3b21902aa85df7631c9efb20dd408df005295b22 (patch) | |
tree | 827c9d39b894d31af63f4e03813abab962fc78df /svx/source/unogallery | |
parent | abc401787179b097dcbc1006fa454980537bfc0b (diff) |
Replace list by vector in unogaltheme (svx)
Change-Id: I6172c5aae60efe929554589147e49a2cf036633b
Reviewed-on: https://gerrit.libreoffice.org/43379
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svx/source/unogallery')
-rw-r--r-- | svx/source/unogallery/unogaltheme.cxx | 10 | ||||
-rw-r--r-- | svx/source/unogallery/unogaltheme.hxx | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx index f1d53c8f2aa7..43b31ddfa98a 100644 --- a/svx/source/unogallery/unogaltheme.cxx +++ b/svx/source/unogallery/unogaltheme.cxx @@ -333,12 +333,12 @@ void GalleryTheme::implReleaseItems( GalleryObject const * pObj ) { const SolarMutexGuard aGuard; - for( GalleryItemList::iterator aIter = maItemList.begin(); aIter != maItemList.end(); ) + for( GalleryItemVector::iterator aIter = maItemVector.begin(); aIter != maItemVector.end(); ) { if( !pObj || ( (*aIter)->implGetObject() == pObj ) ) { (*aIter)->implSetInvalid(); - aIter = maItemList.erase( aIter ); + aIter = maItemVector.erase( aIter ); } else ++aIter; @@ -350,8 +350,7 @@ void GalleryTheme::implRegisterGalleryItem( ::unogallery::GalleryItem& rItem ) { const SolarMutexGuard aGuard; -// DBG_ASSERT( maItemList.find( &rItem ) == maItemList.end(), "Item already registered" ); - maItemList.push_back( &rItem ); + maItemVector.push_back( &rItem ); } @@ -359,8 +358,7 @@ void GalleryTheme::implDeregisterGalleryItem( ::unogallery::GalleryItem& rItem ) { const SolarMutexGuard aGuard; -// DBG_ASSERT( maItemList.find( &rItem ) != maItemList.end(), "Item is not registered" ); - maItemList.remove( &rItem ); + maItemVector.erase(std::remove(maItemVector.begin(), maItemVector.end(), &rItem), maItemVector.end()); } } diff --git a/svx/source/unogallery/unogaltheme.hxx b/svx/source/unogallery/unogaltheme.hxx index 1b334411e99f..7eb3b2ccf13d 100644 --- a/svx/source/unogallery/unogaltheme.hxx +++ b/svx/source/unogallery/unogaltheme.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_SVX_SOURCE_UNOGALLERY_UNOGALTHEME_HXX #define INCLUDED_SVX_SOURCE_UNOGALLERY_UNOGALTHEME_HXX -#include <list> +#include <vector> #include <cppuhelper/implbase.hxx> #include <svl/lstner.hxx> @@ -79,9 +79,9 @@ protected: private: - typedef ::std::list< ::unogallery::GalleryItem* > GalleryItemList; + typedef ::std::vector< ::unogallery::GalleryItem* > GalleryItemVector; - GalleryItemList maItemList; + GalleryItemVector maItemVector; ::Gallery* mpGallery; ::GalleryTheme* mpTheme; |