diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-01-17 21:45:09 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-01-17 22:32:12 +0100 |
commit | 0ed73a0817ad0ff0107cb297208252c0afe3b4a9 (patch) | |
tree | 614715a76b8bfd32783efbcaa304da1fc499074a | |
parent | 1fb5ecdd7442247e0ed8154928b66fab0bcbe3ad (diff) |
fdo#59437: SwFmtAnchor::SetAnchor: Anchors may be on StartNodes
Assertion added in 90a0116ccb48388d91b21128fcac2e4609838581 wasn't quite
right.
Change-Id: Icac6c4e3932837ffaf170d9b18664e5b4ff579ff
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 7 |
1 files 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<SwTxtNode*>(&pPos->nNode.GetNode())); + // anchor only to paragraphs, or start nodes in case of FLY_AT_FLY + assert(!pPos + || ((FLY_AT_FLY == nAnchorId) && + dynamic_cast<SwStartNode*>(&pPos->nNode.GetNode())) + || dynamic_cast<SwTxtNode*>(&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 && |