diff --git a/include/wx/html/htmprint.h b/include/wx/html/htmprint.h
index a455dec747..3c0d12f6ab 100644
--- a/include/wx/html/htmprint.h
+++ b/include/wx/html/htmprint.h
@@ -184,11 +184,10 @@ private:
wxString TranslateHeader(const wxString& instr, int page);
// substitute @PAGENUM@ and @PAGESCNT@ by real values
void CountPages();
- // counts pages and fills m_NumPages and m_PageBreaks
+ // fills m_PageBreaks, which indirectly gives the number of pages
private:
- int m_NumPages;
wxVector m_PageBreaks;
wxString m_Document, m_BasePath;
diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp
index 3b03b2e67c..781c9f4d98 100644
--- a/src/html/htmprint.cpp
+++ b/src/html/htmprint.cpp
@@ -199,7 +199,6 @@ wxVector wxHtmlPrintout::m_Filters;
wxHtmlPrintout::wxHtmlPrintout(const wxString& title) : wxPrintout(title)
{
- m_NumPages = INT_MAX;
m_BasePathIsDir = true;
m_HeaderHeight = m_FooterHeight = 0;
SetMargins(); // to default values
@@ -391,8 +390,8 @@ bool wxHtmlPrintout::OnPrintPage(int page)
void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
{
*minPage = 1;
- if ( m_NumPages >= (signed)m_PageBreaks.size()-1)
- *maxPage = m_NumPages;
+ if ( m_PageBreaks.empty() )
+ *maxPage = INT_MAX;
else
*maxPage = (signed)m_PageBreaks.size()-1;
*selPageFrom = 1;
@@ -479,8 +478,6 @@ void wxHtmlPrintout::CountPages()
{
wxBusyCursor wait;
- m_NumPages = 0;
-
m_PageBreaks.clear();
for ( int pos = 0; pos != wxNOT_FOUND; )