https://bugs.documentfoundation.org/show_bug.cgi?id=145743

--- Comment #6 from Telesto <[email protected]> ---
Created attachment 180309
  --> https://bugs.documentfoundation.org/attachment.cgi?id=180309&action=edit
Bibisect log

Bibisected to:
author  Michael Stahl <[email protected]>    2020-11-13 20:52:28 +0100
committer       Michael Stahl <[email protected]>    2020-11-16 16:51:19
+0100
commit  b9ef71476fd70bc13f50ebe80390e0730d1b7afb (patch)
tree    de2c044f51addf5a7ccc32f0d3289db919d5b19e
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.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to