tdf#99932: sw: fix for invalid anchor location for FLY_AT_CHAR mode

In such case anchor position depends on LastCharRect which can be
invalid because of happened frame movement, resize, etc.

Change-Id: I3d3c6318ee1ce5f4043e21ab091417d283c4260c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120059
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
(cherry picked from commit 6e879d5f142766c941d1c3bafd17f67b78c1c9f4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119990
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index b2ad0f3..646b00b 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -235,6 +235,11 @@ void SwDrawView::AddCustomHdl()
        // #i28701# - use last character rectangle saved at object
        // in order to avoid a format of the anchor frame
        SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );

        // Invalidate/recalc LastCharRect which can contain invalid frame offset because
        // of later frame changes
        pAnchoredObj->CheckCharRectAndTopOfLine(false);

        SwRect aAutoPos = pAnchoredObj->GetLastCharRect();
        if ( aAutoPos.Height() )
        {