summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoxit <jun_fang@foxitsoftware.com>2015-09-10 14:57:54 +0800
committerfoxit <jun_fang@foxitsoftware.com>2015-09-10 15:21:07 +0800
commit8b544ed88d6625d638dfd39dc5be87ce4a059a8d (patch)
tree5c43550a9877e8721591c4810b61ce226a7494a6
parent77aaf96a165272ab52916c04b5ec69e4f2fd13de (diff)
downloadpdfium-8b544ed88d6625d638dfd39dc5be87ce4a059a8d.tar.xz
Merge to XFA: 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 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1325753007 .
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 38de89d894..c1e0cfc609 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -2025,9 +2025,8 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc,
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;
}