diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-29 22:33:15 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-29 22:33:15 +0000 |
commit | 06305f5d71c779a3fa2cd514ec34ee443bd0e5f9 (patch) | |
tree | 98f455769b75c3afc8b4b96d8363feebdcfdcc15 /fxjs/cjs_publicmethods.cpp | |
parent | 2dd06eb37dd9cb31746b1ab7e9ed306b2a12a3b7 (diff) | |
download | pdfium-06305f5d71c779a3fa2cd514ec34ee443bd0e5f9.tar.xz |
Rename CJS_PublicMethods::MakeFormatDate() and MakeRegularDate()
One converts a date into a string, and the other converts a
string into a date, so name them after the parse/print convention.
Change-Id: I35ea375cecc361c48eb3809fc62c77202335f696
Reviewed-on: https://pdfium-review.googlesource.com/c/44830
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.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp index 5fbee0dbdf..4ccd00d554 100644 --- a/fxjs/cjs_publicmethods.cpp +++ b/fxjs/cjs_publicmethods.cpp @@ -490,9 +490,9 @@ double CJS_PublicMethods::ParseNormalDate(const WideString& value, nYear, nHour, nMin, nSec)); } -double CJS_PublicMethods::MakeRegularDate(const WideString& value, - const WideString& format, - bool* bWrongFormat) { +double CJS_PublicMethods::ParseDateUsingFormat(const WideString& value, + const WideString& format, + bool* bWrongFormat) { double dt = JS_GetDateTime(); if (format.IsEmpty() || value.IsEmpty()) @@ -753,8 +753,8 @@ double CJS_PublicMethods::MakeRegularDate(const WideString& value, return dRet; } -WideString CJS_PublicMethods::MakeFormatDate(double dDate, - const WideString& format) { +WideString CJS_PublicMethods::PrintDateUsingFormat(double dDate, + const WideString& format) { WideString sRet; WideString sPart; @@ -1195,7 +1195,7 @@ CJS_Result CJS_PublicMethods::AFDate_FormatEx( // such as "Tue Aug 11 14:24:16 GMT+08002009" dDate = MakeInterDate(strValue); } else { - dDate = MakeRegularDate(strValue, sFormat, nullptr); + dDate = ParseDateUsingFormat(strValue, sFormat, nullptr); } if (std::isnan(dDate)) { @@ -1205,7 +1205,7 @@ CJS_Result CJS_PublicMethods::AFDate_FormatEx( return CJS_Result::Failure(JSMessage::kParseDateError); } - val = MakeFormatDate(dDate, sFormat); + val = PrintDateUsingFormat(dDate, sFormat); return CJS_Result::Success(); } @@ -1268,7 +1268,7 @@ CJS_Result CJS_PublicMethods::AFDate_KeystrokeEx( WideString sFormat = pRuntime->ToWideString(params[0]); bool bWrongFormat = false; - double dRet = MakeRegularDate(strValue, sFormat, &bWrongFormat); + double dRet = ParseDateUsingFormat(strValue, sFormat, &bWrongFormat); if (bWrongFormat || std::isnan(dRet)) { WideString swMsg = WideString::Format( JSGetStringFromID(JSMessage::kParseDateError).c_str(), sFormat.c_str()); @@ -1521,7 +1521,7 @@ CJS_Result CJS_PublicMethods::AFParseDateEx( WideString sValue = pRuntime->ToWideString(params[0]); WideString sFormat = pRuntime->ToWideString(params[1]); - double dDate = MakeRegularDate(sValue, sFormat, nullptr); + double dDate = ParseDateUsingFormat(sValue, sFormat, nullptr); if (std::isnan(dDate)) { WideString swMsg = WideString::Format( JSGetStringFromID(JSMessage::kParseDateError).c_str(), sFormat.c_str()); |