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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 0, // method count | 59 0, // method count |
60 CXFA_ScriptContext::NormalPropTypeGetter, | 60 CXFA_ScriptContext::NormalPropTypeGetter, |
61 CXFA_ScriptContext::GlobalPropertyGetter, | 61 CXFA_ScriptContext::GlobalPropertyGetter, |
62 CXFA_ScriptContext::GlobalPropertySetter, | 62 CXFA_ScriptContext::GlobalPropertySetter, |
63 nullptr, // property deleter | 63 nullptr, // property deleter |
64 CXFA_ScriptContext::NormalMethodCall, | 64 CXFA_ScriptContext::NormalMethodCall, |
65 }; | 65 }; |
66 | 66 |
67 const char kFormCalcRuntime[] = "foxit_xfa_formcalc_runtime"; | 67 const char kFormCalcRuntime[] = "foxit_xfa_formcalc_runtime"; |
68 | 68 |
| 69 CXFA_ThisProxy* ToThisProxy(CFXJSE_Value* pValue, CFXJSE_Class* pClass) { |
| 70 return static_cast<CXFA_ThisProxy*>(pValue->ToHostObject(pClass)); |
| 71 } |
| 72 |
69 } // namespace | 73 } // namespace |
70 | 74 |
| 75 // static. |
| 76 CXFA_Object* CXFA_ScriptContext::ToObject(CFXJSE_Value* pValue, |
| 77 CFXJSE_Class* pClass) { |
| 78 return static_cast<CXFA_Object*>(pValue->ToHostObject(pClass)); |
| 79 } |
| 80 |
71 CXFA_ScriptContext::CXFA_ScriptContext(CXFA_Document* pDocument) | 81 CXFA_ScriptContext::CXFA_ScriptContext(CXFA_Document* pDocument) |
72 : m_pDocument(pDocument), | 82 : m_pDocument(pDocument), |
73 m_pJsContext(nullptr), | 83 m_pJsContext(nullptr), |
74 m_pIsolate(nullptr), | 84 m_pIsolate(nullptr), |
75 m_pJsClass(nullptr), | 85 m_pJsClass(nullptr), |
76 m_eScriptType(XFA_SCRIPTLANGTYPE_Unkown), | 86 m_eScriptType(XFA_SCRIPTLANGTYPE_Unkown), |
77 m_pScriptNodeArray(nullptr), | 87 m_pScriptNodeArray(nullptr), |
78 m_pResolveProcessor(nullptr), | 88 m_pResolveProcessor(nullptr), |
79 m_hFM2JSContext(nullptr), | 89 m_hFM2JSContext(nullptr), |
80 m_pThisObject(nullptr), | 90 m_pThisObject(nullptr), |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : NULL; | 150 CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : NULL; |
141 FX_BOOL bRet = | 151 FX_BOOL bRet = |
142 FXJSE_ExecuteScript(m_pJsContext, btScript.c_str(), hRetValue, pValue); | 152 FXJSE_ExecuteScript(m_pJsContext, btScript.c_str(), hRetValue, pValue); |
143 m_pThisObject = pOriginalObject; | 153 m_pThisObject = pOriginalObject; |
144 m_eScriptType = eSaveType; | 154 m_eScriptType = eSaveType; |
145 return bRet; | 155 return bRet; |
146 } | 156 } |
147 void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject, | 157 void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject, |
148 const CFX_ByteStringC& szPropName, | 158 const CFX_ByteStringC& szPropName, |
149 CFXJSE_Value* pValue) { | 159 CFXJSE_Value* pValue) { |
150 CXFA_Object* lpOrginalNode = | 160 CXFA_Object* lpOrginalNode = ToObject(pObject, nullptr); |
151 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(pObject, nullptr)); | |
152 CXFA_Document* pDoc = lpOrginalNode->GetDocument(); | 161 CXFA_Document* pDoc = lpOrginalNode->GetDocument(); |
153 CXFA_ScriptContext* lpScriptContext = | 162 CXFA_ScriptContext* lpScriptContext = |
154 (CXFA_ScriptContext*)pDoc->GetScriptContext(); | 163 (CXFA_ScriptContext*)pDoc->GetScriptContext(); |
155 CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(lpOrginalNode); | 164 CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(lpOrginalNode); |
156 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 165 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
157 uint32_t dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings | | 166 uint32_t dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings | |
158 XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | | 167 XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | |
159 XFA_RESOLVENODE_Attributes; | 168 XFA_RESOLVENODE_Attributes; |
160 CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); | 169 CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); |
161 if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { | 170 if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 if (lpAttributeInfo) { | 206 if (lpAttributeInfo) { |
198 (resolveRs.nodes[0]->*(lpAttributeInfo->lpfnCallback))( | 207 (resolveRs.nodes[0]->*(lpAttributeInfo->lpfnCallback))( |
199 pValue, bSetting, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); | 208 pValue, bSetting, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); |
200 } | 209 } |
201 } | 210 } |
202 return true; | 211 return true; |
203 } | 212 } |
204 void CXFA_ScriptContext::GlobalPropertyGetter(CFXJSE_Value* pObject, | 213 void CXFA_ScriptContext::GlobalPropertyGetter(CFXJSE_Value* pObject, |
205 const CFX_ByteStringC& szPropName, | 214 const CFX_ByteStringC& szPropName, |
206 CFXJSE_Value* pValue) { | 215 CFXJSE_Value* pValue) { |
207 CXFA_Object* pOriginalObject = | 216 CXFA_Object* pOriginalObject = ToObject(pObject, nullptr); |
208 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(pObject, nullptr)); | |
209 CXFA_Document* pDoc = pOriginalObject->GetDocument(); | 217 CXFA_Document* pDoc = pOriginalObject->GetDocument(); |
210 CXFA_ScriptContext* lpScriptContext = | 218 CXFA_ScriptContext* lpScriptContext = |
211 (CXFA_ScriptContext*)pDoc->GetScriptContext(); | 219 (CXFA_ScriptContext*)pDoc->GetScriptContext(); |
212 CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOriginalObject); | 220 CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOriginalObject); |
213 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 221 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
214 if (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Formcalc) { | 222 if (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Formcalc) { |
215 if (szPropName == kFormCalcRuntime) { | 223 if (szPropName == kFormCalcRuntime) { |
216 lpScriptContext->m_hFM2JSContext->GlobalPropertyGetter(pValue); | 224 lpScriptContext->m_hFM2JSContext->GlobalPropertyGetter(pValue); |
217 return; | 225 return; |
218 } | 226 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 CXFA_FFNotify* pNotify = pDoc->GetNotify(); | 260 CXFA_FFNotify* pNotify = pDoc->GetNotify(); |
253 if (!pNotify) { | 261 if (!pNotify) { |
254 return; | 262 return; |
255 } | 263 } |
256 pNotify->GetDocProvider()->GetGlobalProperty(pNotify->GetHDOC(), szPropName, | 264 pNotify->GetDocProvider()->GetGlobalProperty(pNotify->GetHDOC(), szPropName, |
257 pValue); | 265 pValue); |
258 } | 266 } |
259 void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue, | 267 void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue, |
260 const CFX_ByteStringC& szPropName, | 268 const CFX_ByteStringC& szPropName, |
261 CFXJSE_Value* pReturnValue) { | 269 CFXJSE_Value* pReturnValue) { |
262 CXFA_Object* pOriginalObject = | 270 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr); |
263 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(pOriginalValue, nullptr)); | |
264 if (!pOriginalObject) { | 271 if (!pOriginalObject) { |
265 FXJSE_Value_SetUndefined(pReturnValue); | 272 FXJSE_Value_SetUndefined(pReturnValue); |
266 return; | 273 return; |
267 } | 274 } |
268 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 275 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
269 CXFA_ScriptContext* lpScriptContext = | 276 CXFA_ScriptContext* lpScriptContext = |
270 (CXFA_ScriptContext*)pOriginalObject->GetDocument()->GetScriptContext(); | 277 (CXFA_ScriptContext*)pOriginalObject->GetDocument()->GetScriptContext(); |
271 CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject); | 278 CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject); |
272 if (wsPropName == FX_WSTRC(L"xfa")) { | 279 if (wsPropName == FX_WSTRC(L"xfa")) { |
273 CFXJSE_Value* pValue = lpScriptContext->GetJSValueFromMap( | 280 CFXJSE_Value* pValue = lpScriptContext->GetJSValueFromMap( |
(...skipping 24 matching lines...) Expand all Loading... |
298 bRet = lpScriptContext->QueryVariableValue(ToNode(pScriptObject), | 305 bRet = lpScriptContext->QueryVariableValue(ToNode(pScriptObject), |
299 szPropName, pReturnValue, TRUE); | 306 szPropName, pReturnValue, TRUE); |
300 } | 307 } |
301 if (!bRet) { | 308 if (!bRet) { |
302 FXJSE_Value_SetUndefined(pReturnValue); | 309 FXJSE_Value_SetUndefined(pReturnValue); |
303 } | 310 } |
304 } | 311 } |
305 void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, | 312 void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, |
306 const CFX_ByteStringC& szPropName, | 313 const CFX_ByteStringC& szPropName, |
307 CFXJSE_Value* pReturnValue) { | 314 CFXJSE_Value* pReturnValue) { |
308 CXFA_Object* pOriginalObject = | 315 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr); |
309 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(pOriginalValue, nullptr)); | |
310 if (!pOriginalObject) | 316 if (!pOriginalObject) |
311 return; | 317 return; |
312 | 318 |
313 CXFA_ScriptContext* lpScriptContext = | 319 CXFA_ScriptContext* lpScriptContext = |
314 (CXFA_ScriptContext*)pOriginalObject->GetDocument()->GetScriptContext(); | 320 (CXFA_ScriptContext*)pOriginalObject->GetDocument()->GetScriptContext(); |
315 CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject); | 321 CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject); |
316 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 322 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
317 const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName( | 323 const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName( |
318 pObject->GetClassID(), wsPropName.AsStringC()); | 324 pObject->GetClassID(), wsPropName.AsStringC()); |
319 if (lpAttributeInfo) { | 325 if (lpAttributeInfo) { |
(...skipping 30 matching lines...) Expand all Loading... |
350 if (pScriptObject) { | 356 if (pScriptObject) { |
351 lpScriptContext->QueryVariableValue(ToNode(pScriptObject), szPropName, | 357 lpScriptContext->QueryVariableValue(ToNode(pScriptObject), szPropName, |
352 pReturnValue, FALSE); | 358 pReturnValue, FALSE); |
353 } | 359 } |
354 } | 360 } |
355 } | 361 } |
356 int32_t CXFA_ScriptContext::NormalPropTypeGetter( | 362 int32_t CXFA_ScriptContext::NormalPropTypeGetter( |
357 CFXJSE_Value* pOriginalValue, | 363 CFXJSE_Value* pOriginalValue, |
358 const CFX_ByteStringC& szPropName, | 364 const CFX_ByteStringC& szPropName, |
359 FX_BOOL bQueryIn) { | 365 FX_BOOL bQueryIn) { |
360 CXFA_Object* pObject = | 366 CXFA_Object* pObject = ToObject(pOriginalValue, nullptr); |
361 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(pOriginalValue, nullptr)); | |
362 if (!pObject) | 367 if (!pObject) |
363 return FXJSE_ClassPropType_None; | 368 return FXJSE_ClassPropType_None; |
364 | 369 |
365 CXFA_ScriptContext* lpScriptContext = | 370 CXFA_ScriptContext* lpScriptContext = |
366 (CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext(); | 371 (CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext(); |
367 pObject = lpScriptContext->GetVariablesThis(pObject); | 372 pObject = lpScriptContext->GetVariablesThis(pObject); |
368 XFA_ELEMENT objElement = pObject->GetClassID(); | 373 XFA_ELEMENT objElement = pObject->GetClassID(); |
369 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 374 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
370 if (XFA_GetMethodByName(objElement, wsPropName.AsStringC())) { | 375 if (XFA_GetMethodByName(objElement, wsPropName.AsStringC())) { |
371 return FXJSE_ClassPropType_Method; | 376 return FXJSE_ClassPropType_Method; |
372 } | 377 } |
373 if (bQueryIn && | 378 if (bQueryIn && |
374 !XFA_GetScriptAttributeByName(objElement, wsPropName.AsStringC())) { | 379 !XFA_GetScriptAttributeByName(objElement, wsPropName.AsStringC())) { |
375 return FXJSE_ClassPropType_None; | 380 return FXJSE_ClassPropType_None; |
376 } | 381 } |
377 return FXJSE_ClassPropType_Property; | 382 return FXJSE_ClassPropType_Property; |
378 } | 383 } |
379 int32_t CXFA_ScriptContext::GlobalPropTypeGetter( | 384 int32_t CXFA_ScriptContext::GlobalPropTypeGetter( |
380 CFXJSE_Value* pOriginalValue, | 385 CFXJSE_Value* pOriginalValue, |
381 const CFX_ByteStringC& szPropName, | 386 const CFX_ByteStringC& szPropName, |
382 FX_BOOL bQueryIn) { | 387 FX_BOOL bQueryIn) { |
383 CXFA_Object* pObject = | 388 CXFA_Object* pObject = ToObject(pOriginalValue, nullptr); |
384 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(pOriginalValue, nullptr)); | |
385 if (!pObject) | 389 if (!pObject) |
386 return FXJSE_ClassPropType_None; | 390 return FXJSE_ClassPropType_None; |
387 | 391 |
388 CXFA_ScriptContext* lpScriptContext = | 392 CXFA_ScriptContext* lpScriptContext = |
389 (CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext(); | 393 (CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext(); |
390 pObject = lpScriptContext->GetVariablesThis(pObject); | 394 pObject = lpScriptContext->GetVariablesThis(pObject); |
391 XFA_ELEMENT objElement = pObject->GetClassID(); | 395 XFA_ELEMENT objElement = pObject->GetClassID(); |
392 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 396 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
393 if (XFA_GetMethodByName(objElement, wsPropName.AsStringC())) { | 397 if (XFA_GetMethodByName(objElement, wsPropName.AsStringC())) { |
394 return FXJSE_ClassPropType_Method; | 398 return FXJSE_ClassPropType_Method; |
395 } | 399 } |
396 return FXJSE_ClassPropType_Property; | 400 return FXJSE_ClassPropType_Property; |
397 } | 401 } |
398 void CXFA_ScriptContext::NormalMethodCall(CFXJSE_Value* pThis, | 402 void CXFA_ScriptContext::NormalMethodCall(CFXJSE_Value* pThis, |
399 const CFX_ByteStringC& szFuncName, | 403 const CFX_ByteStringC& szFuncName, |
400 CFXJSE_Arguments& args) { | 404 CFXJSE_Arguments& args) { |
401 CXFA_Object* pObject = | 405 CXFA_Object* pObject = ToObject(pThis, nullptr); |
402 static_cast<CXFA_Object*>(FXJSE_Value_ToObject(pThis, nullptr)); | |
403 if (!pObject) | 406 if (!pObject) |
404 return; | 407 return; |
405 | 408 |
406 CXFA_ScriptContext* lpScriptContext = | 409 CXFA_ScriptContext* lpScriptContext = |
407 (CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext(); | 410 (CXFA_ScriptContext*)pObject->GetDocument()->GetScriptContext(); |
408 pObject = lpScriptContext->GetVariablesThis(pObject); | 411 pObject = lpScriptContext->GetVariablesThis(pObject); |
409 CFX_WideString wsFunName = CFX_WideString::FromUTF8(szFuncName); | 412 CFX_WideString wsFunName = CFX_WideString::FromUTF8(szFuncName); |
410 const XFA_METHODINFO* lpMethodInfo = | 413 const XFA_METHODINFO* lpMethodInfo = |
411 XFA_GetMethodByName(pObject->GetClassID(), wsFunName.AsStringC()); | 414 XFA_GetMethodByName(pObject->GetClassID(), wsFunName.AsStringC()); |
412 if (!lpMethodInfo) | 415 if (!lpMethodInfo) |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 } | 526 } |
524 | 527 |
525 void CXFA_ScriptContext::ReleaseVariablesMap() { | 528 void CXFA_ScriptContext::ReleaseVariablesMap() { |
526 FX_POSITION ps = m_mapVariableToContext.GetStartPosition(); | 529 FX_POSITION ps = m_mapVariableToContext.GetStartPosition(); |
527 while (ps) { | 530 while (ps) { |
528 CXFA_Object* pScriptNode; | 531 CXFA_Object* pScriptNode; |
529 CFXJSE_Context* pVariableContext = nullptr; | 532 CFXJSE_Context* pVariableContext = nullptr; |
530 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext); | 533 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext); |
531 std::unique_ptr<CFXJSE_Value> pObject( | 534 std::unique_ptr<CFXJSE_Value> pObject( |
532 FXJSE_Context_GetGlobalObject(pVariableContext)); | 535 FXJSE_Context_GetGlobalObject(pVariableContext)); |
533 delete static_cast<CXFA_ThisProxy*>( | 536 delete ToThisProxy(pObject.get(), nullptr); |
534 FXJSE_Value_ToObject(pObject.get(), nullptr)); | |
535 FXJSE_Context_Release(pVariableContext); | 537 FXJSE_Context_Release(pVariableContext); |
536 } | 538 } |
537 m_mapVariableToContext.RemoveAll(); | 539 m_mapVariableToContext.RemoveAll(); |
538 } | 540 } |
539 | 541 |
540 void CXFA_ScriptContext::DefineJsClass() { | 542 void CXFA_ScriptContext::DefineJsClass() { |
541 m_pJsClass = FXJSE_DefineClass(m_pJsContext, &NormalClassDescriptor); | 543 m_pJsClass = FXJSE_DefineClass(m_pJsContext, &NormalClassDescriptor); |
542 } | 544 } |
543 | 545 |
544 void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const { | 546 void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 nRet = m_pResolveProcessor->XFA_ResolveNodes(rndFind); | 648 nRet = m_pResolveProcessor->XFA_ResolveNodes(rndFind); |
647 if (nRet < 1) { | 649 if (nRet < 1) { |
648 continue; | 650 continue; |
649 } | 651 } |
650 if (rndFind.m_dwFlag == XFA_RESOVENODE_RSTYPE_Attribute && | 652 if (rndFind.m_dwFlag == XFA_RESOVENODE_RSTYPE_Attribute && |
651 rndFind.m_pScriptAttribute && nStart < wsExpression.GetLength()) { | 653 rndFind.m_pScriptAttribute && nStart < wsExpression.GetLength()) { |
652 std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(m_pIsolate)); | 654 std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(m_pIsolate)); |
653 (rndFind.m_Nodes[0]->*(rndFind.m_pScriptAttribute->lpfnCallback))( | 655 (rndFind.m_Nodes[0]->*(rndFind.m_pScriptAttribute->lpfnCallback))( |
654 pValue.get(), FALSE, | 656 pValue.get(), FALSE, |
655 (XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute); | 657 (XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute); |
656 rndFind.m_Nodes.SetAt(0, static_cast<CXFA_Object*>(FXJSE_Value_ToObject( | 658 rndFind.m_Nodes.SetAt(0, ToObject(pValue.get(), nullptr)); |
657 pValue.get(), nullptr))); | |
658 } | 659 } |
659 int32_t iSize = m_upObjectArray.GetSize(); | 660 int32_t iSize = m_upObjectArray.GetSize(); |
660 if (iSize) { | 661 if (iSize) { |
661 m_upObjectArray.RemoveAt(iSize - 1); | 662 m_upObjectArray.RemoveAt(iSize - 1); |
662 } | 663 } |
663 retNodes.Append(rndFind.m_Nodes); | 664 retNodes.Append(rndFind.m_Nodes); |
664 rndFind.m_Nodes.RemoveAll(); | 665 rndFind.m_Nodes.RemoveAll(); |
665 if (bDataBind) { | 666 if (bDataBind) { |
666 break; | 667 break; |
667 } | 668 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 } | 763 } |
763 } | 764 } |
764 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { | 765 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { |
765 if (!m_pScriptNodeArray) { | 766 if (!m_pScriptNodeArray) { |
766 return; | 767 return; |
767 } | 768 } |
768 if (m_pScriptNodeArray->Find(pNode) == -1) { | 769 if (m_pScriptNodeArray->Find(pNode) == -1) { |
769 m_pScriptNodeArray->Add(pNode); | 770 m_pScriptNodeArray->Add(pNode); |
770 } | 771 } |
771 } | 772 } |
OLD | NEW |