diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-11-13 20:52:28 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-11-16 16:51:19 +0100 |
commit | b9ef71476fd70bc13f50ebe80390e0730d1b7afb (patch) | |
tree | de2c044f51addf5a7ccc32f0d3289db919d5b19e /sax | |
parent | 094ee3955ee81e1bc631d50cc216cbb17a777839 (diff) |
tdf#134298 sw: layout: remove left-over page frame without content
Once tdf#138039 is fixed, this bugdoc has an additional empty page 3.
This is because it first goes to 3 pages, and then the SwTextFrame
on page does a MoveBwd, leaving behind a page frame with just a body
frame and nothing else.
It turns out that SwRootFrame::RemoveSuperfluous() only removes
empty frames at the end of the document, but here there's a non-empty
frame following it. Also, this function doesn't handle cases like
right/left page styles so it can't delete pages in the middle.
SwFrame::CheckPageDescs() doesn't remove page frames that don't have
content, it only removes those that have the intentionally-empty flag set.
Extend CheckPageDescs() to also remove page frames that don't have
content, and make sure it is called when SwContentFrame::Cut()
removes the last content from a page frame (it will be called after
all pages are valid in SwLayAction::InternalAction()).
(Alternatively it might be possible to prevent the problem from
occurring in SwTextFly::ForEach() by ignoring the fly so that the first
paragraph never leaves page 1, but we didn't explore that.)
Change-Id: I3a3f1efe6d7ed28e05dc159a86abc3d702cc272b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105810
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sax')
0 files changed, 0 insertions, 0 deletions