/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "htmprint.h"
#endif
void wxHtmlPrintout::CleanUpStatics()
{
- m_Filters.DeleteContents(TRUE);
- m_Filters.Clear();
+ WX_CLEAR_LIST(wxList, m_Filters);
}
// Adds input filter
m_Filters.Append(filter);
}
-bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage)
+void wxHtmlPrintout::OnPreparePrinting()
{
int pageWidth, pageHeight, mm_w, mm_h, scr_w, scr_h, dc_w, dc_h;
float ppmm_h, ppmm_v;
- if (!wxPrintout::OnBeginDocument(startPage, endPage)) return FALSE;
-
GetPageSizePixels(&pageWidth, &pageHeight);
GetPageSizeMM(&mm_w, &mm_h);
ppmm_h = (float)pageWidth / mm_w;
));
m_Renderer->SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir);
CountPages();
+}
+
+bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage)
+{
+ if (!wxPrintout::OnBeginDocument(startPage, endPage)) return FALSE;
+
return TRUE;
}
void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
{
*minPage = 1;
- *maxPage = wxHTML_PRINT_MAX_PAGES;
+ *maxPage = m_NumPages;
*selPageFrom = 1;
- *selPageTo = wxHTML_PRINT_MAX_PAGES;
+ *selPageTo = m_NumPages;
}
wxHtmlFilterHTML defaultFilter;
wxString doc;
- wxNode* node = m_Filters.GetFirst();
+ wxList::compatibility_iterator node = m_Filters.GetFirst();
while (node)
{
wxHtmlFilter *h = (wxHtmlFilter*) node->GetData();
int ppiPrinterX, ppiPrinterY;
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
+ wxUnusedVar(ppiPrinterX);
int ppiScreenX, ppiScreenY;
GetPPIScreen(&ppiScreenX, &ppiScreenY);
+ wxUnusedVar(ppiScreenX);
dc->SetUserScale((double)dc_w / (double)pageWidth, (double)dc_w / (double)pageWidth);