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:
committed by
Vadim Zeitlin
parent
07d43d96aa
commit
0091246427
@@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user