diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-01-06 08:03:28 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-01-06 08:03:48 -0800 |
commit | 0e2c42eb800d7a65e65c27ab7b834b592d2caf5b (patch) | |
tree | ba39069d6e1b28ae296a1ccb3aa85e0b9c3001ba /svx/source/form/fmexpl.cxx | |
parent | de26c2c65c21182d23cbf660cf6bd19cd84f7f90 (diff) |
Remove DECLARE_LIST( FmEntryDataBaseList, FmEntryData* )
Diffstat (limited to 'svx/source/form/fmexpl.cxx')
-rw-r--r-- | svx/source/form/fmexpl.cxx | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index a407baddd12b..59c39f21a8b8 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -210,6 +210,43 @@ FmEntryDataList::~FmEntryDataList() DBG_DTOR(FmEntryDataList,NULL); } +//------------------------------------------------------------------------ +FmEntryData* FmEntryDataList::remove( FmEntryData* pItem ) +{ + for ( FmEntryDataBaseList::iterator it = maEntryDataList.begin(); + it < maEntryDataList.end(); + ++it + ) + { + if ( *it == pItem ) + { + maEntryDataList.erase( it ); + break; + } + } + return pItem; +} + +//------------------------------------------------------------------------ +void FmEntryDataList::insert( FmEntryData* pItem, size_t Index ) +{ + if ( Index < maEntryDataList.size() ) + { + FmEntryDataBaseList::iterator it = maEntryDataList.begin(); + ::std::advance( it, Index ); + maEntryDataList.insert( it, pItem ); + } + else + maEntryDataList.push_back( pItem ); +} + +//------------------------------------------------------------------------ +void FmEntryDataList::clear() +{ + for ( size_t i = 0, n = maEntryDataList.size(); i < n; ++i ) + delete maEntryDataList[ i ]; + maEntryDataList.clear(); +} //======================================================================== // class FmEntryData @@ -255,12 +292,12 @@ FmEntryData::FmEntryData( const FmEntryData& rEntryData ) pParent = rEntryData.GetParent(); FmEntryData* pChildData; - sal_uInt32 nEntryCount = rEntryData.GetChildList()->Count(); - for( sal_uInt32 i=0; i<nEntryCount; i++ ) + size_t nEntryCount = rEntryData.GetChildList()->size(); + for( size_t i = 0; i < nEntryCount; i++ ) { - pChildData = rEntryData.GetChildList()->GetObject(i); + pChildData = rEntryData.GetChildList()->at( i ); FmEntryData* pNewChildData = pChildData->Clone(); - pChildList->Insert( pNewChildData, LIST_APPEND ); + pChildList->insert( pNewChildData, size_t(-1) ); } m_xNormalizedIFace = rEntryData.m_xNormalizedIFace; @@ -272,13 +309,7 @@ FmEntryData::FmEntryData( const FmEntryData& rEntryData ) void FmEntryData::Clear() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmEntryData::Clear" ); - for (;;) - { - FmEntryData* pEntryData = GetChildList()->Remove(ULONG(0)); - if (pEntryData == NULL) - break; - delete pEntryData; - } + GetChildList()->clear(); } //------------------------------------------------------------------------ |