summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2016-09-16 22:32:29 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-09-21 16:10:57 +0000
commitcd72269a6a2c85ae9dd4552aa4808ef4fd1f6c0e (patch)
tree7005d3e1aeecb7893a5341559843e05909611892 /sw/source
parent00f62f7b1762f34eec6c35492399628193b4f978 (diff)
tdf#102233: avoid infinite loop recursion in IsProtect node method
See https://bugs.documentfoundation.org/show_bug.cgi?id=102233#c5 Change-Id: Ic985662011b33d4b20b7c60df33c9ecc97326e85 Reviewed-on: https://gerrit.libreoffice.org/28972 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/docnode/node.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index e42598c2ab00..19e210998de7 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -433,10 +433,14 @@ bool SwNode::IsProtect() const
SwFrameFormat* pFlyFormat = GetFlyFormat();
if( pFlyFormat )
{
- if( pFlyFormat->GetProtect().IsContentProtected() )
+ if (pFlyFormat->GetProtect().IsContentProtected())
return true;
const SwFormatAnchor& rAnchor = pFlyFormat->GetAnchor();
- return rAnchor.GetContentAnchor() && rAnchor.GetContentAnchor()->nNode.GetNode().IsProtect();
+ const SwPosition* pAnchorPos = rAnchor.GetContentAnchor();
+ if (!pAnchorPos)
+ return false;
+ const SwNode& rAnchorNd = pAnchorPos->nNode.GetNode();
+ return &rAnchorNd != this && rAnchorNd.IsProtect();
}
if( nullptr != ( pSttNd = FindFootnoteStartNode() ) )