forked from amazingfate/loongoffice
Regression from commit 682e0488df819c191c13a03758fad0690706e508 (tdf#134099 sw: fix textbox anchors on copy-paste and undo, 2020-06-29), now that we don't copy draw+fly format pairs more than once, the fly frame of a fly format was missing. This was broken because sw::DocumentContentOperationsManager::CopyFlyInFlyImpl() calls CopyLayoutFormat() with bMakeFrames=true, but the frame format list doesn't contain as-char frames. For as-char frames CopyLayoutFormat() is called by SwTextFlyCnt::CopyFlyFormat() instead, but with bMakeFrames=false, so the fly frame's layout frame were never made. Fix the problem by explicitly making frames in DocumentLayoutManager::CopyLayoutFormat(), which also requires delete+make in SwTextFlyCnt::SetAnchor(). [ This is now consistent with the start of SwTextFlyCnt::SetAnchor(), which also deletes frames for fly frame formats. Otherwise CppunitTest_sw_core_txtnode would crash in testTextBoxCopyAnchor. ] Change-Id: I87003ee09ca75b9fecd70a1aa5c42f762f715be8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114680 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>