summaryrefslogtreecommitdiff
path: root/sot/source/base/factory.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sot/source/base/factory.cxx')
-rw-r--r--sot/source/base/factory.cxx49
1 files changed, 6 insertions, 43 deletions
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();
}
}