From 2a0eb92258a60c9e96978db7351c4ef86c8f0136 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 30 Oct 1999 21:36:48 +0000 Subject: [PATCH] fixed bug that caused assertion failure during HTML printing under wxGTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/html/htmprint.h | 2 +- src/html/htmprint.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/html/htmprint.h b/include/wx/html/htmprint.h index 362bb5a9a5..e7d6dc59e8 100644 --- a/include/wx/html/htmprint.h +++ b/include/wx/html/htmprint.h @@ -138,7 +138,7 @@ class WXDLLEXPORT wxHtmlPrintout : public wxPrintout bool OnPrintPage(int page); bool HasPage(int page); void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); - void OnBeginPrinting(); + bool OnBeginDocument(int startPage, int endPage); private: diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index 5863e4bd88..85614f0928 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -1,3 +1,4 @@ + ///////////////////////////////////////////////////////////////////////////// // Name: htmprint.cpp // Purpose: html printing classes @@ -183,12 +184,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 +228,7 @@ void wxHtmlPrintout::OnBeginPrinting() ); m_Renderer -> SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir); CountPages(); + return TRUE; } -- 2.45.2