[Libreoffice-commits] .: rsc/inc rsc/source

Joseph Powers jpowers at kemper.freedesktop.org
Mon Jan 24 19:38:02 PST 2011


 rsc/inc/rscdb.hxx           |    3 ++-
 rsc/source/parser/rscdb.cxx |   31 ++++++++++++++-----------------
 2 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit ef70418ebf8b32f2d10abce61c0aa2c1011ced14
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Mon Jan 24 19:37:57 2011 -0800

    Remove DECLARE_LIST( RscSysList, RscSysEntry * )

diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 8047cea..af4b40f 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 d4b643b..22f5a30 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;


More information about the Libreoffice-commits mailing list