summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-06-20 08:50:57 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-06-21 08:25:04 +0200
commit3ba4bbcd13dda662832de8cb603b725a66cb53f0 (patch)
treeeb0d483764b8407ca879d4f06b73e7da4aa20ede /sd/source
parent05291e38d53e8be76b690586cff0cf4f067e918f (diff)
sw floattable: fix negative vertical offset handling on page boundary
The bugdoc has 3 floating tables, the last one was on page 1 in Word, but it was on page 2 in Writer. It seems what happens is that the vertical offset of the last table is negative, so it is moved above the paragraph before the last floating table, but once the anchor frame (last paragraph) is moved to a new page (because it doesn't fit), then its fly frame is also moved to page 2, which leads to overlapping text in the original bugdoc. Interesting this works already with 0 vertical offset, and in that case we split the last paragraph, fill the page 1 part with a fly portion and fill the page 2 part with the anchor text. Fix the problem by: - triggering a split of the frame in SwTextFrameBreak::IsBreakNow(): if the anchor frame doesn't fit (has to be moved to a next page), then split it, so only the anchor text is moved, the fly is not (so its position matches Word) - preventing the manipulation of the frame offset in SwTextFrame::AdjustFollow_(), so no content is moved from the follow to the parent, because that would mean later we move the joined frame to the next page - finally minimizing the frame height at the end of SwTextFrame::Format(), so the master still fits the current page An alternative approach would be to extend SwAnchoredObject::FindAnchorCharFrame(), which already has code to handle the case when the text frame master and the anchored object is not on the same page, but that operates on existing anchor frames, and here the original problem is that the entire anchor frame is moved to page 2, so we don't have anything left on page 1. Note that this is all specific to floating tables, I could not reproduce the same behavior with an anchored shape in Word. Change-Id: I007b57b369f5c1e98ccad77111958dfd9335f079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153309 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153366
Diffstat (limited to 'sd/source')
0 files changed, 0 insertions, 0 deletions