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 <raykowj@gmail.com>
This commit is contained in:
Jim Raykowski
2025-12-18 19:08:13 +01:00
parent 3ecaa6694c
commit dfc0ec48f8
+4 -1
View File
@@ -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.