OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/parser/xfa_script_imp.h" | 7 #include "xfa/fxfa/parser/xfa_script_imp.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fxfa/app/xfa_ffnotify.h" | 10 #include "xfa/fxfa/app/xfa_ffnotify.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 if (eScriptType == XFA_SCRIPTLANGTYPE_Formcalc) { | 130 if (eScriptType == XFA_SCRIPTLANGTYPE_Formcalc) { |
131 if (!m_hFM2JSContext) { | 131 if (!m_hFM2JSContext) { |
132 m_hFM2JSContext = | 132 m_hFM2JSContext = |
133 new CXFA_FM2JSContext(m_pIsolate, m_pJsContext, m_pDocument); | 133 new CXFA_FM2JSContext(m_pIsolate, m_pJsContext, m_pDocument); |
134 } | 134 } |
135 CFX_WideTextBuf wsJavaScript; | 135 CFX_WideTextBuf wsJavaScript; |
136 CFX_WideString wsErrorInfo; | 136 CFX_WideString wsErrorInfo; |
137 int32_t iFlags = | 137 int32_t iFlags = |
138 CXFA_FM2JSContext::Translate(wsScript, wsJavaScript, wsErrorInfo); | 138 CXFA_FM2JSContext::Translate(wsScript, wsJavaScript, wsErrorInfo); |
139 if (iFlags) { | 139 if (iFlags) { |
140 FXJSE_Value_SetUndefined(hRetValue); | 140 hRetValue->SetUndefined(); |
141 return FALSE; | 141 return FALSE; |
142 } | 142 } |
143 btScript = | 143 btScript = |
144 FX_UTF8Encode(wsJavaScript.GetBuffer(), wsJavaScript.GetLength()); | 144 FX_UTF8Encode(wsJavaScript.GetBuffer(), wsJavaScript.GetLength()); |
145 } else { | 145 } else { |
146 btScript = FX_UTF8Encode(wsScript.c_str(), wsScript.GetLength()); | 146 btScript = FX_UTF8Encode(wsScript.c_str(), wsScript.GetLength()); |
147 } | 147 } |
148 CXFA_Object* pOriginalObject = m_pThisObject; | 148 CXFA_Object* pOriginalObject = m_pThisObject; |
149 m_pThisObject = pThisObject; | 149 m_pThisObject = pThisObject; |
150 CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : NULL; | 150 CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : NULL; |
(...skipping 17 matching lines...) Expand all Loading... |
168 CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); | 168 CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); |
169 if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { | 169 if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { |
170 pRefNode = ToNode(lpCurNode); | 170 pRefNode = ToNode(lpCurNode); |
171 } | 171 } |
172 if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue, | 172 if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue, |
173 dwFlag, TRUE)) { | 173 dwFlag, TRUE)) { |
174 return; | 174 return; |
175 } | 175 } |
176 if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { | 176 if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { |
177 if (FXJSE_Value_IsUndefined(pValue)) { | 177 if (FXJSE_Value_IsUndefined(pValue)) { |
178 FXJSE_Value_SetObjectOwnProp(pObject, szPropName, pValue); | 178 pObject->SetObjectOwnProperty(szPropName, pValue); |
179 return; | 179 return; |
180 } | 180 } |
181 } | 181 } |
182 CXFA_FFNotify* pNotify = pDoc->GetNotify(); | 182 CXFA_FFNotify* pNotify = pDoc->GetNotify(); |
183 if (!pNotify) { | 183 if (!pNotify) { |
184 return; | 184 return; |
185 } | 185 } |
186 pNotify->GetDocProvider()->SetGlobalProperty(pNotify->GetHDOC(), szPropName, | 186 pNotify->GetDocProvider()->SetGlobalProperty(pNotify->GetHDOC(), szPropName, |
187 pValue); | 187 pValue); |
188 } | 188 } |
189 FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, | 189 FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, |
190 const CFX_WideStringC& propname, | 190 const CFX_WideStringC& propname, |
191 CFXJSE_Value* pValue, | 191 CFXJSE_Value* pValue, |
192 uint32_t dwFlag, | 192 uint32_t dwFlag, |
193 FX_BOOL bSetting) { | 193 FX_BOOL bSetting) { |
194 if (!refNode) | 194 if (!refNode) |
195 return false; | 195 return false; |
196 XFA_RESOLVENODE_RS resolveRs; | 196 XFA_RESOLVENODE_RS resolveRs; |
197 if (ResolveObjects(refNode, propname, resolveRs, dwFlag) <= 0) | 197 if (ResolveObjects(refNode, propname, resolveRs, dwFlag) <= 0) |
198 return false; | 198 return false; |
199 if (resolveRs.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { | 199 if (resolveRs.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { |
200 FXJSE_Value_Set(pValue, GetJSValueFromMap(resolveRs.nodes[0])); | 200 pValue->Assign(GetJSValueFromMap(resolveRs.nodes[0])); |
201 return true; | 201 return true; |
202 } | 202 } |
203 if (resolveRs.dwFlags == XFA_RESOVENODE_RSTYPE_Attribute) { | 203 if (resolveRs.dwFlags == XFA_RESOVENODE_RSTYPE_Attribute) { |
204 const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = resolveRs.pScriptAttribute; | 204 const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = resolveRs.pScriptAttribute; |
205 if (lpAttributeInfo) { | 205 if (lpAttributeInfo) { |
206 (resolveRs.nodes[0]->*(lpAttributeInfo->lpfnCallback))( | 206 (resolveRs.nodes[0]->*(lpAttributeInfo->lpfnCallback))( |
207 pValue, bSetting, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); | 207 pValue, bSetting, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); |
208 } | 208 } |
209 } | 209 } |
210 return true; | 210 return true; |
(...skipping 10 matching lines...) Expand all Loading... |
221 if (szPropName == kFormCalcRuntime) { | 221 if (szPropName == kFormCalcRuntime) { |
222 lpScriptContext->m_hFM2JSContext->GlobalPropertyGetter(pValue); | 222 lpScriptContext->m_hFM2JSContext->GlobalPropertyGetter(pValue); |
223 return; | 223 return; |
224 } | 224 } |
225 XFA_HashCode uHashCode = static_cast<XFA_HashCode>( | 225 XFA_HashCode uHashCode = static_cast<XFA_HashCode>( |
226 FX_HashCode_GetW(wsPropName.AsStringC(), false)); | 226 FX_HashCode_GetW(wsPropName.AsStringC(), false)); |
227 if (uHashCode != XFA_HASHCODE_Layout) { | 227 if (uHashCode != XFA_HASHCODE_Layout) { |
228 CXFA_Object* pObj = | 228 CXFA_Object* pObj = |
229 lpScriptContext->GetDocument()->GetXFAObject(uHashCode); | 229 lpScriptContext->GetDocument()->GetXFAObject(uHashCode); |
230 if (pObj) { | 230 if (pObj) { |
231 FXJSE_Value_Set(pValue, lpScriptContext->GetJSValueFromMap(pObj)); | 231 pValue->Assign(lpScriptContext->GetJSValueFromMap(pObj)); |
232 return; | 232 return; |
233 } | 233 } |
234 } | 234 } |
235 } | 235 } |
236 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | | 236 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | |
237 XFA_RESOLVENODE_Attributes; | 237 XFA_RESOLVENODE_Attributes; |
238 CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); | 238 CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); |
239 if (pOriginalObject->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { | 239 if (pOriginalObject->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { |
240 pRefNode = ToNode(lpCurNode); | 240 pRefNode = ToNode(lpCurNode); |
241 } | 241 } |
(...skipping 18 matching lines...) Expand all Loading... |
260 return; | 260 return; |
261 } | 261 } |
262 pNotify->GetDocProvider()->GetGlobalProperty(pNotify->GetHDOC(), szPropName, | 262 pNotify->GetDocProvider()->GetGlobalProperty(pNotify->GetHDOC(), szPropName, |
263 pValue); | 263 pValue); |
264 } | 264 } |
265 void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue, | 265 void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue, |
266 const CFX_ByteStringC& szPropName, | 266 const CFX_ByteStringC& szPropName, |
267 CFXJSE_Value* pReturnValue) { | 267 CFXJSE_Value* pReturnValue) { |
268 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr); | 268 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr); |
269 if (!pOriginalObject) { | 269 if (!pOriginalObject) { |
270 FXJSE_Value_SetUndefined(pReturnValue); | 270 pReturnValue->SetUndefined(); |
271 return; | 271 return; |
272 } | 272 } |
273 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 273 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
274 CXFA_ScriptContext* lpScriptContext = | 274 CXFA_ScriptContext* lpScriptContext = |
275 pOriginalObject->GetDocument()->GetScriptContext(); | 275 pOriginalObject->GetDocument()->GetScriptContext(); |
276 CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject); | 276 CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject); |
277 if (wsPropName == FX_WSTRC(L"xfa")) { | 277 if (wsPropName == FX_WSTRC(L"xfa")) { |
278 CFXJSE_Value* pValue = lpScriptContext->GetJSValueFromMap( | 278 CFXJSE_Value* pValue = lpScriptContext->GetJSValueFromMap( |
279 lpScriptContext->GetDocument()->GetRoot()); | 279 lpScriptContext->GetDocument()->GetRoot()); |
280 FXJSE_Value_Set(pReturnValue, pValue); | 280 pReturnValue->Assign(pValue); |
281 return; | 281 return; |
282 } | 282 } |
283 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | | 283 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | |
284 XFA_RESOLVENODE_Attributes; | 284 XFA_RESOLVENODE_Attributes; |
285 FX_BOOL bRet = lpScriptContext->QueryNodeByFlag( | 285 FX_BOOL bRet = lpScriptContext->QueryNodeByFlag( |
286 ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE); | 286 ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE); |
287 if (bRet) { | 287 if (bRet) { |
288 return; | 288 return; |
289 } | 289 } |
290 if (pObject == lpScriptContext->GetThisObject() || | 290 if (pObject == lpScriptContext->GetThisObject() || |
291 (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Javascript && | 291 (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Javascript && |
292 !lpScriptContext->IsStrictScopeInJavaScript())) { | 292 !lpScriptContext->IsStrictScopeInJavaScript())) { |
293 dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; | 293 dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; |
294 bRet = lpScriptContext->QueryNodeByFlag( | 294 bRet = lpScriptContext->QueryNodeByFlag( |
295 ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE); | 295 ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE); |
296 } | 296 } |
297 if (bRet) { | 297 if (bRet) { |
298 return; | 298 return; |
299 } | 299 } |
300 CXFA_Object* pScriptObject = | 300 CXFA_Object* pScriptObject = |
301 lpScriptContext->GetVariablesThis(pOriginalObject, TRUE); | 301 lpScriptContext->GetVariablesThis(pOriginalObject, TRUE); |
302 if (pScriptObject) { | 302 if (pScriptObject) { |
303 bRet = lpScriptContext->QueryVariableValue(ToNode(pScriptObject), | 303 bRet = lpScriptContext->QueryVariableValue(ToNode(pScriptObject), |
304 szPropName, pReturnValue, TRUE); | 304 szPropName, pReturnValue, TRUE); |
305 } | 305 } |
306 if (!bRet) { | 306 if (!bRet) { |
307 FXJSE_Value_SetUndefined(pReturnValue); | 307 pReturnValue->SetUndefined(); |
308 } | 308 } |
309 } | 309 } |
310 void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, | 310 void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, |
311 const CFX_ByteStringC& szPropName, | 311 const CFX_ByteStringC& szPropName, |
312 CFXJSE_Value* pReturnValue) { | 312 CFXJSE_Value* pReturnValue) { |
313 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr); | 313 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr); |
314 if (!pOriginalObject) | 314 if (!pOriginalObject) |
315 return; | 315 return; |
316 | 316 |
317 CXFA_ScriptContext* lpScriptContext = | 317 CXFA_ScriptContext* lpScriptContext = |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 void* lpVariables = m_mapVariableToContext.GetValueAt(pScriptNode); | 501 void* lpVariables = m_mapVariableToContext.GetValueAt(pScriptNode); |
502 if (!lpVariables) | 502 if (!lpVariables) |
503 return FALSE; | 503 return FALSE; |
504 | 504 |
505 FX_BOOL bRes = FALSE; | 505 FX_BOOL bRes = FALSE; |
506 CFXJSE_Context* pVariableContext = static_cast<CFXJSE_Context*>(lpVariables); | 506 CFXJSE_Context* pVariableContext = static_cast<CFXJSE_Context*>(lpVariables); |
507 std::unique_ptr<CFXJSE_Value> pObject( | 507 std::unique_ptr<CFXJSE_Value> pObject( |
508 FXJSE_Context_GetGlobalObject(pVariableContext)); | 508 FXJSE_Context_GetGlobalObject(pVariableContext)); |
509 std::unique_ptr<CFXJSE_Value> hVariableValue(new CFXJSE_Value(m_pIsolate)); | 509 std::unique_ptr<CFXJSE_Value> hVariableValue(new CFXJSE_Value(m_pIsolate)); |
510 if (!bGetter) { | 510 if (!bGetter) { |
511 FXJSE_Value_SetObjectOwnProp(pObject.get(), szPropName, pValue); | 511 pObject->SetObjectOwnProperty(szPropName, pValue); |
512 bRes = TRUE; | 512 bRes = TRUE; |
513 } else if (FXJSE_Value_ObjectHasOwnProp(pObject.get(), szPropName, FALSE)) { | 513 } else if (pObject->HasObjectOwnProperty(szPropName, FALSE)) { |
514 FXJSE_Value_GetObjectProp(pObject.get(), szPropName, hVariableValue.get()); | 514 pObject->GetObjectProperty(szPropName, hVariableValue.get()); |
515 if (FXJSE_Value_IsFunction(hVariableValue.get())) | 515 if (FXJSE_Value_IsFunction(hVariableValue.get())) |
516 FXJSE_Value_SetFunctionBind(pValue, hVariableValue.get(), pObject.get()); | 516 pValue->SetFunctionBind(hVariableValue.get(), pObject.get()); |
517 else if (bGetter) | 517 else if (bGetter) |
518 FXJSE_Value_Set(pValue, hVariableValue.get()); | 518 pValue->Assign(hVariableValue.get()); |
519 else | 519 else |
520 FXJSE_Value_Set(hVariableValue.get(), pValue); | 520 hVariableValue.get()->Assign(pValue); |
521 bRes = TRUE; | 521 bRes = TRUE; |
522 } | 522 } |
523 return bRes; | 523 return bRes; |
524 } | 524 } |
525 | 525 |
526 void CXFA_ScriptContext::ReleaseVariablesMap() { | 526 void CXFA_ScriptContext::ReleaseVariablesMap() { |
527 FX_POSITION ps = m_mapVariableToContext.GetStartPosition(); | 527 FX_POSITION ps = m_mapVariableToContext.GetStartPosition(); |
528 while (ps) { | 528 while (ps) { |
529 CXFA_Object* pScriptNode; | 529 CXFA_Object* pScriptNode; |
530 CFXJSE_Context* pVariableContext = nullptr; | 530 CFXJSE_Context* pVariableContext = nullptr; |
531 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext); | 531 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext); |
532 std::unique_ptr<CFXJSE_Value> pObject( | 532 std::unique_ptr<CFXJSE_Value> pObject( |
533 FXJSE_Context_GetGlobalObject(pVariableContext)); | 533 FXJSE_Context_GetGlobalObject(pVariableContext)); |
534 delete ToThisProxy(pObject.get(), nullptr); | 534 delete ToThisProxy(pObject.get(), nullptr); |
535 FXJSE_Context_Release(pVariableContext); | 535 FXJSE_Context_Release(pVariableContext); |
536 } | 536 } |
537 m_mapVariableToContext.RemoveAll(); | 537 m_mapVariableToContext.RemoveAll(); |
538 } | 538 } |
539 | 539 |
540 void CXFA_ScriptContext::DefineJsClass() { | 540 void CXFA_ScriptContext::DefineJsClass() { |
541 m_pJsClass = FXJSE_DefineClass(m_pJsContext, &NormalClassDescriptor); | 541 m_pJsClass = FXJSE_DefineClass(m_pJsContext, &NormalClassDescriptor); |
542 } | 542 } |
543 | 543 |
544 void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const { | 544 void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const { |
545 static const CFX_ByteStringC OBJ_NAME[2] = {"Number", "Date"}; | 545 static const CFX_ByteStringC OBJ_NAME[2] = {"Number", "Date"}; |
546 std::unique_ptr<CFXJSE_Value> pObject( | 546 std::unique_ptr<CFXJSE_Value> pObject( |
547 FXJSE_Context_GetGlobalObject(pContext)); | 547 FXJSE_Context_GetGlobalObject(pContext)); |
548 std::unique_ptr<CFXJSE_Value> hProp(new CFXJSE_Value(m_pIsolate)); | 548 std::unique_ptr<CFXJSE_Value> hProp(new CFXJSE_Value(m_pIsolate)); |
549 for (int i = 0; i < 2; ++i) { | 549 for (int i = 0; i < 2; ++i) { |
550 if (FXJSE_Value_GetObjectProp(pObject.get(), OBJ_NAME[i], hProp.get())) | 550 if (pObject->GetObjectProperty(OBJ_NAME[i], hProp.get())) |
551 FXJSE_Value_DeleteObjectProp(pObject.get(), OBJ_NAME[i]); | 551 pObject.get()->DeleteObjectProperty(OBJ_NAME[i]); |
552 } | 552 } |
553 } | 553 } |
554 CFXJSE_Class* CXFA_ScriptContext::GetJseNormalClass() { | 554 CFXJSE_Class* CXFA_ScriptContext::GetJseNormalClass() { |
555 return m_pJsClass; | 555 return m_pJsClass; |
556 } | 556 } |
557 int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, | 557 int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, |
558 const CFX_WideStringC& wsExpression, | 558 const CFX_WideStringC& wsExpression, |
559 XFA_RESOLVENODE_RS& resolveNodeRS, | 559 XFA_RESOLVENODE_RS& resolveNodeRS, |
560 uint32_t dwStyles, | 560 uint32_t dwStyles, |
561 CXFA_Node* bindNode) { | 561 CXFA_Node* bindNode) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 } | 718 } |
719 CFXJSE_Value* CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) { | 719 CFXJSE_Value* CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) { |
720 if (!pObject) | 720 if (!pObject) |
721 return nullptr; | 721 return nullptr; |
722 if (pObject->IsNode()) | 722 if (pObject->IsNode()) |
723 RunVariablesScript(pObject->AsNode()); | 723 RunVariablesScript(pObject->AsNode()); |
724 | 724 |
725 void* pValue = m_mapXFAToValue.GetValueAt(pObject); | 725 void* pValue = m_mapXFAToValue.GetValueAt(pObject); |
726 if (!pValue) { | 726 if (!pValue) { |
727 CFXJSE_Value* jsValue = new CFXJSE_Value(m_pIsolate); | 727 CFXJSE_Value* jsValue = new CFXJSE_Value(m_pIsolate); |
728 FXJSE_Value_SetObject(jsValue, pObject, m_pJsClass); | 728 jsValue->SetObject(pObject, m_pJsClass); |
729 m_mapXFAToValue.SetAt(pObject, jsValue); | 729 m_mapXFAToValue.SetAt(pObject, jsValue); |
730 pValue = jsValue; | 730 pValue = jsValue; |
731 } | 731 } |
732 return static_cast<CFXJSE_Value*>(pValue); | 732 return static_cast<CFXJSE_Value*>(pValue); |
733 } | 733 } |
734 int32_t CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode) { | 734 int32_t CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode) { |
735 CXFA_NodeHelper* lpNodeHelper = m_pResolveProcessor->GetNodeHelper(); | 735 CXFA_NodeHelper* lpNodeHelper = m_pResolveProcessor->GetNodeHelper(); |
736 return lpNodeHelper->XFA_GetIndex(refNode, XFA_LOGIC_Transparent, | 736 return lpNodeHelper->XFA_GetIndex(refNode, XFA_LOGIC_Transparent, |
737 lpNodeHelper->XFA_NodeIsProperty(refNode), | 737 lpNodeHelper->XFA_NodeIsProperty(refNode), |
738 FALSE); | 738 FALSE); |
(...skipping 22 matching lines...) Expand all Loading... |
761 } | 761 } |
762 } | 762 } |
763 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { | 763 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { |
764 if (!m_pScriptNodeArray) { | 764 if (!m_pScriptNodeArray) { |
765 return; | 765 return; |
766 } | 766 } |
767 if (m_pScriptNodeArray->Find(pNode) == -1) { | 767 if (m_pScriptNodeArray->Find(pNode) == -1) { |
768 m_pScriptNodeArray->Add(pNode); | 768 m_pScriptNodeArray->Add(pNode); |
769 } | 769 } |
770 } | 770 } |
OLD | NEW |