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

Unified Diff: fpdfsdk/javascript/util.cpp

Issue 2319543003: Remove unused context parameter from JSGetStringFromID (Closed)
Patch Set: rebase Created 4 years, 3 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/resource.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/util.cpp
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp
index fa53a9e2230188619805a2eba3b2d07a6e831df7..44511f591f89c9bd16ae6d1a7f372fa8d27134d9 100644
--- a/fpdfsdk/javascript/util.cpp
+++ b/fpdfsdk/javascript/util.cpp
@@ -190,12 +190,12 @@ FX_BOOL util::printd(IJS_Context* cc,
CJS_Value p2 = params[1];
CJS_Date jsDate;
if (!p2.ConvertToDate(pRuntime, jsDate)) {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1);
+ sError = JSGetStringFromID(IDS_STRING_JSPRINT1);
return FALSE;
}
if (!jsDate.IsValidDate(pRuntime)) {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT2);
+ sError = JSGetStringFromID(IDS_STRING_JSPRINT2);
return FALSE;
}
@@ -223,7 +223,7 @@ FX_BOOL util::printd(IJS_Context* cc,
jsDate.GetSeconds(pRuntime));
break;
default:
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSVALUEERROR);
+ sError = JSGetStringFromID(IDS_STRING_JSVALUEERROR);
return FALSE;
}
@@ -233,7 +233,7 @@ FX_BOOL util::printd(IJS_Context* cc,
if (p1.GetType() == CJS_Value::VT_string) {
if (iSize > 2 && params[2].ToBool(pRuntime)) {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_NOTSUPPORT);
+ sError = JSGetStringFromID(IDS_STRING_JSNOTSUPPORT);
return FALSE; // currently, it doesn't support XFAPicture.
}
@@ -303,7 +303,7 @@ FX_BOOL util::printd(IJS_Context* cc,
return TRUE;
}
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSTYPEERROR);
+ sError = JSGetStringFromID(IDS_STRING_JSTYPEERROR);
return FALSE;
}
@@ -312,13 +312,12 @@ FX_BOOL util::printx(IJS_Context* cc,
const std::vector<CJS_Value>& params,
CJS_Value& vRet,
CFX_WideString& sError) {
- CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
-
if (params.size() < 2) {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
+ sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
return FALSE;
}
+ CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
vRet = CJS_Value(pRuntime, printx(params[0].ToCFXWideString(pRuntime),
params[1].ToCFXWideString(pRuntime))
.c_str());
@@ -456,17 +455,15 @@ FX_BOOL util::byteToChar(IJS_Context* cc,
const std::vector<CJS_Value>& params,
CJS_Value& vRet,
CFX_WideString& sError) {
- CJS_Context* pContext = static_cast<CJS_Context*>(cc);
- CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
-
if (params.size() < 1) {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
return FALSE;
}
+ CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
int arg = params[0].ToInt(pRuntime);
if (arg < 0 || arg > 255) {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR);
+ sError = JSGetStringFromID(IDS_STRING_JSVALUEERROR);
return FALSE;
}
« no previous file with comments | « fpdfsdk/javascript/resource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698