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

Side by Side Diff: xfa/fxfa/parser/cxfa_scriptcontext.cpp

Issue 2328573002: Split CPDFXFA_Document apart (Closed)
Patch Set: Fix merge Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « xfa/fxfa/parser/cscript_hostpseudomodel.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/cxfa_scriptcontext.h" 7 #include "xfa/fxfa/parser/cxfa_scriptcontext.h"
8 8
9 #include "core/fxcrt/include/fx_ext.h" 9 #include "core/fxcrt/include/fx_ext.h"
10 #include "fxjs/include/cfxjse_arguments.h" 10 #include "fxjs/include/cfxjse_arguments.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (lpOrginalNode->IsVariablesThis()) { 196 if (lpOrginalNode->IsVariablesThis()) {
197 if (pValue && pValue->IsUndefined()) { 197 if (pValue && pValue->IsUndefined()) {
198 pObject->SetObjectOwnProperty(szPropName, pValue); 198 pObject->SetObjectOwnProperty(szPropName, pValue);
199 return; 199 return;
200 } 200 }
201 } 201 }
202 CXFA_FFNotify* pNotify = pDoc->GetNotify(); 202 CXFA_FFNotify* pNotify = pDoc->GetNotify();
203 if (!pNotify) { 203 if (!pNotify) {
204 return; 204 return;
205 } 205 }
206 pNotify->GetDocProvider()->SetGlobalProperty(pNotify->GetHDOC(), szPropName, 206 pNotify->GetDocEnvironment()->SetGlobalProperty(pNotify->GetHDOC(),
207 pValue); 207 szPropName, pValue);
208 } 208 }
209 FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, 209 FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode,
210 const CFX_WideStringC& propname, 210 const CFX_WideStringC& propname,
211 CFXJSE_Value* pValue, 211 CFXJSE_Value* pValue,
212 uint32_t dwFlag, 212 uint32_t dwFlag,
213 FX_BOOL bSetting) { 213 FX_BOOL bSetting) {
214 if (!refNode) 214 if (!refNode)
215 return false; 215 return false;
216 XFA_RESOLVENODE_RS resolveRs; 216 XFA_RESOLVENODE_RS resolveRs;
217 if (ResolveObjects(refNode, propname, resolveRs, dwFlag) <= 0) 217 if (ResolveObjects(refNode, propname, resolveRs, dwFlag) <= 0)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 lpScriptContext->GetVariablesThis(pOriginalObject, TRUE); 272 lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
273 if (pScriptObject && 273 if (pScriptObject &&
274 lpScriptContext->QueryVariableValue(pScriptObject->AsNode(), szPropName, 274 lpScriptContext->QueryVariableValue(pScriptObject->AsNode(), szPropName,
275 pValue, TRUE)) { 275 pValue, TRUE)) {
276 return; 276 return;
277 } 277 }
278 CXFA_FFNotify* pNotify = pDoc->GetNotify(); 278 CXFA_FFNotify* pNotify = pDoc->GetNotify();
279 if (!pNotify) { 279 if (!pNotify) {
280 return; 280 return;
281 } 281 }
282 pNotify->GetDocProvider()->GetGlobalProperty(pNotify->GetHDOC(), szPropName, 282 pNotify->GetDocEnvironment()->GetGlobalProperty(pNotify->GetHDOC(),
283 pValue); 283 szPropName, pValue);
284 } 284 }
285 void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue, 285 void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue,
286 const CFX_ByteStringC& szPropName, 286 const CFX_ByteStringC& szPropName,
287 CFXJSE_Value* pReturnValue) { 287 CFXJSE_Value* pReturnValue) {
288 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr); 288 CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr);
289 if (!pOriginalObject) { 289 if (!pOriginalObject) {
290 pReturnValue->SetUndefined(); 290 pReturnValue->SetUndefined();
291 return; 291 return;
292 } 292 }
293 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); 293 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 return; 762 return;
763 if (nodes.GetSize() > 0) 763 if (nodes.GetSize() > 0)
764 m_pScriptNodeArray->Copy(nodes); 764 m_pScriptNodeArray->Copy(nodes);
765 } 765 }
766 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { 766 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) {
767 if (!m_pScriptNodeArray) 767 if (!m_pScriptNodeArray)
768 return; 768 return;
769 if (m_pScriptNodeArray->Find(pNode) == -1) 769 if (m_pScriptNodeArray->Find(pNode) == -1)
770 m_pScriptNodeArray->Add(pNode); 770 m_pScriptNodeArray->Add(pNode);
771 } 771 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/cscript_hostpseudomodel.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698