X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50073cf24cb27d0a454d522a7e47f8b30926bd12..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/html/htmprint.cpp?ds=sidebyside diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index c8381d4fd4..f7072abf46 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -1,3 +1,4 @@ + ///////////////////////////////////////////////////////////////////////////// // Name: htmprint.cpp // Purpose: html printing classes @@ -106,12 +107,13 @@ void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepat int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render) { - int pbreak; + int pbreak, hght; if (m_Cells == NULL || m_DC == NULL) return 0; pbreak = (int)(from * m_Scale + m_Height); while (m_Cells -> AdjustPagebreak(&pbreak)) {} + hght = pbreak - (int)(from * m_Scale); if (!dont_render) { int w, h; @@ -121,10 +123,10 @@ int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render) m_DC -> SetBrush(*wxWHITE_BRUSH); - m_DC -> SetClippingRegion(x * m_Scale, y * m_Scale, m_Width, m_Height); + m_DC -> SetClippingRegion(x * m_Scale, y * m_Scale, m_Width, hght); m_Cells -> Draw(*m_DC, x * m_Scale, (y - from) * m_Scale, - y * m_Scale, pbreak + (y - from) * m_Scale); + y * m_Scale, pbreak + (y /*- from*/) * m_Scale); m_DC -> DestroyClippingRegion(); } @@ -183,12 +185,12 @@ wxHtmlPrintout::~wxHtmlPrintout() -void wxHtmlPrintout::OnBeginPrinting() +bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage) { int pageWidth, pageHeight, mm_w, mm_h; float ppmm_h, ppmm_v; - wxPrintout::OnBeginPrinting(); + if (!wxPrintout::OnBeginDocument(startPage, endPage)) return FALSE; GetPageSizePixels(&pageWidth, &pageHeight); GetPageSizeMM(&mm_w, &mm_h); @@ -227,6 +229,7 @@ void wxHtmlPrintout::OnBeginPrinting() ); m_Renderer -> SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir); CountPages(); + return TRUE; } @@ -370,11 +373,11 @@ wxString wxHtmlPrintout::TranslateHeader(const wxString& instr, int page) wxString r = instr; wxString num; - num.Printf("%i", page); - r.Replace("@PAGENUM@", num); + num.Printf(wxT("%i"), page); + r.Replace(wxT("@PAGENUM@"), num); - num.Printf("%i", m_NumPages); - r.Replace("@PAGESCNT@", num); + num.Printf(wxT("%i"), m_NumPages); + r.Replace(wxT("@PAGESCNT@"), num); return r; }