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

sw: redo check in SwFEShell::FindAnchorPos() a bit (related: fdo#87760)

The only valid non-txtnode return value for the SwPosition is the
unmodified initial value (hopefully).

Change-Id: Ib5789455576a20848dd7f0542bd520aa04040b90
üst ea1d8c5a
......@@ -427,11 +427,12 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt )
SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() );
Point aTmpPnt( rAbsPos );
GetLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState );
if ( nAnchorId != FLY_AT_CHAR
|| !PosInsideInputFld( aPos ) )
if (aPos.nNode != GetDoc()->GetNodes().GetEndOfExtras().GetIndex()
&& (nAnchorId != FLY_AT_CHAR || !PosInsideInputFld(aPos)))
{
SwCntntNode* pCNode = aPos.nNode.GetNode().GetCntntNode();
pTxtFrm = pCNode ? pCNode->getLayoutFrm(GetLayout(), 0, &aPos, false) : NULL;
assert(pCNode);
pTxtFrm = pCNode->getLayoutFrm(GetLayout(), 0, &aPos, false);
}
}
const SwFrm *pNewAnch = NULL;
......
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