From 62bbdcd5ac07f80bc6cf85a316c05433f238cecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 8 May 2014 15:06:48 +0100 Subject: [PATCH] reset the cache timeout on GetGraphic --- ...7-reset-the-cache-timeout-on-GetGrap.patch | 63 +++++++++++++++++++ libreoffice.spec | 2 + 2 files changed, 65 insertions(+) create mode 100644 0001-Related-fdo-50697-reset-the-cache-timeout-on-GetGrap.patch diff --git a/0001-Related-fdo-50697-reset-the-cache-timeout-on-GetGrap.patch b/0001-Related-fdo-50697-reset-the-cache-timeout-on-GetGrap.patch new file mode 100644 index 0000000..441a047 --- /dev/null +++ b/0001-Related-fdo-50697-reset-the-cache-timeout-on-GetGrap.patch @@ -0,0 +1,63 @@ +From 62b0eaf37c08dd27244e77b8bc90c691b000ebd6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 29 Apr 2014 14:17:11 +0100 +Subject: [PATCH] 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 +--- + include/svtools/grfmgr.hxx | 2 ++ + svtools/source/graphic/grfmgr.cxx | 20 ++++++++++++++++++-- + 2 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx +index 3e1423a..251ee6d 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 087d27b..a405ea7 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(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; + } +-- +1.9.0 + diff --git a/libreoffice.spec b/libreoffice.spec index bd8ad0d..be01ea9 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -301,6 +301,7 @@ Patch40: 0001-Related-fdo-36815-clip-overlarge-comment-contents.patch Patch41: 0001-Resolves-rhbz-1092589-Thoroughly-check-whether-JRE-i.patch Patch42: 0001-center-slide-after-changing-zoom.patch Patch43: 0001-add-a-status-bar-icon-to-fit-slide-to-window.patch +Patch44: 0001-Related-fdo-50697-reset-the-cache-timeout-on-GetGrap.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2267,6 +2268,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : * Thu May 08 2014 Caolán McNamara - 1:4.2.4.2-6 - center current slide after changing zoom - add a status bar icon to fit slide to window +- Related: fdo#50697 reset the cache timeout on GetGraphic * Thu May 08 2014 Stephan Bergmann - 1:4.2.4.2-5 - Resolves: rhbz#1092589 Thoroughly check whether JRE is still present