summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-09-17 18:13:37 -0700
committerLei Zhang <thestig@chromium.org>2015-09-17 18:13:37 -0700
commit880f927216c2f0666f69155da0ffc732747fafb8 (patch)
treeec3b6dc3ae6d20e07f1d698499af812089bafaf3
parent035407c7aa8b559538e94d72394a462aa71e53f9 (diff)
downloadpdfium-880f927216c2f0666f69155da0ffc732747fafb8.tar.xz
Merge to M45: Resolve bad cast to CJS_EventHandler
At line 2026 in pdfsdk/src/javascript/PublicMethods.cpp, the writer wants to perform type cast like line 2027 but he made a mistake to make type conversion on m_pValue. Even at line 2027, it's redundant to make type conversion. The returned type of pContext->GetEventHandler() is CJS_EventHandler*. BUG=529310 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1325753007 . (cherry picked from commit 4ea0e6b972b0c6f6c9ad3f45a66a733d8dc3ca96) Review URL: https://codereview.chromium.org/1352123002 .
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index a615d4409b..858386a1c5 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -2162,8 +2162,8 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param
dValue = (double)floor(dValue * FXSYS_pow((double)10,(double)6) + 0.49) / FXSYS_pow((double)10,(double)6);
CJS_Value jsValue(isolate,dValue);
- if((CJS_EventHandler*)pContext->GetEventHandler()->m_pValue)
- ((CJS_EventHandler*)pContext->GetEventHandler())->Value() = jsValue.ToCFXWideString();
+ if(pContext->GetEventHandler()->m_pValue)
+ pContext->GetEventHandler()->Value() = jsValue.ToCFXWideString();
return TRUE;
}