Don't call AdjustPagebreak() in a loop, this seems useless
There doesn't seem to be any reason to call this function more than once on the same cell as the existing implementations are idempotent and it's difficult to see why this should ever not be the case.
This commit is contained in:
@@ -286,7 +286,6 @@ public:
|
|||||||
// few pixels up.
|
// few pixels up.
|
||||||
//
|
//
|
||||||
// Returned value : true if pagebreak was modified, false otherwise
|
// Returned value : true if pagebreak was modified, false otherwise
|
||||||
// Usage : while (container->AdjustPagebreak(&p)) {}
|
|
||||||
virtual bool AdjustPagebreak(int *pagebreak,
|
virtual bool AdjustPagebreak(int *pagebreak,
|
||||||
const wxArrayInt& known_pagebreaks,
|
const wxArrayInt& known_pagebreaks,
|
||||||
int pageHeight) const;
|
int pageHeight) const;
|
||||||
|
@@ -198,19 +198,13 @@ public:
|
|||||||
Returns @true if pagebreak was modified, @false otherwise.
|
Returns @true if pagebreak was modified, @false otherwise.
|
||||||
|
|
||||||
@param pagebreak
|
@param pagebreak
|
||||||
position in pixel of the pagebreak.
|
position in pixels of the pagebreak.
|
||||||
|
|
||||||
@param known_pagebreaks
|
@param known_pagebreaks
|
||||||
the list of the previous pagebreaks
|
the list of the previous pagebreaks
|
||||||
|
|
||||||
@param pageHeight
|
@param pageHeight
|
||||||
the height in pixel of the page drawable area
|
the height in pixels of the page drawable area
|
||||||
|
|
||||||
Usage:
|
|
||||||
@code
|
|
||||||
while (container->AdjustPagebreak(&p, kp, ph)) {}
|
|
||||||
@endcode
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
virtual bool AdjustPagebreak(int* pagebreak,
|
virtual bool AdjustPagebreak(int* pagebreak,
|
||||||
const wxArrayInt& known_pagebreaks,
|
const wxArrayInt& known_pagebreaks,
|
||||||
|
@@ -152,7 +152,7 @@ int wxHtmlDCRenderer::FindNextPageBreak(const wxArrayInt& known_pagebreaks,
|
|||||||
return wxNOT_FOUND;
|
return wxNOT_FOUND;
|
||||||
|
|
||||||
pos += m_Height;
|
pos += m_Height;
|
||||||
while (m_Cells->AdjustPagebreak(&pos, known_pagebreaks, m_Height)) {}
|
m_Cells->AdjustPagebreak(&pos, known_pagebreaks, m_Height);
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user