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

Joseph Powers jpowers at kemper.freedesktop.org
Sun May 1 19:01:30 PDT 2011


 sot/inc/sot/object.hxx      |    4 ----
 sot/inc/sot/sotdata.hxx     |    5 +++--
 sot/source/base/factory.cxx |   25 ++++++++++---------------
 3 files changed, 13 insertions(+), 21 deletions(-)

New commits:
commit ad55b99077fbbcabe11b3ac0fdae3c088f717507
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun May 1 19:01:04 2011 -0700

    Remove SV_DECL_REF_LIST(SotObject,SotObject*)

diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx
index eca4bad..74d0cff 100644
--- a/sot/inc/sot/object.hxx
+++ b/sot/inc/sot/object.hxx
@@ -427,10 +427,6 @@ private:
 //==================class SotObjectRef======================================
 SV_IMPL_REF(SotObject)
 
-//==================class SotObject*List====================================
-SV_DECL_REF_LIST(SotObject,SotObject*)
-SV_IMPL_REF_LIST(SotObject,SotObject*)
-
 #endif // _IFACE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx
index b85bf58..a8b54fe 100644
--- a/sot/inc/sot/sotdata.hxx
+++ b/sot/inc/sot/sotdata.hxx
@@ -36,11 +36,12 @@
 #include "sot/sotdllapi.h"
 #include <com/sun/star/datatransfer/DataFlavor.hpp>
 #include <vector>
+#include <list>
 
 //==================class SotData_Impl====================================
 
 class SotFactory;
-class SotObjectList;
+class SotObject;
 
 typedef ::std::vector< SotFactory* > SotFactoryList;
 typedef ::std::vector< com::sun::star::datatransfer::DataFlavor* > tDataFlavorList;
@@ -48,7 +49,7 @@ typedef ::std::vector< com::sun::star::datatransfer::DataFlavor* > tDataFlavorLi
 struct SotData_Impl
 {
     sal_uInt32			nSvObjCount;
-    SotObjectList *		pObjectList;
+    std::list<SotObject*> aObjectList;
     SotFactoryList *	pFactoryList;
     SotFactory *		pSotObjectFactory;
     SotFactory *		pSotStorageStreamFactory;
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index cecd511..01d098e 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -48,7 +48,6 @@
 *************************************************************************/
 SotData_Impl::SotData_Impl()
     : nSvObjCount( 0 )
-    , pObjectList( NULL )
     , pFactoryList( NULL )
     , pSotObjectFactory( NULL )
     , pSotStorageStreamFactory( NULL )
@@ -96,10 +95,11 @@ void SotFactory::DeInit()
         pFactoryList->clear();
         delete pFactoryList;
         pSotData->pFactoryList = NULL;
+
     }
 
-    delete pSotData->pObjectList;
-    pSotData->pObjectList = NULL;
+    pSotData->aObjectList.clear();
+
     if( pSotData->pDataFlavorList )
     {
 
@@ -222,10 +222,9 @@ void SotFactory::IncSvObjectCount( SotObject * pObj )
 {
     SotData_Impl * pSotData = SOTDATA();
     pSotData->nSvObjCount++;
-    if( !pSotData->pObjectList )
-        pSotData->pObjectList = new SotObjectList();
+
     if( pObj )
-        pSotData->pObjectList->Insert( pObj );
+        pSotData->aObjectList.push_back( pObj );
 }
 
 
@@ -239,7 +238,7 @@ void SotFactory::DecSvObjectCount( SotObject * pObj )
     SotData_Impl * pSotData = SOTDATA();
     pSotData->nSvObjCount--;
     if( pObj )
-        pSotData->pObjectList->Remove( pObj );
+        pSotData->aObjectList.remove( pObj );
     if( !pSotData->nSvObjCount )
     {
         //keine internen und externen Referenzen mehr
@@ -256,14 +255,10 @@ void SotFactory::TestInvariant()
 {
 #ifdef TEST_INVARIANT
     SotData_Impl * pSotData = SOTDATA();
-    if( pSotData->pObjectList )
-    {
-        sal_uLong nCount = pSotData->pObjectList->Count();
-        for( sal_uLong i = 0; i < nCount ; i++ )
-        {
-            pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False );
-        }
-    }
+
+    std::list<SotObject*>::iterator it;
+    for( it = pSotData->aObjectList.begin(); it != pSotData->aObjectList.end(); ++it )
+        (*it)->TestInvariant( sal_False );
 #endif
 }
 


More information about the Libreoffice-commits mailing list