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

sw_redlinehide_2: move SwInsText/SwDelText hint in CutImpl before attributes

An unfortunate incident involving a footnote accessing its old anchor
node's layout frame during InsertHint and the MapModelToViewPos needing
to have a mapping for this index...

6  SwTextFrame::MapModelToViewPos(SwPosition const&) const (this=0x8937760, rPos=SwPosition (node 41, offset 4)) at sw/source/core/text/txtfrm.cxx:1005
7  SwTextFrame::GetFrameAtPos(SwPosition const&) (this=0x8937760, rPos=SwPosition (node 41, offset 4)) at sw/source/core/text/frmcrsr.cxx:153
8  GetFrameOfModify(SwRootFrame const*, SwModify const&, SwFrameType, Point const*, SwPosition const*, bool) (pLayout=0x6a0a240, rMod=..., nFrameType=(SwFrameType::Txt | SwFrameType::NoTxt), pPoint=0x0, pPos=0x7ffcfa9d70a0, bCalcFrame=false) at sw/source/core/layout/frmtool.cxx:3517
9  SwContentNode::getLayoutFrame(SwRootFrame const*, Point const*, SwPosition const*, bool) const (this=0x6a67e20, _pRoot=0x6a0a240, pPoint=0x0, pPos=0x7ffcfa9d70a0, bCalcFrame=false) at sw/source/core/docnode/node.cxx:1137
10 SwFootnoteFrame::GetRefFromAttr() (this=0x8970a30) at sw/source/core/layout/ftnfrm.cxx:2839
11 SwContentNode::DelFrames(SwRootFrame const*, bool) (this=0x897ead0, pLayout=0x0, fromDtor=false) at sw/source/core/docnode/node.cxx:1419
12 SwTextNode::InsertHint(SwTextAttr*, SetAttrMode) (this=0x89ac890, pAttr=0x6a3ff60, nMode=(SetAttrMode::DONTREPLACE | SetAttrMode::NOTXTATRCHR)) at sw/source/core/txtnode/thints.cxx:1408
13 SwTextNode::CutImpl(SwTextNode*, SwIndex const&, SwIndex const&, int, bool) (this=0x6a67e20, pDest=0x89ac890, rDestStart=SwIndex (offset 2), rStart=SwIndex (offset 0), nLen=3, bUpdate=false) at sw/source/core/txtnode/ndtxt.cxx:2374
14 SwTextNode::CutText(SwTextNode*, SwIndex const&, int) (this=0x6a67e20, pDest=0x89ac890, rStart=SwIndex (offset 0), nLen=3) at sw/source/core/txtnode/ndtxt.cxx:2199
15 SwTextNode::JoinNext() (this=0x89ac890) at sw/source/core/txtnode/ndtxt.cxx:812

Change-Id: If0dc0f16eb124dc8a070b84684ee9ec9ab0dc70f
üst 67296669
...@@ -2327,6 +2327,13 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart, ...@@ -2327,6 +2327,13 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart,
} }
} }
// notify frames - before moving hints, because footnotes
// want to find their anchor text frame in the follow chain
SwInsText aInsHint( nDestStart, nLen );
pDest->ModifyNotification( nullptr, &aInsHint );
SwDelText aDelHint( nTextStartIdx, nLen );
ModifyNotification( nullptr, &aDelHint );
// 2. move attributes // 2. move attributes
// Iterate over attribute array until the start of the attribute // Iterate over attribute array until the start of the attribute
// is behind the moved range // is behind the moved range
...@@ -2462,12 +2469,6 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart, ...@@ -2462,12 +2469,6 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart,
CHECK_SWPHINTS(this); CHECK_SWPHINTS(this);
TryDeleteSwpHints(); TryDeleteSwpHints();
// notify layout frames
SwInsText aInsHint( nDestStart, nLen );
pDest->ModifyNotification( nullptr, &aInsHint );
SwDelText aDelHint( nTextStartIdx, nLen );
ModifyNotification( nullptr, &aDelHint );
} }
void SwTextNode::EraseText(const SwIndex &rIdx, const sal_Int32 nCount, void SwTextNode::EraseText(const SwIndex &rIdx, const sal_Int32 nCount,
......
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