diff options
author | Joseph Powers <jpowers27@cox.net> | 2010-12-24 06:17:55 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2010-12-24 06:17:55 -0800 |
commit | f827e97db8144d0a6019594385cc47172a029b9c (patch) | |
tree | 3449ed2b3a4d287fd17a1c6398052f1d91dc4563 /sfx2 | |
parent | f14fdf28c79b46a36fcff2024b70112da9549641 (diff) |
Remove DECLARE_LIST( EntryList_Impl, DocTemplates_EntryData_Impl* )
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 54bf29f0b7e6..8aa345e27825 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -362,8 +362,7 @@ public: class GroupData_Impl { - DECLARE_LIST( EntryList_Impl, DocTemplates_EntryData_Impl* ) - EntryList_Impl maEntries; + vector< DocTemplates_EntryData_Impl* > maEntries; OUString maTitle; OUString maHierarchyURL; OUString maTargetURL; @@ -389,8 +388,8 @@ public: const OUString& rTargetURL, const OUString& rType, const OUString& rHierURL ); - ULONG count() { return maEntries.Count(); } - DocTemplates_EntryData_Impl* getEntry( ULONG nPos ) { return maEntries.GetObject( nPos ); } + size_t count() { return maEntries.size(); } + DocTemplates_EntryData_Impl* getEntry( size_t nPos ) { return maEntries[ nPos ]; } }; DECLARE_LIST( GroupList_Impl, GroupData_Impl* ) @@ -2766,12 +2765,9 @@ GroupData_Impl::GroupData_Impl( const OUString& rTitle ) // ----------------------------------------------------------------------- GroupData_Impl::~GroupData_Impl() { - DocTemplates_EntryData_Impl *pData = maEntries.First(); - while ( pData ) - { - delete pData; - pData = maEntries.Next(); - } + for ( size_t i = 0, n = maEntries.size(); i < n; ++i ) + delete maEntries[ i ]; + maEntries.clear(); } // ----------------------------------------------------------------------- @@ -2780,12 +2776,20 @@ DocTemplates_EntryData_Impl* GroupData_Impl::addEntry( const OUString& rTitle, const OUString& rType, const OUString& rHierURL ) { - DocTemplates_EntryData_Impl *pData = maEntries.First(); + DocTemplates_EntryData_Impl* pData = NULL; + bool EntryFound = false; - while ( pData && pData->getTitle() != rTitle ) - pData = maEntries.Next(); + for ( size_t i = 0, n = maEntries.size(); i < n; ++i ) + { + pData = maEntries[ i ]; + if ( pData->getTitle() == rTitle ) + { + EntryFound = true; + break; + } + } - if ( !pData ) + if ( !EntryFound ) { pData = new DocTemplates_EntryData_Impl( rTitle ); pData->setTargetURL( rTargetURL ); @@ -2795,7 +2799,7 @@ DocTemplates_EntryData_Impl* GroupData_Impl::addEntry( const OUString& rTitle, pData->setHierarchyURL( rHierURL ); pData->setHierarchy( sal_True ); } - maEntries.Insert( pData ); + maEntries.push_back( pData ); } else { |