Kaydet (Commit) d4653a95 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Remove these useless static bool variables.

Change-Id: I7a8ad7814231f129d5d1146ceb36eb2c22b2aff1
üst 70dff8d4
...@@ -443,43 +443,25 @@ void GraphicObject::SetSwapStreamHdl() ...@@ -443,43 +443,25 @@ void GraphicObject::SetSwapStreamHdl()
} }
} }
#define SWAPGRAPHIC_TIMEOUT 5000
// #i122985# it is not correct to set the swap-timeout to a hard-coded 5000ms // #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 // as it was before. Added code and experimented what to do as a good
// compromise, see description. // compromise, see description.
static sal_uInt32 GetCacheTimeInMs() static sal_uInt32 GetCacheTimeInMs()
{ {
static bool bSetAtAll(true); const sal_uInt32 nSeconds =
officecfg::Office::Common::Cache::GraphicManager::ObjectReleaseTime::get(
if (bSetAtAll) comphelper::getProcessComponentContext());
{
static bool bSetToPreferenceTime(true);
// The default is 10 minutes. The minimum is one minute, thus 60
if (bSetToPreferenceTime) // 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
const sal_uInt32 nSeconds = // minutes this would mean 50 seconds. Compared to before this is
officecfg::Office::Common::Cache::GraphicManager::ObjectReleaseTime::get( // ten times more (would allow better navigation by switching
comphelper::getProcessComponentContext()); // through pages) and is controllable by the user by setting the
// tools/options/memory/Remove_from_memory_after setting. Seems to
// be a good compromise to me.
// The default is 10 minutes. The minimum is one minute, thus 60 return nSeconds * 1000 / 12;
// 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 compromise to me.
return nSeconds * 1000 / 12;
}
else
{
return SWAPGRAPHIC_TIMEOUT;
}
}
return 0;
} }
void GraphicObject::SetSwapStreamHdl(const Link& rHdl) void GraphicObject::SetSwapStreamHdl(const Link& rHdl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment