summaryrefslogtreecommitdiffstats
path: root/sw/source/core/txtnode/atrflyin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/txtnode/atrflyin.cxx')
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index 837c90a1a5a7..0234220cd945 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -210,7 +210,24 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode )
{
SwFormatAnchor aTextBoxAnchor(pTextBox->GetAnchor());
aTextBoxAnchor.SetAnchor(aAnchor.GetContentAnchor());
+
+ // SwFlyAtContentFrame::Modify() assumes the anchor has a matching layout frame, which
+ // may not be the case when we're in the process of a node split, so block
+ // notifications.
+ bool bIsInSplitNode = pNode->GetpSwpHints() && pNode->GetpSwpHints()->IsInSplitNode();
+ if (bIsInSplitNode)
+ {
+ pTextBox->LockModify();
+ }
+
pTextBox->SetFormatAttr(aTextBoxAnchor);
+
+ if (bIsInSplitNode)
+ {
+ pOldNode->RemoveAnchoredFly(pTextBox);
+ aPos.nNode.GetNode().AddAnchoredFly(pTextBox);
+ pTextBox->UnlockModify();
+ }
}
}