From 119e67d9596cac4feb9750f20991c36b95449001 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 5 Apr 2015 10:16:42 +0200 Subject: [PATCH] Only use wxDateTime in wxRichTextPrintout::SubstituteKeywords() if available. Don't expand date and time fields if wxUSE_DATETIME==0. See #16939. --- src/richtext/richtextprint.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/richtext/richtextprint.cpp b/src/richtext/richtextprint.cpp index 837d3b0c58..926f1bc296 100644 --- a/src/richtext/richtextprint.cpp +++ b/src/richtext/richtextprint.cpp @@ -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);