]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmprint.cpp
recognize CP866 (bug 1497808)
[wxWidgets.git] / src / html / htmprint.cpp
index 8b957076f13a3a40eab225e1abfb4be964350982..5b33c6e860ddce21bdbf6a759cc871c39d3b6418 100644 (file)
@@ -23,6 +23,7 @@
     #include "wx/dc.h"
     #include "wx/settings.h"
     #include "wx/msgdlg.h"
+    #include "wx/module.h"
 #endif
 
 #include "wx/print.h"
@@ -30,7 +31,6 @@
 #include "wx/html/htmprint.h"
 #include "wx/wxhtml.h"
 #include "wx/wfstream.h"
-#include "wx/module.h"
 
 
 //--------------------------------------------------------------------------------
@@ -276,7 +276,7 @@ void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, i
 
 bool wxHtmlPrintout::HasPage(int pageNum)
 {
-    return (pageNum >= 1 && pageNum-1 <= (signed)m_PageBreaks.Count());
+    return pageNum > 0 && (unsigned)pageNum < m_PageBreaks.Count();
 }
 
 
@@ -443,6 +443,12 @@ wxString wxHtmlPrintout::TranslateHeader(const wxString& instr, int page)
     num.Printf(wxT("%lu"), (unsigned long)(m_PageBreaks.Count() - 1));
     r.Replace(wxT("@PAGESCNT@"), num);
 
+    const wxDateTime now = wxDateTime::Now();
+    r.Replace(wxT("@DATE@"), now.FormatDate());
+    r.Replace(wxT("@TIME@"), now.FormatTime());
+
+    r.Replace(wxT("@TITLE@"), GetTitle());
+
     return r;
 }