Remove "known_pagebreaks" from wxHtmlCell::AdjustPagebreak()

This parameter is not actually needed for any reasonable page breaking
algorithm, as it shouldn't care about any previous page breaks except
for the last one, which is already known as "*pagebreak - pageHeight" in
this function.

Removing it will allow to stop using wxArrayInt in the code using this
method and switch to an std::vector<int> instead.

This is not a backwards compatible change, but it seems that there is
very little code actually overriding this function (none could be found
in any open source repositories) and updating it should be as simple as
removing the now unneeded argument.
This commit is contained in:
Vadim Zeitlin
2018-05-24 18:05:58 +02:00
parent c58d81d32d
commit b9b6ccb804
7 changed files with 44 additions and 45 deletions

View File

@@ -187,28 +187,31 @@ public:
wxHtmlCell();
/**
This method is used to adjust pagebreak position.
The first parameter is a variable that contains the y-coordinate of the page break
(= horizontal line that should not be crossed by words, images etc.).
If this cell cannot be divided into two pieces (each one on another page)
then it either moves the pagebreak a few pixels up, if possible, or, if
the cell cannot fit on the page at all, then the cell is forced to
split unconditionally.
This method is called when paginating HTML, e.g.\ when printing.
Returns @true if pagebreak was modified, @false otherwise.
User code should never call this function, but may need to override it
in custom HTML cell classes with any specific page breaking
requirements.
On input, @a pagebreak contains y-coordinate of page break (i.e. the
horizontal line that should not be crossed by words, images etc.)
relative to the parent cell on entry and may be modified to request a
page break at a position before it if this cell cannot be divided into
two pieces (each one on its own page).
Note that page break must still happen on the current page, i.e. the
returned value must be strictly greater than @code *pagebreak -
pageHeight @endcode and less or equal to @c *pagebreak for the value of
@a pagebreak on input.
@param pagebreak
position in pixels of the pagebreak.
@param known_pagebreaks
the list of the previous pagebreaks
@param pageHeight
the height in pixels of the page drawable area
@return @true if pagebreak was modified, @false otherwise.
*/
virtual bool AdjustPagebreak(int* pagebreak,
const wxArrayInt& known_pagebreaks,
int pageHeight) const;
virtual bool AdjustPagebreak(int* pagebreak, int pageHeight) const;
/**
Renders the cell.