summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-03 00:12:23 +0100
committerMichael Stahl <mstahl@redhat.com>2014-02-03 12:34:07 +0100
commit6ef04640ab92ce69000dcff3071eaef4419a9af6 (patch)
tree60aeee18c60f1922cb73ad2dc3cd11c3a7e3c5cb /svx/source
parent2d9d20edc999ef2c2ad2ee628a6a5f27efb801d8 (diff)
remove GraphicObject::SetSwapStreamHdl() timeout parameter
Every call to SetSwapStreamHdl uses the same timeout now so move the function that determines that to svtools. Change-Id: Ib7395d43dd132a9e14e7a7862ff2c2279f319536
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdograf.cxx45
1 files changed, 4 insertions, 41 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 108917ad0855..7a752b1b2f3a 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -61,48 +61,11 @@
#include <osl/thread.hxx>
#include <drawinglayer/processor2d/objectinfoextractor2d.hxx>
#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
-#include <officecfg/Office/Common.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
-#define SWAPGRAPHIC_TIMEOUT 5000
-
-// #i122985# it is not correct to set the swap-timeout to a hard-coded 5000ms as it was before.
-// Added code and experimented what to do as a good compromize, see description
-SVX_DLLPUBLIC sal_uInt32 getCacheTimeInMs()
-{
- static bool bSetAtAll(true);
-
- if(bSetAtAll)
- {
- static bool bSetToPreferenceTime(true);
-
- if(bSetToPreferenceTime)
- {
- const sal_uInt32 nSeconds =
- officecfg::Office::Common::Cache::GraphicManager::ObjectReleaseTime::get(
- comphelper::getProcessComponentContext());
-
-
- // the default is 10 minutes. The minimum is one minute, thus 60 seconds. When the minimum
- // should match to the former hard-coded 5 seconds, we have a divisor of 12 to use. For the
- // default of 10 minutes this would mean 50 seconds. Compared to before this is ten times
- // more (would allow better navigation by switching through pages) and is controllable
- // by the user by setting the tools/options/memory/Remove_from_memory_after setting. Seems
- // to be a good compromize to me.
- return nSeconds * 1000 / 12;
- }
- else
- {
- return SWAPGRAPHIC_TIMEOUT;
- }
- }
-
- return 0;
-}
-
const Graphic ImpLoadLinkedGraphic( const OUString& aFileName, const OUString& aReferer, const OUString& aFilterName )
{
Graphic aGraphic;
@@ -380,7 +343,7 @@ SdrGrafObj::SdrGrafObj()
{
pGraphic = new GraphicObject;
mpReplacementGraphic = 0;
- pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), getCacheTimeInMs() );
+ pGraphic->SetSwapStreamHdl( LINK(this, SdrGrafObj, ImpSwapHdl) );
onGraphicChanged();
// #i118485# Shear allowed and possible now
@@ -404,7 +367,7 @@ SdrGrafObj::SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect)
{
pGraphic = new GraphicObject( rGrf );
mpReplacementGraphic = 0;
- pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), getCacheTimeInMs() );
+ pGraphic->SetSwapStreamHdl( LINK(this, SdrGrafObj, ImpSwapHdl) );
onGraphicChanged();
// #i118485# Shear allowed and possible now
@@ -428,7 +391,7 @@ SdrGrafObj::SdrGrafObj( const Graphic& rGrf )
{
pGraphic = new GraphicObject( rGrf );
mpReplacementGraphic = 0;
- pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), getCacheTimeInMs() );
+ pGraphic->SetSwapStreamHdl( LINK(this, SdrGrafObj, ImpSwapHdl) );
onGraphicChanged();
// #i118485# Shear allowed and possible now
@@ -457,7 +420,7 @@ void SdrGrafObj::SetGraphicObject( const GraphicObject& rGrfObj )
*pGraphic = rGrfObj;
delete mpReplacementGraphic;
mpReplacementGraphic = 0;
- pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), getCacheTimeInMs() );
+ pGraphic->SetSwapStreamHdl( LINK(this, SdrGrafObj, ImpSwapHdl) );
pGraphic->SetUserData();
mbIsPreview = false;
SetChanged();