sw/source/core/layout/frmtool.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit dfc0ec48f86b39f7159d0c856fa7d497bea3ea13 Author: Jim Raykowski <[email protected]> AuthorDate: Mon Dec 15 15:03:33 2025 -0900 Commit: Jim Raykowski <[email protected]> CommitDate: Thu Dec 18 19:08:13 2025 +0100 tdf#90993 Fix anchored objects disappear A stab at fixing when an anchor of a frame is changed all draw objects anchored to the frame or anchored in the frame content disappear. Change-Id: Icce446b759def60460a2b72bd9eb57b5749cd26f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195689 Tested-by: Jenkins Reviewed-by: Jim Raykowski <[email protected]> diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 8f8abf11c886..05570008e05d 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1077,7 +1077,10 @@ void AppendObj(SwFrame *const pFrame, SwPageFrame *const pPage, SwFrameFormat *c { if ( !pNew->GetAnchorFrame() ) { - pFrame->AppendDrawObj( *(pNew->GetAnchoredObj( nullptr )) ); + SwAnchoredObject& rAnchorObj = *(pNew->GetAnchoredObj(nullptr)); + pFrame->AppendDrawObj(rAnchorObj); + if (rAnchorObj.GetDrawObj()->IsVisible()) + pNew->MoveObjToVisibleLayer(rAnchorObj.DrawObj()); } // OD 19.06.2003 #108784# - add 'virtual' drawing object, // if necessary. But control objects have to be excluded.
