summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/cfgas_formatstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/crt/cfgas_formatstring.cpp')
-rw-r--r--xfa/fgas/crt/cfgas_formatstring.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fgas/crt/cfgas_formatstring.cpp b/xfa/fgas/crt/cfgas_formatstring.cpp
index 0162100949..e9d065d124 100644
--- a/xfa/fgas/crt/cfgas_formatstring.cpp
+++ b/xfa/fgas/crt/cfgas_formatstring.cpp
@@ -7,6 +7,7 @@
#include "xfa/fgas/crt/cfgas_formatstring.h"
#include <algorithm>
+#include <utility>
#include <vector>
#include "core/fxcrt/cfx_decimal.h"
@@ -1647,11 +1648,11 @@ FX_DATETIMETYPE CFGAS_FormatString::GetDateTimeFormat(
bBraceOpen = false;
if (!wsTempPattern.IsEmpty()) {
if (eCategory == FX_LOCALECATEGORY_Time)
- *wsTimePattern = wsTempPattern;
+ *wsTimePattern = std::move(wsTempPattern);
else if (eCategory == FX_LOCALECATEGORY_Date)
- *wsDatePattern = wsTempPattern;
-
- wsTempPattern.clear();
+ *wsDatePattern = std::move(wsTempPattern);
+ else
+ wsTempPattern.clear();
}
} else {
wsTempPattern += pStr[ccf];
@@ -2246,14 +2247,13 @@ bool CFGAS_FormatString::FormatDateTime(const WideString& wsSrcDateTime,
return false;
if (eCategory == FX_DATETIMETYPE_Unknown) {
- if (eDateTimeType == FX_DATETIMETYPE_Time) {
- wsTimePattern = wsDatePattern;
- wsDatePattern.clear();
- }
+ if (eDateTimeType == FX_DATETIMETYPE_Time)
+ wsTimePattern = std::move(wsDatePattern);
+
eCategory = eDateTimeType;
+ if (eCategory == FX_DATETIMETYPE_Unknown)
+ return false;
}
- if (eCategory == FX_DATETIMETYPE_Unknown)
- return false;
CFX_DateTime dt;
auto iT = wsSrcDateTime.Find(L"T");