Reset wsDatePattern in CFGAS_StringFormatter::FormatDateTime() after move.
It might be used again following the move, and this avoids a warning.
The code is probably correct given the implementation of the widestring
move-assign operator, but we need not rely on that.
Change-Id: I88328a0172db70b80f1d60770d35d1822987dc74
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/52513
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fgas/crt/cfgas_stringformatter.cpp b/xfa/fgas/crt/cfgas_stringformatter.cpp
index 926f2ec..ab2dde8 100644
--- a/xfa/fgas/crt/cfgas_stringformatter.cpp
+++ b/xfa/fgas/crt/cfgas_stringformatter.cpp
@@ -2186,9 +2186,10 @@
return false;
if (eCategory == FX_DATETIMETYPE_Unknown) {
- if (eDateTimeType == FX_DATETIMETYPE_Time)
+ if (eDateTimeType == FX_DATETIMETYPE_Time) {
wsTimePattern = std::move(wsDatePattern);
-
+ wsDatePattern = WideString();
+ }
eCategory = eDateTimeType;
if (eCategory == FX_DATETIMETYPE_Unknown)
return false;