From 06305f5d71c779a3fa2cd514ec34ee443bd0e5f9 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 29 Oct 2018 22:33:15 +0000 Subject: 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 Commit-Queue: Tom Sepez --- fxjs/cjs_publicmethods.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'fxjs/cjs_publicmethods.cpp') 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()); -- cgit v1.2.3