summaryrefslogtreecommitdiff
path: root/fxjs/cjs_publicmethods.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-29 23:44:56 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-29 23:44:56 +0000
commit05e43638cd377444b88def5c02562e771e25a158 (patch)
treee507e4387be96b58cff4f033e376651be5156506 /fxjs/cjs_publicmethods.cpp
parent06305f5d71c779a3fa2cd514ec34ee443bd0e5f9 (diff)
downloadpdfium-master.tar.xz
Rename two more CJS_PublicMethods methods.HEADmaster
Mark method table as private. Change-Id: I300c3ce2229a16b01e43d8b9057e47a69125bc95 Reviewed-on: https://pdfium-review.googlesource.com/c/44831 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_publicmethods.cpp')
-rw-r--r--fxjs/cjs_publicmethods.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp
index 4ccd00d554..10ddf2254b 100644
--- a/fxjs/cjs_publicmethods.cpp
+++ b/fxjs/cjs_publicmethods.cpp
@@ -412,8 +412,8 @@ WideString CJS_PublicMethods::ParseStringString(const WideString& str,
return swRet;
}
-double CJS_PublicMethods::ParseNormalDate(const WideString& value,
- bool* bWrongFormat) {
+double CJS_PublicMethods::ParseDate(const WideString& value,
+ bool* bWrongFormat) {
double dt = JS_GetDateTime();
int nYear = JS_GetYearFromTime(dt);
@@ -736,7 +736,7 @@ double CJS_PublicMethods::ParseDateUsingFormat(const WideString& value,
double dRet;
if (bBadFormat) {
- dRet = ParseNormalDate(value, &bBadFormat);
+ dRet = ParseDate(value, &bBadFormat);
} else {
dRet = JS_MakeDate(JS_MakeDay(nYear, nMonth - 1, nDay),
JS_MakeTime(nHour, nMin, nSec, 0));
@@ -745,7 +745,7 @@ double CJS_PublicMethods::ParseDateUsingFormat(const WideString& value,
}
if (std::isnan(dRet))
- dRet = ParseNormalDate(value, &bBadFormat);
+ dRet = ParseDate(value, &bBadFormat);
if (bWrongFormat)
*bWrongFormat = bBadFormat;
@@ -1191,9 +1191,8 @@ CJS_Result CJS_PublicMethods::AFDate_FormatEx(
WideString sFormat = pRuntime->ToWideString(params[0]);
double dDate;
if (strValue.Contains(L"GMT")) {
- // for GMT format time
- // such as "Tue Aug 11 14:24:16 GMT+08002009"
- dDate = MakeInterDate(strValue);
+ // e.g. "Tue Aug 11 14:24:16 GMT+08002009"
+ dDate = ParseDateAsGMT(strValue);
} else {
dDate = ParseDateUsingFormat(strValue, sFormat, nullptr);
}
@@ -1209,7 +1208,7 @@ CJS_Result CJS_PublicMethods::AFDate_FormatEx(
return CJS_Result::Success();
}
-double CJS_PublicMethods::MakeInterDate(const WideString& strValue) {
+double CJS_PublicMethods::ParseDateAsGMT(const WideString& strValue) {
std::vector<WideString> wsArray;
WideString sTemp;
for (const auto& c : strValue) {