[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source
Julien Nabet
serval2412 at yahoo.fr
Wed Sep 21 19:40:49 UTC 2016
sw/source/core/docnode/node.cxx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 137e42521944c0f3d7ff73891917a476f2868996
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Fri Sep 16 22:32:29 2016 +0200
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit cd72269a6a2c85ae9dd4552aa4808ef4fd1f6c0e)
Reviewed-on: https://gerrit.libreoffice.org/29152
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 392143c..4273fd0 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() ) )
More information about the Libreoffice-commits
mailing list