summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_localevalue.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-16 21:45:18 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-16 21:45:18 +0000
commit3f1c832dda209cf6682bb75316c07d71332fe6c3 (patch)
tree79e274e65a500bc7964fe4328a6185c805274640 /xfa/fxfa/parser/cxfa_localevalue.cpp
parent40d522134a11867adb95f77c0b7891932e0739a2 (diff)
downloadpdfium-3f1c832dda209cf6682bb75316c07d71332fe6c3.tar.xz
Make WideString::{Format|FormatV} static
This CL moves the Format and FormatV methods from WideString to be static. Bug: pdfium:934 Change-Id: I9941d6a2a5bbf0a82087cd0ea5d0f8fc42eecd3e Reviewed-on: https://pdfium-review.googlesource.com/18630 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_localevalue.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_localevalue.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp
index 109254fe2c..09e3577887 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.cpp
+++ b/xfa/fxfa/parser/cxfa_localevalue.cpp
@@ -292,32 +292,27 @@ CFX_DateTime CXFA_LocaleValue::GetTime() const {
bool CXFA_LocaleValue::SetDate(const CFX_DateTime& d) {
m_dwType = XFA_VT_DATE;
- m_wsValue.Format(L"%04d-%02d-%02d", d.GetYear(), d.GetMonth(), d.GetDay());
+ m_wsValue = WideString::Format(L"%04d-%02d-%02d", d.GetYear(), d.GetMonth(),
+ d.GetDay());
return true;
}
bool CXFA_LocaleValue::SetTime(const CFX_DateTime& t) {
m_dwType = XFA_VT_TIME;
- m_wsValue.Format(L"%02d:%02d:%02d", t.GetHour(), t.GetMinute(),
- t.GetSecond());
- if (t.GetMillisecond() > 0) {
- WideString wsTemp;
- wsTemp.Format(L"%:03d", t.GetMillisecond());
- m_wsValue += wsTemp;
- }
+ m_wsValue = WideString::Format(L"%02d:%02d:%02d", t.GetHour(), t.GetMinute(),
+ t.GetSecond());
+ if (t.GetMillisecond() > 0)
+ m_wsValue += WideString::Format(L"%:03d", t.GetMillisecond());
return true;
}
bool CXFA_LocaleValue::SetDateTime(const CFX_DateTime& dt) {
m_dwType = XFA_VT_DATETIME;
- m_wsValue.Format(L"%04d-%02d-%02dT%02d:%02d:%02d", dt.GetYear(),
- dt.GetMonth(), dt.GetDay(), dt.GetHour(), dt.GetMinute(),
- dt.GetSecond());
- if (dt.GetMillisecond() > 0) {
- WideString wsTemp;
- wsTemp.Format(L"%:03d", dt.GetMillisecond());
- m_wsValue += wsTemp;
- }
+ m_wsValue = WideString::Format(L"%04d-%02d-%02dT%02d:%02d:%02d", dt.GetYear(),
+ dt.GetMonth(), dt.GetDay(), dt.GetHour(),
+ dt.GetMinute(), dt.GetSecond());
+ if (dt.GetMillisecond() > 0)
+ m_wsValue += WideString::Format(L"%:03d", dt.GetMillisecond());
return true;
}