diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-08-06 07:09:55 -0700 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-08-06 07:12:20 -0700 |
commit | 665987630fac51f58439aed4a43ef2d46a11fb2b (patch) | |
tree | c865c02b046c1b7aa6e5d07621e67a10ebcf2c72 /svtools | |
parent | 15d51584a1564a270dc976caf8f2c04bf5a068ea (diff) |
Replace List with std::vector< GraphicFilter* >
Notes
split repo tag: libs-gui_PRE_MELD_REPOS
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/filter/filter.cxx | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx index eb4d4a57ce75..c39e1e478af8 100644 --- a/svtools/source/filter/filter.cxx +++ b/svtools/source/filter/filter.cxx @@ -74,6 +74,7 @@ #include <comphelper/processfactory.hxx> #include <rtl/bootstrap.hxx> #include <rtl/instance.hxx> +#include <vector> #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 ) |