diff options
-rw-r--r-- | rsc/inc/rscdb.hxx | 3 | ||||
-rw-r--r-- | rsc/source/parser/rscdb.cxx | 31 |
2 files changed, 16 insertions, 18 deletions
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index de2b026d4f35..8f939e33f3e1 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -68,7 +68,8 @@ struct RscSysEntry sal_uInt32 nTyp; sal_uInt32 nRefId; }; -DECLARE_LIST( RscSysList, RscSysEntry * ) + +typedef ::std::vector< RscSysEntry* > RscSysList; class RscTypCont { diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx index bb31fefdf446..03e8874eadad 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -224,8 +224,6 @@ void Pre_dtorTree( RscTop * pRscTop ){ } RscTypCont :: ~RscTypCont(){ - RscSysEntry * pSysEntry; - // Alle Unterbaeume loeschen aVersion.pClass->Destroy( aVersion ); rtl_freeMemory( aVersion.pData ); @@ -256,17 +254,16 @@ RscTypCont :: ~RscTypCont(){ delete aBaseLst[ i ]; aBaseLst.clear(); - while( NULL != (pSysEntry = aSysLst.Remove()) ){ - delete pSysEntry; - }; + for ( size_t i = 0, n = aSysLst.size(); i < n; ++i ) + delete aSysLst[ i ]; + aSysLst.clear(); } void RscTypCont::ClearSysNames() { - RscSysEntry * pSysEntry; - while( NULL != (pSysEntry = aSysLst.Remove()) ){ - delete pSysEntry; - }; + for ( size_t i = 0, n = aSysLst.size(); i < n; ++i ) + delete aSysLst[ i ]; + aSysLst.clear(); } //======================================================================= @@ -375,17 +372,17 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName, RscSysEntry * pSysEntry; BOOL bId1 = FALSE; - pSysEntry = aSysLst.First(); - while( pSysEntry ) + for ( size_t i = 0, n = aSysLst.size(); i < n; ++i ) { + pSysEntry = aSysLst[ i ]; if( pSysEntry->nKey == 1 ) bId1 = TRUE; if( !strcmp( pSysEntry->aFileName.GetBuffer(), pFileName ) ) - if( pSysEntry->nRscTyp == nRscTyp - && pSysEntry->nTyp == nConst - && pSysEntry->nRefId == nId ) + if( pSysEntry->nRscTyp == nRscTyp + && pSysEntry->nTyp == nConst + && pSysEntry->nRefId == nId + ) break; - pSysEntry = aSysLst.Next(); } if ( !pSysEntry || (bFirst && !bId1) ) @@ -399,10 +396,10 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName, if( bFirst && !bId1 ) { pSysEntry->nKey = 1; - aSysLst.Insert( pSysEntry, (ULONG)0 ); + aSysLst.insert( aSysLst.begin(), pSysEntry ); } else - aSysLst.Insert( pSysEntry, LIST_APPEND ); + aSysLst.push_back( pSysEntry ); } return pSysEntry->nKey; |