diff options
author | Joseph Powers <jpowers27@cox.net> | 2010-12-23 22:17:03 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2010-12-23 22:17:41 -0800 |
commit | f14fdf28c79b46a36fcff2024b70112da9549641 (patch) | |
tree | c97628933fe29097555ecde6617380e1850f08e0 /sfx2 | |
parent | 07a259ce3812bc764951e370ff97df1d507234a1 (diff) |
Remove DECLARE_LIST( NameList_Impl, NamePair_Impl* )
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 806e0c36136a..54bf29f0b7e6 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -71,6 +71,8 @@ #include <sfx2/docfile.hxx> #include "doc.hrc" +#include <vector> + //----------------------------------------------------------------------------- //============================================================================= @@ -122,6 +124,8 @@ using namespace ::rtl; using namespace ::ucbhelper; using namespace ::comphelper; +using ::std::vector; + //============================================================================= class WaitWindow_Impl : public WorkWindow @@ -147,7 +151,7 @@ struct NamePair_Impl OUString maLongName; }; -DECLARE_LIST( NameList_Impl, NamePair_Impl* ) +typedef vector< NamePair_Impl* > NameList_Impl; class Updater_Impl; class GroupList_Impl; @@ -556,7 +560,7 @@ void SfxDocTplService_Impl::readFolderList() pPair->maShortName = aShortNames.GetString( i ); pPair->maLongName = aLongNames.GetString( i ); - maNames.Insert( pPair, LIST_APPEND ); + maNames.push_back( pPair ); } } @@ -564,17 +568,15 @@ void SfxDocTplService_Impl::readFolderList() OUString SfxDocTplService_Impl::getLongName( const OUString& rShortName ) { OUString aRet; - NamePair_Impl *pPair = maNames.First(); - while ( pPair ) + for ( size_t i = 0, n = maNames.size(); i < n; ++i ) { + NamePair_Impl* pPair = maNames[ i ]; if ( pPair->maShortName == rShortName ) { aRet = pPair->maLongName; break; } - else - pPair = maNames.Next(); } if ( !aRet.getLength() ) @@ -1155,6 +1157,10 @@ SfxDocTplService_Impl::~SfxDocTplService_Impl() mpUpdater->join(); delete mpUpdater; } + + for ( size_t i = 0, n = maNames.size(); i < n; ++i ) + delete maNames[ i ]; + maNames.clear(); } //----------------------------------------------------------------------------- |