Only use wxDateTime in wxRichTextPrintout::SubstituteKeywords() if available.
Don't expand date and time fields if wxUSE_DATETIME==0. See #16939.
This commit is contained in:
committed by
Vadim Zeitlin
parent
a679d0440c
commit
119e67d959
@@ -427,10 +427,15 @@ bool wxRichTextPrintout::SubstituteKeywords(wxString& str, const wxString& title
|
||||
num.Printf(wxT("%lu"), (unsigned long) pageCount);
|
||||
str.Replace(wxT("@PAGESCNT@"), num);
|
||||
|
||||
#if wxUSE_DATETIME
|
||||
wxDateTime now = wxDateTime::Now();
|
||||
|
||||
str.Replace(wxT("@DATE@"), now.FormatDate());
|
||||
str.Replace(wxT("@TIME@"), now.FormatTime());
|
||||
#else
|
||||
str.Replace(wxT("@DATE@"), wxEmptyString);
|
||||
str.Replace(wxT("@TIME@"), wxEmptyString);
|
||||
#endif
|
||||
|
||||
str.Replace(wxT("@TITLE@"), title);
|
||||
|
||||
|
Reference in New Issue
Block a user