summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-02 23:59:17 +0100
committerMichael Stahl <mstahl@redhat.com>2014-02-03 12:34:06 +0100
commit2d9d20edc999ef2c2ad2ee628a6a5f27efb801d8 (patch)
tree42cbb40f0fcdd7ca6fa7af8b2edeac18f4d69f73
parente4be770ec8218d80dcc9f1e38fd1c69717beb4fb (diff)
fdo#73300: sw: GraphicObjects are never swapped out
In SwNoTxtFrm::PaintPicture() the GraphicObjects are no longer painted via GraphicObject::Draw() any more there is the problem that they are not cached any more in the display cache of the GraphicManager; that used to immediately swap out the Graphic but now they are never swapped out. Since there appears to be no use of the GraphicManager's display cache in the new drawinglayer based rendering path i have no idea how to swap out the Graphic immediately; instead use the same time-out that SdrGrafObj is using already. This timeout is derived from the setting: Tools->Options->LibreOffice->Memory->Graphics cache->"Remove from memory after". (regression from 2e5167528f7566dd9b000e50fc1610b7bf99132a) Change-Id: I0d9b535a82646d9b6635cfb3917f74dcc3ad8720
-rw-r--r--svx/source/svdraw/svdograf.cxx2
-rw-r--r--sw/source/core/graphic/ndgrf.cxx8
2 files changed, 6 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 949898bf5bc0..108917ad0855 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -71,7 +71,7 @@ using namespace ::com::sun::star::io;
// #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
-sal_uInt32 getCacheTimeInMs()
+SVX_DLLPUBLIC sal_uInt32 getCacheTimeInMs()
{
static bool bSetAtAll(true);
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 5d217fb70c7e..532ee3176606 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -56,6 +56,8 @@
using namespace com::sun::star;
+SVX_DLLPUBLIC sal_uInt32 getCacheTimeInMs();
+
SwGrfNode::SwGrfNode(
const SwNodeIndex & rWhere,
const OUString& rGrfName, const OUString& rFltName,
@@ -69,7 +71,7 @@ SwGrfNode::SwGrfNode(
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( sal_False )
{
- maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
+ maGrfObj.SetSwapStreamHdl( LINK(this, SwGrfNode, SwapGraphic), getCacheTimeInMs() );
bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
bFrameInPaint = bScaleImageMap = sal_False;
@@ -87,7 +89,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( sal_False )
{
- maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
+ maGrfObj.SetSwapStreamHdl( LINK(this, SwGrfNode, SwapGraphic), getCacheTimeInMs() );
if( rGrfObj.HasUserData() && rGrfObj.IsSwappedOut() )
maGrfObj.SetSwapState();
bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel= bLoadLowResGrf =
@@ -112,7 +114,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( sal_False )
{
- maGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
+ maGrfObj.SetSwapStreamHdl( LINK(this, SwGrfNode, SwapGraphic), getCacheTimeInMs() );
Graphic aGrf; aGrf.SetDefaultType();
maGrfObj.SetGraphic( aGrf, rGrfName );