summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-08-24 19:55:18 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-08-24 19:55:18 +0100
commit254aa1cc7f897a7df6bfc7d49da5be83dab0144d (patch)
treed61fec9b2294a8611b805b20bd571b0ce47068e4
parentf853fc635313eb1a5263c47bc40b49ad94a9fbaa (diff)
remove unused ReleaseFromCache and cleanup pCopyObj.
Change-Id: Idee91df4e7da3a08de4e59e0b4e5166e644aced1
-rw-r--r--include/svtools/grfmgr.hxx15
-rw-r--r--svtools/source/graphic/grfcache.cxx34
-rw-r--r--svtools/source/graphic/grfcache.hxx3
-rw-r--r--svtools/source/graphic/grfmgr.cxx32
-rw-r--r--svtools/source/graphic/grfmgr2.cxx17
5 files changed, 25 insertions, 76 deletions
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 14ad6b563636..6e62066237ce 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -235,11 +235,7 @@ private:
void SVT_DLLPRIVATE ImplConstruct();
void SVT_DLLPRIVATE ImplAssignGraphicData();
- void SVT_DLLPRIVATE ImplSetGraphicManager(
- const OString* pID = NULL,
- const rtl::Reference< GraphicObject > &xCopyObj =
- rtl::Reference< GraphicObject > ()
- );
+ void SVT_DLLPRIVATE ImplSetup( const OString* pID = NULL );
void SVT_DLLPRIVATE ImplAutoSwapIn();
sal_Bool SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; }
sal_Bool SVT_DLLPRIVATE ImplGetCropParams(
@@ -381,7 +377,6 @@ public:
const GraphicAttr* pAttr = NULL,
sal_uLong nFlags = GRFMGR_DRAW_STANDARD
) const;
- void ReleaseFromCache();
const Graphic& GetGraphic() const;
@@ -617,13 +612,11 @@ private:
const GraphicAttr& rAttr
);
- // Only used by GraphicObject's Ctor's and Dtor's
+ // Only used by GraphicObject's Ctor's and Dtor's
void SVT_DLLPRIVATE ImplRegisterObj(
const rtl::Reference< GraphicObject >& xObj,
Graphic& rSubstitute,
- const OString* pID = NULL,
- const rtl::Reference< GraphicObject > &xCopyObj =
- rtl::Reference< GraphicObject > ()
+ const OString* pID = NULL
);
void SVT_DLLPRIVATE ImplUnregisterObj( const rtl::Reference< GraphicObject >& xObj );
inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return !maObjList.empty(); }
@@ -653,8 +646,6 @@ public:
void SetCacheTimeout( sal_uLong nTimeoutSeconds );
- void ReleaseFromCache( const rtl::Reference< GraphicObject >& xObj );
-
sal_Bool IsInCache(
OutputDevice* pOut,
const Point& rPt,
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index eda0e3a074c2..28f21205982f 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -842,44 +842,16 @@ GraphicCache::~GraphicCache()
void GraphicCache::AddGraphicObject(
const rtl::Reference< GraphicObject >& xObj,
Graphic& rSubstitute,
- const OString* pID,
- const rtl::Reference< GraphicObject >* pCopyObj
+ const OString* pID
)
{
-#error mis-handling of pCopyObj
-
sal_Bool bInserted = sal_False;
if( !xObj->IsSwappedOut()
- && ( pID
- || ( pCopyObj
- && ( pCopyObj->GetType() != GRAPHIC_NONE )
- )
- || ( xObj->GetType() != GRAPHIC_NONE )
+ && ( pID || ( xObj->GetType() != GRAPHIC_NONE )
)
)
{
- if( pCopyObj
- && !maGraphicCache.empty()
- )
- {
- GraphicCacheEntryList::iterator it = maGraphicCache.begin();
- while( !bInserted
- && ( it != maGraphicCache.end() )
- )
- {
- if( (*it)->HasGraphicObjectReference( *pCopyObj ) )
- {
- (*it)->AddGraphicObjectReference( xObj, rSubstitute );
- bInserted = sal_True;
- }
- else
- {
- ++it;
- }
- }
- }
-
if( !bInserted )
{
GraphicCacheEntryList::iterator it = maGraphicCache.begin();
@@ -1015,7 +987,7 @@ void GraphicCache::GraphicObjectWasSwappedIn( const rtl::Reference< GraphicObjec
if( pEntry->GetID().IsEmpty() )
{
ReleaseGraphicObject( xObj );
- AddGraphicObject( xObj, (Graphic&) xObj->GetGraphic(), NULL, NULL );
+ AddGraphicObject( xObj, (Graphic&) xObj->GetGraphic(), NULL );
}
else
pEntry->GraphicObjectWasSwappedIn( xObj );
diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx
index 18666288795c..60d05486f902 100644
--- a/svtools/source/graphic/grfcache.hxx
+++ b/svtools/source/graphic/grfcache.hxx
@@ -68,8 +68,7 @@ public:
void AddGraphicObject(
const rtl::Reference< GraphicObject >& rObj,
Graphic& rSubstitute,
- const OString* pID,
- const rtl::Reference< GraphicObject >* pCopyObj
+ const OString* pID
);
void ReleaseGraphicObject( const rtl::Reference< GraphicObject >& rObj );
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 8a67cce38940..842e7f54f60a 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -61,26 +61,26 @@ struct GrfSimpleCacheObj
TYPEINIT1_AUTOFACTORY( GraphicObject, SvDataCopyStream );
-GraphicObject::GraphicObject()
+GraphicObject::GraphicObject() :
mpLink ( NULL ),
mpUserData ( NULL )
{
ImplConstruct();
ImplAssignGraphicData();
- ImplSetGraphicManager();
+ ImplSetup();
}
-GraphicObject::GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr ) :
+GraphicObject::GraphicObject( const Graphic& rGraphic )
maGraphic ( rGraphic ),
mpLink ( NULL ),
mpUserData ( NULL )
{
ImplConstruct();
ImplAssignGraphicData();
- ImplSetGraphicManager();
+ ImplSetup();
}
-GraphicObject::GraphicObject( const GraphicObject& rGraphicObj, const GraphicManager* pMgr ) :
+GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
SvDataCopyStream(),
maGraphic ( rGraphicObj.GetGraphic() ),
maAttr ( rGraphicObj.maAttr ),
@@ -89,10 +89,10 @@ GraphicObject::GraphicObject( const GraphicObject& rGraphicObj, const GraphicMan
{
ImplConstruct();
ImplAssignGraphicData();
- ImplSetGraphicManager(NULL, &rGraphicObj );
+ ImplSetup();
}
-GraphicObject::GraphicObject( const OString& rUniqueID, const GraphicManager* pMgr ) :
+GraphicObject::GraphicObject( const OString& rUniqueID ) :
mpLink ( NULL ),
mpUserData ( NULL )
{
@@ -101,7 +101,7 @@ GraphicObject::GraphicObject( const OString& rUniqueID, const GraphicManager* pM
// assign default properties
ImplAssignGraphicData();
- ImplSetGraphicManager(&rUniqueID);
+ ImplSetup(&rUniqueID);
// update properties
ImplAssignGraphicData();
@@ -123,10 +123,10 @@ GraphicObject::GraphicObject( css::uno::Sequence< css::uno::Any > const & args,
throw css::lang::IllegalArgumentException();
OString bsId ( OUStringToOString ( sId, RTL_TEXTENCODING_UTF8 ) );
- ImplSetGraphicManager( NULL, &bsId );
+ ImplSetup( &bsId );
}
else
- ImplSetGraphicManager( NULL );
+ ImplSetup();
}
css::uno::Reference< css::graphic::XGraphic > SAL_CALL GraphicObject::getGraphic()
@@ -197,7 +197,7 @@ void GraphicObject::ImplAssignGraphicData()
mnAnimationLoopCount = ( mbAnimated ? maGraphic.GetAnimationLoopCount() : 0 );
}
-void GraphicObject::ImplSetGraphicManager( const OString* pID, const rtl::Reference< GraphicObject > &xCopyObj )
+void GraphicObject::ImplSetup( const OString* pID )
{
GraphicManager *pGlobalMgr;
@@ -217,7 +217,7 @@ void GraphicObject::ImplSetGraphicManager( const OString* pID, const rtl::Refere
// FIXME: remove this member in favour of the global eventually
mpMgr = pGlobalMgr;
- mpMgr->ImplRegisterObj( *this, maGraphic, pID, xCopyObj );
+ mpMgr->ImplRegisterObj( *this, maGraphic, pID );
}
void GraphicObject::ImplAutoSwapIn()
@@ -479,7 +479,7 @@ void GraphicObject::GraphicManagerDestroyed()
{
// we're alive, but our manager doesn't live anymore ==> connect to default manager
mpMgr = NULL;
- ImplSetGraphicManager( NULL );
+ ImplSetup( NULL );
}
sal_Bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
@@ -505,12 +505,6 @@ sal_Bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Si
return bRet;
}
-void GraphicObject::ReleaseFromCache()
-{
-
- mpMgr->ReleaseFromCache( *this );
-}
-
bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicAttr* pAttr, sal_uLong nFlags )
{
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 84a18a8cd058..ec6be0f36173 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -70,21 +70,16 @@ void GraphicManager::SetCacheTimeout( sal_uLong nTimeoutSeconds )
mpCache->SetCacheTimeout( nTimeoutSeconds );
}
-void GraphicManager::ReleaseFromCache( const GraphicObject& /*rObj*/ )
-{
- // !!!
-}
-
sal_Bool GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt,
- const Size& rSz, const GraphicObject& rObj,
+ const Size& rSz, const rtl::Reference< GraphicObject > &rObj,
const GraphicAttr& rAttr ) const
{
return mpCache->IsInDisplayCache( pOut, rPt, rSz, rObj, rAttr );
}
sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- GraphicObject& rObj, const GraphicAttr& rAttr,
- const sal_uLong nFlags, sal_Bool& rCached )
+ const rtl::Reference< GraphicObject >& rObj, const GraphicAttr& rAttr,
+ const sal_uLong nFlags, sal_Bool& rCached )
{
Point aPt( rPt );
Size aSz( rSz );
@@ -140,12 +135,10 @@ sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Si
void GraphicManager::ImplRegisterObj( const rtl::Reference< GraphicObject >& xObj,
Graphic& rSubstitute,
- const OString* pID,
- const rtl::Reference< GraphicObject >* pCopyObj )
+ const OString* pID )
{
-#error mis-handling of pCopyObj
maObjList.push_back( xObj );
- mpCache->AddGraphicObject( xObj, rSubstitute, pID, pCopyObj );
+ mpCache->AddGraphicObject( xObj, rSubstitute, pID );
}
void GraphicManager::ImplUnregisterObj( const rtl::Reference< GraphicObject >& xObj )