Only use wxDateTime in wxHtmlPrintout::TranslateHeader() if available.

Code using wxDateTime when preparing header should be active only if
wxUSE_DATETIME==1.

See #16939.
This commit is contained in:
Artur Wieczorek
2015-04-05 09:50:38 +02:00
committed by Vadim Zeitlin
parent 07d43d96aa
commit 0091246427

View File

@@ -568,9 +568,14 @@ wxString wxHtmlPrintout::TranslateHeader(const wxString& instr, int page)
num.Printf(wxT("%lu"), (unsigned long)(m_PageBreaks.GetCount() - 1));
r.Replace(wxT("@PAGESCNT@"), num);
#if wxUSE_DATETIME
const wxDateTime now = wxDateTime::Now();
r.Replace(wxT("@DATE@"), now.FormatDate());
r.Replace(wxT("@TIME@"), now.FormatTime());
#else
r.Replace(wxT("@DATE@"), wxEmptyString);
r.Replace(wxT("@TIME@"), wxEmptyString);
#endif
r.Replace(wxT("@TITLE@"), GetTitle());