Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: fpdfsdk/javascript/PublicMethods.cpp

Issue 1883273003: Pass WideStrings without narrowing to c_str in javascript/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Missed one caller. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/javascript/JS_Value.cpp ('k') | fpdfsdk/javascript/global.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/PublicMethods.cpp
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 9f7b60f70d62665003f3d8108c49b8d973483b53..a84c0935bc96db014cc348389cf0626276be5930 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -306,7 +306,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString& value,
CFX_WideString swTemp;
swTemp.Format(L"%d/%d/%d %d:%d:%d", nMonth, nDay, nYear, nHour, nMin, nSec);
- return JS_DateParse(swTemp.c_str());
+ return JS_DateParse(swTemp);
}
double CJS_PublicMethods::MakeRegularDate(const CFX_WideString& value,
@@ -563,24 +563,21 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString& value,
bBadFormat = true;
double dRet = 0;
-
if (bBadFormat) {
dRet = ParseNormalDate(value, &bBadFormat);
} else {
dRet = JS_MakeDate(JS_MakeDay(nYear, nMonth - 1, nDay),
JS_MakeTime(nHour, nMin, nSec, 0));
-
- if (JS_PortIsNan(dRet)) {
- dRet = JS_DateParse(value.c_str());
- }
+ if (JS_PortIsNan(dRet))
+ dRet = JS_DateParse(value);
}
- if (JS_PortIsNan(dRet)) {
+ if (JS_PortIsNan(dRet))
dRet = ParseNormalDate(value, &bBadFormat);
- }
if (bWrongFormat)
*bWrongFormat = bBadFormat;
+
return dRet;
}
@@ -1204,7 +1201,7 @@ double CJS_PublicMethods::MakeInterDate(const CFX_WideString& strValue) {
double dRet = JS_MakeDate(JS_MakeDay(nYear, nMonth - 1, nDay),
JS_MakeTime(nHour, nMin, nSec, 0));
if (JS_PortIsNan(dRet))
- dRet = JS_DateParse(strValue.c_str());
+ dRet = JS_DateParse(strValue);
return dRet;
}
« no previous file with comments | « fpdfsdk/javascript/JS_Value.cpp ('k') | fpdfsdk/javascript/global.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698