summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt
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/fgas/crt
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/fgas/crt')
-rw-r--r--xfa/fgas/crt/cfgas_formatstring.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/xfa/fgas/crt/cfgas_formatstring.cpp b/xfa/fgas/crt/cfgas_formatstring.cpp
index 87b07691a4..eaac969fd8 100644
--- a/xfa/fgas/crt/cfgas_formatstring.cpp
+++ b/xfa/fgas/crt/cfgas_formatstring.cpp
@@ -554,9 +554,8 @@ uint16_t GetWeekOfYear(uint16_t year, uint16_t month, uint16_t day) {
}
WideString NumToString(size_t fmt_size, int32_t value) {
- WideString str;
- str.Format(fmt_size == 1 ? L"%d" : fmt_size == 2 ? L"%02d" : L"%03d", value);
- return str;
+ return WideString::Format(
+ fmt_size == 1 ? L"%d" : fmt_size == 2 ? L"%02d" : L"%03d", value);
}
WideString DateFormat(const WideString& wsDatePattern,
@@ -684,10 +683,8 @@ WideString TimeFormat(const WideString& wsTimePattern,
FX_TIMEZONE tz = pLocale->GetTimeZone();
if (tz.tzHour != 0 || tz.tzMinute != 0) {
wsResult += tz.tzHour < 0 ? L"-" : L"+";
-
- WideString wsTimezone;
- wsTimezone.Format(L"%02d:%02d", abs(tz.tzHour), tz.tzMinute);
- wsResult += wsTimezone;
+ wsResult +=
+ WideString::Format(L"%02d:%02d", abs(tz.tzHour), tz.tzMinute);
}
}
}
@@ -2006,9 +2003,7 @@ bool CFGAS_FormatString::FormatStrNum(const WideStringView& wsInputNum,
ccf--;
break;
case 'E': {
- WideString wsExp;
- wsExp.Format(L"E%+d", exponent);
- *wsOutput = wsExp + *wsOutput;
+ *wsOutput = WideString::Format(L"E%+d", exponent) + *wsOutput;
ccf--;
break;
}
@@ -2164,9 +2159,7 @@ bool CFGAS_FormatString::FormatStrNum(const WideStringView& wsInputNum,
ccf++;
break;
case 'E': {
- WideString wsExp;
- wsExp.Format(L"E%+d", exponent);
- *wsOutput += wsExp;
+ *wsOutput += WideString::Format(L"E%+d", exponent);
ccf++;
break;
}