Kaydet (Commit) 0ed73a08 authored tarafından Michael Stahl's avatar Michael Stahl

fdo#59437: SwFmtAnchor::SetAnchor: Anchors may be on StartNodes

Assertion added in 90a0116c wasn't quite
right.

Change-Id: Icac6c4e3932837ffaf170d9b18664e5b4ff579ff
üst 1fb5ecdd
...@@ -1514,8 +1514,11 @@ SwFmtAnchor::~SwFmtAnchor() ...@@ -1514,8 +1514,11 @@ SwFmtAnchor::~SwFmtAnchor()
void SwFmtAnchor::SetAnchor( const SwPosition *pPos ) void SwFmtAnchor::SetAnchor( const SwPosition *pPos )
{ {
// anchor only to paragraphs // anchor only to paragraphs, or start nodes in case of FLY_AT_FLY
assert(!pPos || dynamic_cast<SwTxtNode*>(&pPos->nNode.GetNode())); 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 ); m_pCntntAnchor .reset( (pPos) ? new SwPosition( *pPos ) : 0 );
// Flys anchored AT paragraph should not point into the paragraph content // Flys anchored AT paragraph should not point into the paragraph content
if (m_pCntntAnchor && if (m_pCntntAnchor &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment