summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-10-02 08:15:45 +0200
committerMiklos Vajna <vmiklos@collabora.com>2024-10-02 09:35:40 +0200
commitba7199da2e6ec9d58475373f264326fbeb31f4bd (patch)
treeb92ad75e712a24bbb17c9e3dcccfb4935b5cdd58 /ucbhelper
parentc6f9d381d395a7573fc0c1eba4b73b0fdf50f047 (diff)
tdf#156218 sw hide whitespace: fix increased page size on new para at doc end
Create a document of 1 page, add empty paragraphs, so the next empty paragraph would create a second page. Hide whitespace, then add that paragraph: no second page is created. Seems this is a regression from commit 2c23d4ee1e1370b20560e47db7efaeaac1d94b26 (tdf#96515 sw Hide Whitespace: avoid creating unneeded page frames, 2015-12-16), because previously we had the opposite problem: creating new page frames all the time, even if the current page frame could grow. Fix the problem by: 1) In SwPageFrame::MakeAll(), fix the size of the page frame when switching to hide whitespace mode, so margins are not part of the height. At least the last paragraph of the doc is now near the bottom of the page, so it's more likely to create a new page. This means now we're back to still tweaking the size of the last page: but we used to determine the height based on just content and here we just ignore top/bottom margin. 2) In SwPageFrame::CheckPageHeightValidForHideWhitespace(), handle the top/bottom margins, otherwise we'll think that the page frame can still grow, when it should not. 3) Finally in SwPageFrame::MakeAll(), when we determine the height for non-last pages, the text frame for the new paragraph is already inserted, so limit the page frame height: if "content height" is more than "height - whitespace", then that limit should be the height, otherwise the page frame height will grow forever. Change-Id: I1125c31ec8b387df41c0881af98469d56ed773db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174368 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'ucbhelper')
0 files changed, 0 insertions, 0 deletions