diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-29 14:17:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-29 15:24:27 +0100 |
commit | 62b0eaf37c08dd27244e77b8bc90c691b000ebd6 (patch) | |
tree | 56f71e65b519cc674667bcc2dc7361e024067c7c /svtools/source/graphic | |
parent | b25871da62facc20387ebfa2b908422578ca8ce9 (diff) |
Related: fdo#50697 reset the cache timeout on GetGraphic
so the graphic gets swapped out Xms after the last use and not Xms after
initial creation regardless of if it got used a moment earlier.
Change-Id: I1458f307d090ecd8d8d031b545f23e78bf1bcb67
Diffstat (limited to 'svtools/source/graphic')
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
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; } |