preparing for HTML printing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -46,6 +46,25 @@ void wxHtmlCell::OnMouseClick(wxWindow *parent, int x, int y,
|
||||
|
||||
|
||||
|
||||
bool wxHtmlCell::AdjustPagebreak(int *pagebreak)
|
||||
{
|
||||
|
||||
if ((!m_CanLiveOnPagebreak) &&
|
||||
m_PosY < *pagebreak && m_PosY + m_Height >= *pagebreak) {
|
||||
*pagebreak = m_PosY;
|
||||
if (m_Next != NULL) m_Next -> AdjustPagebreak(pagebreak);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
else {
|
||||
if (m_Next != NULL) return m_Next -> AdjustPagebreak(pagebreak);
|
||||
else return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxHtmlWordCell
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -59,6 +78,7 @@ wxHtmlWordCell::wxHtmlWordCell(const wxString& word, wxDC& dc) : wxHtmlCell()
|
||||
m_Word.Replace(">", ">", TRUE);
|
||||
m_Word.Replace("&", "&", TRUE);
|
||||
dc.GetTextExtent(m_Word, &m_Width, &m_Height, &m_Descent);
|
||||
SetCanLiveOnPagebreak(FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,6 +149,24 @@ int wxHtmlContainerCell::GetIndentUnits(int ind) const
|
||||
|
||||
|
||||
|
||||
bool wxHtmlContainerCell::AdjustPagebreak(int *pagebreak)
|
||||
{
|
||||
if (!m_CanLiveOnPagebreak)
|
||||
return wxHtmlCell::AdjustPagebreak(pagebreak);
|
||||
else {
|
||||
wxHtmlCell *c = GetFirstCell();
|
||||
bool rt = FALSE;
|
||||
|
||||
while (c) {
|
||||
if (c -> AdjustPagebreak(pagebreak)) rt = TRUE;
|
||||
c = c -> GetNext();
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void wxHtmlContainerCell::Layout(int w)
|
||||
{
|
||||
wxHtmlCell *cell = m_Cells, *line = m_Cells;
|
||||
|
Reference in New Issue
Block a user