diff options
author | dsinclair <dsinclair@chromium.org> | 2016-05-26 08:41:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-26 08:41:45 -0700 |
commit | dd6a46c7eddc31d29b2d2630378c52c25363ce59 (patch) | |
tree | 8de9ff2f47bf3130eb5eee7fb39eff4251b3d90b /xfa/fxfa/parser | |
parent | 25fa42f398d1f8007aa36531e0436dc769817ad3 (diff) | |
download | pdfium-dd6a46c7eddc31d29b2d2630378c52c25363ce59.tar.xz |
Revert of Remove parameters which are always null (patchset #1 id:1 of https://codereview.chromium.org/2009413002/ )
Reason for revert:
Suspect that the lack of this parameter being
passed accurately to GetObject is leading to
https://bugs.chromium.org/p/chromium/issues/detail?id=613607, and that the right
fix will be to pass it.
Original issue's description:
> Remove parameters which are always null
>
> These parameters are never set, remove them and their supporting code.
>
> Committed: https://pdfium.googlesource.com/pdfium/+/818e1900a3811e1bde1e594e4966db612f845966
TBR=tsepez@chromium.org,thestig@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/2014863002
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/xfa_script.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_script_imp.cpp | 23 |
3 files changed, 17 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/xfa_script.h b/xfa/fxfa/parser/xfa_script.h index d6085411b3..04cc5b9a69 100644 --- a/xfa/fxfa/parser/xfa_script.h +++ b/xfa/fxfa/parser/xfa_script.h @@ -45,7 +45,7 @@ class CXFA_HVALUEArray : public CFX_ArrayTemplate<FXJSE_HVALUE> { } void GetAttributeObject(CXFA_ObjArray& objArray) { for (int32_t i = 0; i < GetSize(); i++) { - CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(GetAt(i)); + CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(GetAt(i), NULL); objArray.Add(pObject); } } diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp index a3b686bb56..94fa8db96c 100644 --- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp @@ -310,7 +310,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList( if (iLength >= 1) { FXJSE_HVALUE hValue = pArguments->GetValue(0); if (FXJSE_Value_IsObject(hValue)) { - pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(hValue)); + pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(hValue, nullptr)); } else if (FXJSE_Value_IsUTF8String(hValue)) { CFX_ByteString bsString; FXJSE_Value_ToUTF8String(hValue, bsString); @@ -511,7 +511,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus( if (iLength >= 1) { FXJSE_HVALUE hValue = pArguments->GetValue(0); if (FXJSE_Value_IsObject(hValue)) { - pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(hValue)); + pNode = static_cast<CXFA_Node*>(FXJSE_Value_ToObject(hValue, NULL)); } else if (FXJSE_Value_IsUTF8String(hValue)) { CFX_ByteString bsString; FXJSE_Value_ToUTF8String(hValue, bsString); diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index fe3a3e0a94..50810305e4 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -101,7 +101,8 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hValue) { - CXFA_Object* lpOrginalNode = (CXFA_Object*)FXJSE_Value_ToObject(hObject); + CXFA_Object* lpOrginalNode = + (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); CXFA_Document* pDoc = lpOrginalNode->GetDocument(); CXFA_ScriptContext* lpScriptContext = (CXFA_ScriptContext*)pDoc->GetScriptContext(); @@ -158,7 +159,8 @@ FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hValue) { - CXFA_Object* pOrginalObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject); + CXFA_Object* pOrginalObject = + (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); CXFA_Document* pDoc = pOrginalObject->GetDocument(); CXFA_ScriptContext* lpScriptContext = (CXFA_ScriptContext*)pDoc->GetScriptContext(); @@ -212,7 +214,8 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject, void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hValue) { - CXFA_Object* pOrginalObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject); + CXFA_Object* pOrginalObject = + (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); if (pOrginalObject == NULL) { FXJSE_Value_SetUndefined(hValue); return; @@ -257,7 +260,8 @@ void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject, void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FXJSE_HVALUE hValue) { - CXFA_Object* pOrginalObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject); + CXFA_Object* pOrginalObject = + (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); if (pOrginalObject == NULL) { return; } @@ -308,7 +312,7 @@ int32_t CXFA_ScriptContext::NormalPropTypeGetter( FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FX_BOOL bQueryIn) { - CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject); + CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); if (pObject == NULL) { return FXJSE_ClassPropType_None; } @@ -330,7 +334,7 @@ int32_t CXFA_ScriptContext::GlobalPropTypeGetter( FXJSE_HOBJECT hObject, const CFX_ByteStringC& szPropName, FX_BOOL bQueryIn) { - CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject); + CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); if (pObject == NULL) { return FXJSE_ClassPropType_None; } @@ -347,7 +351,7 @@ int32_t CXFA_ScriptContext::GlobalPropTypeGetter( void CXFA_ScriptContext::NormalMethodCall(FXJSE_HOBJECT hThis, const CFX_ByteStringC& szFuncName, CFXJSE_Arguments& args) { - CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hThis); + CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hThis, NULL); if (pObject == NULL) { return; } @@ -509,7 +513,7 @@ void CXFA_ScriptContext::ReleaseVariablesMap() { FXJSE_HCONTEXT hVariableContext = nullptr; m_mapVariableToHValue.GetNextAssoc(ps, pScriptNode, hVariableContext); FXJSE_HVALUE hObject = FXJSE_Context_GetGlobalObject(hVariableContext); - delete static_cast<CXFA_ThisProxy*>(FXJSE_Value_ToObject(hObject)); + delete static_cast<CXFA_ThisProxy*>(FXJSE_Value_ToObject(hObject, nullptr)); FXJSE_Value_Release(hObject); FXJSE_Context_Release(hVariableContext); } @@ -643,7 +647,8 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, (rndFind.m_Nodes[0]->*(rndFind.m_pScriptAttribute->lpfnCallback))( hValue, FALSE, (XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute); - rndFind.m_Nodes.SetAt(0, (CXFA_Object*)FXJSE_Value_ToObject(hValue)); + rndFind.m_Nodes.SetAt(0, + (CXFA_Object*)FXJSE_Value_ToObject(hValue, NULL)); FXJSE_Value_Release(hValue); } int32_t iSize = m_upObjectArray.GetSize(); |