From 9bde6f8a0c5fed9d30cd0e296ec9258937376bdf Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 17 Jan 2013 21:45:09 +0100 Subject: fdo#59437: SwFmtAnchor::SetAnchor: Anchors may be on StartNodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assertion added in 90a0116ccb48388d91b21128fcac2e4609838581 wasn't quite right. Change-Id: Icac6c4e3932837ffaf170d9b18664e5b4ff579ff (cherry picked from commit 0ed73a0817ad0ff0107cb297208252c0afe3b4a9) Reviewed-on: https://gerrit.libreoffice.org/1747 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/core/layout/atrfrm.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index f5d7798b3dc5..180b145344dc 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1514,8 +1514,11 @@ SwFmtAnchor::~SwFmtAnchor() void SwFmtAnchor::SetAnchor( const SwPosition *pPos ) { - // anchor only to paragraphs - assert(!pPos || dynamic_cast(&pPos->nNode.GetNode())); + // anchor only to paragraphs, or start nodes in case of FLY_AT_FLY + assert(!pPos + || ((FLY_AT_FLY == nAnchorId) && + dynamic_cast(&pPos->nNode.GetNode())) + || dynamic_cast(&pPos->nNode.GetNode())); m_pCntntAnchor .reset( (pPos) ? new SwPosition( *pPos ) : 0 ); // Flys anchored AT paragraph should not point into the paragraph content if (m_pCntntAnchor && -- cgit v1.2.3