X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58bd6224acb5b8dce46abbc3f3df7eae346c9859..8c07d8b324d9856c3381433938f9c21a77aa8a5f:/src/html/htmprint.cpp?ds=sidebyside diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index c094e0ead3..b6a1bc636d 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -8,11 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "htmprint.h" -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -94,7 +89,7 @@ void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepat } -void wxHtmlDCRenderer::SetFonts(wxString normal_face, wxString fixed_face, +void wxHtmlDCRenderer::SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes) { m_Parser->SetFonts(normal_face, fixed_face, sizes); @@ -112,7 +107,9 @@ void wxHtmlDCRenderer::SetStandardFonts(int size, } -int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, int to, int *known_pagebreaks, int number_of_pages) +int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, + int maxHeight, + int *known_pagebreaks, int number_of_pages) { int pbreak, hght; @@ -121,9 +118,8 @@ int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, int to, in pbreak = (int)(from + m_Height); while (m_Cells->AdjustPagebreak(&pbreak, known_pagebreaks, number_of_pages)) {} hght = pbreak - from; - if(to < hght) - hght = to; - + if (maxHeight < hght) + hght = maxHeight; if (!dont_render) { @@ -131,10 +127,12 @@ int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, int to, in wxDefaultHtmlRenderingStyle rstyle; rinfo.SetStyle(&rstyle); m_DC->SetBrush(*wxWHITE_BRUSH); + m_DC->SetClippingRegion(x, y, m_Width, hght); m_Cells->Draw(*m_DC, x, (y - from), - y, y + hght, + y, pbreak + (y /*- from*/), rinfo); + m_DC->DestroyClippingRegion(); } if (pbreak < m_Cells->GetHeight()) return pbreak; @@ -454,7 +452,7 @@ void wxHtmlPrintout::SetMargins(float top, float bottom, float left, float right -void wxHtmlPrintout::SetFonts(wxString normal_face, wxString fixed_face, +void wxHtmlPrintout::SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes) { m_Renderer->SetFonts(normal_face, fixed_face, sizes); @@ -630,7 +628,7 @@ void wxHtmlEasyPrinting::SetFooter(const wxString& footer, int pg) } -void wxHtmlEasyPrinting::SetFonts(wxString normal_face, wxString fixed_face, +void wxHtmlEasyPrinting::SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes) { m_fontMode = FontMode_Explicit;