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:
@@ -157,9 +157,7 @@ wxHtmlCell::GetMouseCursorAt(wxHtmlWindowInterface *window,
|
||||
|
||||
|
||||
bool
|
||||
wxHtmlCell::AdjustPagebreak(int *pagebreak,
|
||||
const wxArrayInt& WXUNUSED(known_pagebreaks),
|
||||
int pageHeight) const
|
||||
wxHtmlCell::AdjustPagebreak(int *pagebreak, int pageHeight) const
|
||||
{
|
||||
// Notice that we always break the cells bigger than the page height here
|
||||
// as otherwise we wouldn't be able to break them at all.
|
||||
@@ -697,19 +695,17 @@ int wxHtmlContainerCell::GetIndentUnits(int ind) const
|
||||
|
||||
|
||||
bool
|
||||
wxHtmlContainerCell::AdjustPagebreak(int *pagebreak,
|
||||
const wxArrayInt& known_pagebreaks,
|
||||
int pageHeight) const
|
||||
wxHtmlContainerCell::AdjustPagebreak(int *pagebreak, int pageHeight) const
|
||||
{
|
||||
if (!m_CanLiveOnPagebreak)
|
||||
return wxHtmlCell::AdjustPagebreak(pagebreak, known_pagebreaks, pageHeight);
|
||||
return wxHtmlCell::AdjustPagebreak(pagebreak, pageHeight);
|
||||
|
||||
bool rt = false;
|
||||
int pbrk = *pagebreak - m_PosY;
|
||||
|
||||
for ( wxHtmlCell *c = GetFirstChild(); c; c = c->GetNext() )
|
||||
{
|
||||
if (c->AdjustPagebreak(&pbrk, known_pagebreaks, pageHeight))
|
||||
if (c->AdjustPagebreak(&pbrk, pageHeight))
|
||||
rt = true;
|
||||
}
|
||||
if (rt)
|
||||
|
Reference in New Issue
Block a user