diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-07-14 18:51:41 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-07-17 13:57:01 +0200 |
commit | 72cb68b958f4b037a35bc21f6d6338b19b20fa96 (patch) | |
tree | 10135da33dcf282714736e2da61fbbd10b951b42 | |
parent | a1c2341b0397dcc2575c05f143fdf7eac9aabe53 (diff) |
tdf#156287: don't try to move objects to pages other than their anchor
Objects may have offset moving them outside of the current page, where
their anchor is. This doesn't mean that they would move to another page,
just that they will be clipped.
Without this taken into account, objects which rectangle would be on
another page, would trigger infinite loop because of their position
invalidation in SwLayAction::FormatContent's cleanup code, where they
will move to their correct page; and then their off-page rectangle
would move them to another page again.
Change-Id: I2b818403163041a49a3bc1640b1af9a1705fd671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154444
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 8fc1162d3e7f894adf225fa65ec09bbb83bb17fb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154451
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 25feffa49576564d7fe70fb20597855d33ac8492)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154465
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index a467e53174fc..332f82f0f767 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -2042,10 +2042,12 @@ void SwDrawContact::ChkPage() } // --> #i28701# + // tdf#156287: use anchor page, not current bound rectangle's page, + // because an object can't move to a page other than its anchor anyway SwPageFrame* pPg = ( maAnchoredDrawObj.GetAnchorFrame() && maAnchoredDrawObj.GetAnchorFrame()->IsPageFrame() ) ? GetPageFrame() - : FindPage( SwRect(GetMaster()->GetCurrentBoundRect()) ); + : maAnchoredDrawObj.FindPageFrameOfAnchor(); if ( GetPageFrame() == pPg ) return; |