summaryrefslogtreecommitdiff
path: root/sw/source/core/graphic/ndgrf.cxx
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-03-06 16:12:59 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2020-03-10 11:15:53 +0100
commit30b23d77c894bdf6f7ae0d18d594ea267a80f662 (patch)
tree88d6718be2533051297e472b0838389f3c12f58e /sw/source/core/graphic/ndgrf.cxx
parent20c5a2abb61c4246c6001b7b6d5bd69cd5882cfd (diff)
tdf#131185 Prevent unnecessary SwapIn calls.
When the http response is 404 or something like that we shouldn't retry the download embeded image constantly. This causes libreoffice to short freezes. Change-Id: I7381d04f12e9fbea961dd0e3333ea0d39aa93d14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90102 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'sw/source/core/graphic/ndgrf.cxx')
-rw-r--r--sw/source/core/graphic/ndgrf.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index b0c5a3111047..e73d19f3c923 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -59,6 +59,7 @@ SwGrfNode::SwGrfNode(
SwAttrSet const * pAutoAttr ) :
SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ),
maGrfObj(),
+ mbInBaseLinkSwapIn(true),
// #i73788#
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( false )
@@ -75,6 +76,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
SwAttrSet const * pAutoAttr ) :
SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ),
maGrfObj(rGrfObj),
+ mbInBaseLinkSwapIn(true),
// #i73788#
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( false )
@@ -96,6 +98,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
SwAttrSet const * pAutoAttr ) :
SwNoTextNode( rWhere, SwNodeType::Grf, pGrfColl, pAutoAttr ),
maGrfObj(),
+ mbInBaseLinkSwapIn(true),
// #i73788#
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( false )
@@ -440,13 +443,15 @@ bool SwGrfNode::SwapIn(bool bWaitForData)
if( pLink )
{
- if( GraphicType::NONE == maGrfObj.GetType() ||
- GraphicType::Default == maGrfObj.GetType() )
+ if( (GraphicType::NONE == maGrfObj.GetType() ||
+ GraphicType::Default == maGrfObj.GetType()) &&
+ mbInBaseLinkSwapIn)
{
// link was not loaded yet
if( pLink->SwapIn( bWaitForData ) )
{
bRet = true;
+ mbInBaseLinkSwapIn = false;
}
else if( GraphicType::Default == maGrfObj.GetType() )
{