summaryrefslogtreecommitdiff
path: root/svtools/source/graphic
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-26 13:48:25 +0200
committerNoel Grandin <noel@peralex.com>2015-08-26 13:52:28 +0200
commit93157d284ea37cca200759804268c0a872852549 (patch)
tree7116d9eb94ecfc115db83f2155ba686037f618d8 /svtools/source/graphic
parentcadac8400a018c8c566379f7767ea5edff78523d (diff)
convert Link to Typed
and make it statically allocated, no point in dynamically allocating such a small object Change-Id: If476bf5dc1e0d535383d16bc49c8d567776f16cd
Diffstat (limited to 'svtools/source/graphic')
-rw-r--r--svtools/source/graphic/grfmgr.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 64c4ee7f247d..bac2be74e966 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -130,14 +130,13 @@ GraphicObject::~GraphicObject()
}
delete mpSwapOutTimer;
- delete mpSwapStreamHdl;
delete mpSimpleCache;
}
void GraphicObject::ImplConstruct()
{
mpMgr = NULL;
- mpSwapStreamHdl = NULL;
+ maSwapStreamHdl = Link<const GraphicObject*, SvStream*>();
mpSwapOutTimer = NULL;
mpSimpleCache = NULL;
mnAnimationLoopCount = 0;
@@ -350,7 +349,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj )
{
mpMgr->ImplUnregisterObj( *this );
- delete mpSwapStreamHdl, mpSwapStreamHdl = NULL;
+ maSwapStreamHdl = Link<const GraphicObject*, SvStream*>();
delete mpSimpleCache, mpSimpleCache = NULL;
maGraphic = rGraphicObj.GetGraphic();
@@ -391,7 +390,7 @@ OString GraphicObject::GetUniqueID() const
SvStream* GraphicObject::GetSwapStream() const
{
if( HasSwapStreamHdl() )
- return reinterpret_cast<SvStream*>( mpSwapStreamHdl->Call( const_cast<void*>(static_cast<const void*>(this)) ) );
+ return maSwapStreamHdl.Call( this );
else
return GRFMGR_AUTOSWAPSTREAM_NONE;
}
@@ -428,11 +427,11 @@ void GraphicObject::SetUserData( const OUString& rUserData )
void GraphicObject::SetSwapStreamHdl()
{
- if( mpSwapStreamHdl )
+ if( mpSwapOutTimer )
{
delete mpSwapOutTimer, mpSwapOutTimer = NULL;
- delete mpSwapStreamHdl, mpSwapStreamHdl = NULL;
}
+ maSwapStreamHdl = Link<const GraphicObject*, SvStream*>();
}
static sal_uInt32 GetCacheTimeInMs()
@@ -444,9 +443,9 @@ static sal_uInt32 GetCacheTimeInMs()
return nSeconds * 1000;
}
-void GraphicObject::SetSwapStreamHdl(const Link<>& rHdl)
+void GraphicObject::SetSwapStreamHdl(const Link<const GraphicObject*, SvStream*>& rHdl)
{
- delete mpSwapStreamHdl, mpSwapStreamHdl = new Link<>( rHdl );
+ maSwapStreamHdl = rHdl;
sal_uInt32 const nSwapOutTimeout(GetCacheTimeInMs());
if( nSwapOutTimeout )