summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svtools/grfmgr.hxx2
-rw-r--r--svtools/source/graphic/grfmgr.cxx20
2 files changed, 20 insertions, 2 deletions
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 3e1423ac6b3b..251ee6d43457 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -299,6 +299,8 @@ private:
DECL_LINK( ImplAutoSwapOutHdl, void* );
+ void SVT_DLLPRIVATE ResetCacheTimeOut();
+
protected:
virtual void GraphicManagerDestroyed();
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 087d27be6872..a405ea709603 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -744,10 +744,26 @@ void GraphicObject::StopAnimation( OutputDevice* pOut, long nExtraData )
mpSimpleCache->maGraphic.StopAnimation( pOut, nExtraData );
}
+void GraphicObject::ResetCacheTimeOut()
+{
+ if (mpSwapOutTimer)
+ {
+ mpSwapOutTimer->Stop();
+ mpSwapOutTimer->Start();
+ }
+}
+
const Graphic& GraphicObject::GetGraphic() const
{
- if( mbAutoSwapped )
- ( (GraphicObject*) this )->ImplAutoSwapIn();
+ GraphicObject *pThis = const_cast<GraphicObject*>(this);
+
+ if (mbAutoSwapped)
+ pThis->ImplAutoSwapIn();
+
+ //fdo#50697 If we've been asked to provide the graphic, then reset
+ //the cache timeout to start from now and not remain at the
+ //time of creation
+ pThis->ResetCacheTimeOut();
return maGraphic;
}