summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2011-01-26 07:39:31 -0800
committerJoseph Powers <jpowers27@cox.net>2011-01-26 07:39:31 -0800
commitfaa253ee441f9be75e27980595a4b567e52cb9e0 (patch)
treeac11a8402252050810d35675858888145415148c /sot
parent0f44da55121dde853e8e2efb3ac4c80f568909c7 (diff)
Remove DECLARE_LIST( SotFactoryList, SotFactory* )
Diffstat (limited to 'sot')
-rw-r--r--sot/inc/sot/factory.hxx3
-rw-r--r--sot/inc/sot/sotdata.hxx4
-rw-r--r--sot/source/base/factory.cxx49
3 files changed, 11 insertions, 45 deletions
diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx
index e2b32c6aa65c..d27251987428 100644
--- a/sot/inc/sot/factory.hxx
+++ b/sot/inc/sot/factory.hxx
@@ -32,13 +32,14 @@
#include <tools/globname.hxx>
#include <tools/rtti.hxx>
#include "sot/sotdllapi.h"
+#include <vector>
/*************************************************************************
*************************************************************************/
class SotObject;
class SotFactory;
-DECLARE_LIST( SotFactoryList, SotFactory * )
+typedef ::std::vector< SotFactory* > SotFactoryList;
typedef void * (*CreateInstanceType)( SotObject ** );
//==================class SotFactory=======================================
diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx
index 7bf2e0eec1e3..73c1b1010cb2 100644
--- a/sot/inc/sot/sotdata.hxx
+++ b/sot/inc/sot/sotdata.hxx
@@ -34,14 +34,16 @@
#include <tools/solar.h>
#include "sot/sotdllapi.h"
+#include <vector>
//==================class SotData_Impl====================================
class List;
class SotFactory;
-class SotFactoryList;
class SotObjectList;
+typedef ::std::vector< SotFactory* > SotFactoryList;
+
struct SotData_Impl
{
UINT32 nSvObjCount;
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index f80c55b6e4bb..d327bf077096 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -83,29 +83,6 @@ void SotFactory::DeInit()
ByteString aStr( "Objects alive: " );
aStr.Append( ByteString::CreateFromInt32( pSotData->nSvObjCount ) );
DBG_WARNING( aStr.GetBuffer() );
-
-/*
- SotObjectList *pObjList = pSotData->pObjectList;
-
- if( pObjList )
- {
- SotObject * p = pObjList->First();
- while( p )
- {
- String aStr( "Factory: " );
- aStr += p->GetSvFactory()->GetClassName();
- aStr += " Count: ";
- aStr += p->GetRefCount();
- DBG_TRACE( "\tReferences:" );
- p->TestObjRef( FALSE );
-#ifdef TEST_INVARIANT
- DBG_TRACE( "\tInvariant:" );
- p->TestInvariant( TRUE );
-#endif
- p = pObjList->Next();
- }
- }
-*/
#endif
return;
}
@@ -115,12 +92,9 @@ void SotFactory::DeInit()
SotFactoryList* pFactoryList = pSotData->pFactoryList;
if( pFactoryList )
{
- SotFactory * pFact = pFactoryList->Last();
- while( NULL != (pFact = pFactoryList->Remove()) )
- {
- delete pFact;
- pFact = pFactoryList->Last();
- }
+ for ( size_t i = pFactoryList->size(); i > 0 ; )
+ delete (*pFactoryList)[ --i ];
+ pFactoryList->clear();
delete pFactoryList;
pSotData->pFactoryList = NULL;
}
@@ -135,8 +109,6 @@ void SotFactory::DeInit()
delete pSotData->pDataFlavorList;
pSotData->pDataFlavorList = NULL;
}
- //delete pSOTDATA();
- //SOTDATA() = NULL;
}
@@ -164,13 +136,6 @@ SotFactory::SotFactory( const SvGlobalName & rName,
DBG_ASSERT( aEmptyName != *this, "create factory without SvGlobalName" );
if( Find( *this ) )
{
- /*
- String aStr( GetClassName() );
- aStr += ", UniqueName: ";
- aStr += GetHexName();
- aStr += ", create factories with the same unique name";
- DBG_ERROR( aStr );
- */
DBG_ERROR( "create factories with the same unique name" );
}
}
@@ -179,7 +144,7 @@ SotFactory::SotFactory( const SvGlobalName & rName,
if( !pSotData->pFactoryList )
pSotData->pFactoryList = new SotFactoryList();
// muss nach hinten, wegen Reihenfolge beim zerstoeren
- pSotData->pFactoryList->Insert( this, LIST_APPEND );
+ pSotData->pFactoryList->push_back( this );
}
@@ -217,12 +182,10 @@ const SotFactory* SotFactory::Find( const SvGlobalName & rFactName )
SotData_Impl * pSotData = SOTDATA();
if( rFactName != aEmpty && pSotData->pFactoryList )
{
- SotFactory * pFact = pSotData->pFactoryList->First();
- while( pFact )
- {
+ for ( size_t i = 0, n = pSotData->pFactoryList->size(); i < n; ++i ) {
+ SotFactory* pFact = (*pSotData->pFactoryList)[ i ];
if( *pFact == rFactName )
return pFact;
- pFact = pSotData->pFactoryList->Next();
}
}