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

Unified Diff: xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp

Issue 2026993003: Remove FXJSE_Value_ToObject and call methods directly (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@context_cleanup_3
Patch Set: Created 4 years, 7 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 | « xfa/fxfa/parser/xfa_script.h ('k') | xfa/fxfa/parser/xfa_script_imp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
index 3b5f681a0f5820fb76b8682179a03b093fcd7455..3adabe6a6ed63b48d72b00e71cdebaf223de08ee 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -19,6 +19,14 @@
#include "xfa/fxfa/parser/xfa_utils.h"
#include "xfa/fxjse/cfxjse_arguments.h"
+namespace {
+
+CXFA_Node* ToNode(CFXJSE_Value* pValue, CFXJSE_Class* pClass) {
+ return static_cast<CXFA_Node*>(pValue->ToHostObject(pClass));
+}
+
+} // namespace
+
CScript_HostPseudoModel::CScript_HostPseudoModel(CXFA_Document* pDocument)
: CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_HostPseudoModel) {
m_uScriptHash = XFA_HASHCODE_Host;
@@ -309,8 +317,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
if (iLength >= 1) {
std::unique_ptr<CFXJSE_Value> pValue(pArguments->GetValue(0));
if (FXJSE_Value_IsObject(pValue.get())) {
- pNode =
- static_cast<CXFA_Node*>(FXJSE_Value_ToObject(pValue.get(), nullptr));
+ pNode = ToNode(pValue.get(), nullptr);
} else if (FXJSE_Value_IsUTF8String(pValue.get())) {
CFX_ByteString bsString;
FXJSE_Value_ToUTF8String(pValue.get(), bsString);
@@ -507,8 +514,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
if (iLength >= 1) {
std::unique_ptr<CFXJSE_Value> pValue(pArguments->GetValue(0));
if (FXJSE_Value_IsObject(pValue.get())) {
- pNode =
- static_cast<CXFA_Node*>(FXJSE_Value_ToObject(pValue.get(), nullptr));
+ pNode = ToNode(pValue.get(), nullptr);
} else if (FXJSE_Value_IsUTF8String(pValue.get())) {
CFX_ByteString bsString;
FXJSE_Value_ToUTF8String(pValue.get(), bsString);
« no previous file with comments | « xfa/fxfa/parser/xfa_script.h ('k') | xfa/fxfa/parser/xfa_script_imp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698