From 6d86a908eb08d39236d700b2797c66ff7ae4a78a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 20 Apr 2021 12:45:36 +0200 Subject: tdf#138785 sw: fix mis-positioned as-char flys when deleting empty page When SwFrame::CheckPageDescs() deletes an empty page in the middle of the document, which happens during SetRedlineFlags() here, the SwFlyInContentFrame::maFrameArea is moved in lcl_MoveAllLowers(), but the SwFlyInContentFrame::m_aRefPoint stays unchanged. Because the formatting occurs only after the redline mode is reset, the position of the SwFlyInContentFrame when it is formatted is exactly the same as its (stale) m_aRefPoint, so the setting of (updated) maFrameArea is skipped in SwAsCharAnchoredObjectPosition::CalcPosition(), so the fly ends up a page above where it should be. So keep m_aRefPoint consistent with maFrameArea in lcl_MoveAllLowers(). (regression from b9ef71476fd70bc13f50ebe80390e0730d1b7afb) Change-Id: If1b421daa0d71718d89d9772f5c0d9e367e76845 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114332 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit e656cf2a71e738c282abcd0d610e724b955f274a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114520 Reviewed-by: Thorsten Behrens (cherry picked from commit c79b92edfb5e650fff76688998cf4f0bbd08d2a4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114603 Reviewed-by: Xisco Fauli Reviewed-by: Adolfo Jayme Barrientos Tested-by: Adolfo Jayme Barrientos --- sw/source/core/inc/flyfrms.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sw/source/core/inc/flyfrms.hxx') diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx index 82a67b9b5342..7605616d339d 100644 --- a/sw/source/core/inc/flyfrms.hxx +++ b/sw/source/core/inc/flyfrms.hxx @@ -227,6 +227,7 @@ public: //see layact.cxx void AddRefOfst( tools::Long nOfst ) { m_aRef.AdjustY( nOfst ); } + void AddRefOfst(Point const& rOfst) { m_aRef += rOfst; } // #i26791# virtual void MakeObjPos() override; -- cgit