Fix infinite loop in wxHtmlEasyPrinting page break code.

The code didn't handle cells higher than the page height correctly and entered
an infinite loop when trying to adjust page breaks in their presence, e.g.
when trying to print a very tall image.

Closes #13935.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70528 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-02-07 13:02:32 +00:00
parent d7235613f4
commit 846f4568e5
6 changed files with 50 additions and 18 deletions

View File

@@ -280,10 +280,13 @@ public:
// Returned value : true if pagebreak was modified, false otherwise
// Usage : while (container->AdjustPagebreak(&p)) {}
virtual bool AdjustPagebreak(int *pagebreak,
const wxArrayInt& known_pagebreaks) const;
const wxArrayInt& known_pagebreaks,
int pageHeight) const;
// Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
// is true - the cell can be split on two pages
// If there is no way to fit a cell in the current page size, the cell
// is always split, ignoring this setting.
void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; }
// Can the line be broken before this cell?
@@ -439,8 +442,10 @@ public:
wxHtmlRenderingInfo& info);
virtual void DrawInvisible(wxDC& dc, int x, int y,
wxHtmlRenderingInfo& info);
/* virtual bool AdjustPagebreak(int *pagebreak, int *known_pagebreaks = NULL, int number_of_pages = 0) const;*/
virtual bool AdjustPagebreak(int *pagebreak, const wxArrayInt& known_pagebreaks) const;
virtual bool AdjustPagebreak(int *pagebreak,
const wxArrayInt& known_pagebreaks,
int pageHeight) const;
// insert cell at the end of m_Cells list
void InsertCell(wxHtmlCell *cell);