Replace List with std::vector< GraphicObject* >
This commit is contained in:
@@ -548,6 +548,8 @@ public:
|
|||||||
// - GraphicManager -
|
// - GraphicManager -
|
||||||
// ------------------
|
// ------------------
|
||||||
|
|
||||||
|
typedef ::std::vector< GraphicObject* > GraphicObjectList_impl;
|
||||||
|
|
||||||
class SVT_DLLPUBLIC GraphicManager
|
class SVT_DLLPUBLIC GraphicManager
|
||||||
{
|
{
|
||||||
friend class GraphicObject;
|
friend class GraphicObject;
|
||||||
@@ -555,8 +557,8 @@ class SVT_DLLPUBLIC GraphicManager
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
List maObjList;
|
GraphicObjectList_impl maObjList;
|
||||||
GraphicCache* mpCache;
|
GraphicCache* mpCache;
|
||||||
|
|
||||||
GraphicManager( const GraphicManager& ) {}
|
GraphicManager( const GraphicManager& ) {}
|
||||||
GraphicManager& operator=( const GraphicManager& ) { return *this; }
|
GraphicManager& operator=( const GraphicManager& ) { return *this; }
|
||||||
@@ -652,7 +654,7 @@ private:
|
|||||||
const GraphicObject* pCopyObj = NULL
|
const GraphicObject* pCopyObj = NULL
|
||||||
);
|
);
|
||||||
void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj );
|
void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj );
|
||||||
inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return( maObjList.Count() > 0UL ); }
|
inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return !maObjList.empty(); }
|
||||||
|
|
||||||
// Only used in swap case by GraphicObject
|
// Only used in swap case by GraphicObject
|
||||||
void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj );
|
void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj );
|
||||||
|
@@ -122,8 +122,8 @@ GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize
|
|||||||
|
|
||||||
GraphicManager::~GraphicManager()
|
GraphicManager::~GraphicManager()
|
||||||
{
|
{
|
||||||
for( void* pObj = maObjList.First(); pObj; pObj = maObjList.Next() )
|
for( size_t i = 0, n = maObjList.size(); i < n; ++i )
|
||||||
( (GraphicObject*) pObj )->GraphicManagerDestroyed();
|
maObjList[ i ]->GraphicManagerDestroyed();
|
||||||
|
|
||||||
delete mpCache;
|
delete mpCache;
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,7 @@ sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Si
|
|||||||
void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute,
|
void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute,
|
||||||
const ByteString* pID, const GraphicObject* pCopyObj )
|
const ByteString* pID, const GraphicObject* pCopyObj )
|
||||||
{
|
{
|
||||||
maObjList.Insert( (void*) &rObj, LIST_APPEND );
|
maObjList.push_back( (GraphicObject*)&rObj );
|
||||||
mpCache->AddGraphicObject( rObj, rSubstitute, pID, pCopyObj );
|
mpCache->AddGraphicObject( rObj, rSubstitute, pID, pCopyObj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +280,13 @@ void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubst
|
|||||||
void GraphicManager::ImplUnregisterObj( const GraphicObject& rObj )
|
void GraphicManager::ImplUnregisterObj( const GraphicObject& rObj )
|
||||||
{
|
{
|
||||||
mpCache->ReleaseGraphicObject( rObj );
|
mpCache->ReleaseGraphicObject( rObj );
|
||||||
maObjList.Remove( (void*) &rObj );
|
for( GraphicObjectList_impl::iterator it = maObjList.begin(); it < maObjList.end(); ++it )
|
||||||
|
{
|
||||||
|
if ( *it == &rObj ) {
|
||||||
|
maObjList.erase( it );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user