svx/source/unogallery/unogaltheme.cxx | 10 ++++------ svx/source/unogallery/unogaltheme.hxx | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-)
New commits: commit 3b21902aa85df7631c9efb20dd408df005295b22 Author: Julien Nabet <serval2...@yahoo.fr> Date: Fri Oct 13 22:24:26 2017 +0200 Replace list by vector in unogaltheme (svx) Change-Id: I6172c5aae60efe929554589147e49a2cf036633b Reviewed-on: https://gerrit.libreoffice.org/43379 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Julien Nabet <serval2...@yahoo.fr> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits