From 7d00dabf077562cad4e1f4b2209c27b13d3d9487 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 6 Aug 2011 07:09:55 -0700 Subject: Replace List with std::vector< GraphicFilter* > --- svtools/source/filter/filter.cxx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx index 4566c9208f..71d3fd9351 100644 --- a/svtools/source/filter/filter.cxx +++ b/svtools/source/filter/filter.cxx @@ -74,6 +74,7 @@ #include #include #include +#include #include "SvFilterOptionsDialog.hxx" @@ -91,7 +92,8 @@ using namespace ::rtl; using namespace ::com::sun::star; -static List* pFilterHdlList = NULL; +typedef ::std::vector< GraphicFilter* > FilterList_impl; +static FilterList_impl* pFilterHdlList = NULL; static ::osl::Mutex& getListMutex() { @@ -1029,8 +1031,18 @@ GraphicFilter::~GraphicFilter() { { ::osl::MutexGuard aGuard( getListMutex() ); - pFilterHdlList->Remove( (void*)this ); - if ( !pFilterHdlList->Count() ) + for( + FilterList_impl::iterator it = pFilterHdlList->begin(); + it < pFilterHdlList->end(); + ++it + ) { + if( *it == this ) + { + pFilterHdlList->erase( it ); + break; + } + } + if( pFilterHdlList->empty() ) { delete pFilterHdlList, pFilterHdlList = NULL; delete pConfig; @@ -1049,13 +1061,13 @@ void GraphicFilter::ImplInit() if ( !pFilterHdlList ) { - pFilterHdlList = new List; + pFilterHdlList = new FilterList_impl; pConfig = new FilterConfigCache( bUseConfig ); } else - pConfig = ((GraphicFilter*)pFilterHdlList->First())->pConfig; + pConfig = pFilterHdlList->front()->pConfig; - pFilterHdlList->Insert( (void*)this ); + pFilterHdlList->push_back( this ); } if( bUseConfig ) -- cgit v1.2.3