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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 CXFA_Document* pDoc = pOrginalObject->GetDocument(); | 172 CXFA_Document* pDoc = pOrginalObject->GetDocument(); |
173 CXFA_ScriptContext* lpScriptContext = | 173 CXFA_ScriptContext* lpScriptContext = |
174 (CXFA_ScriptContext*)pDoc->GetScriptContext(); | 174 (CXFA_ScriptContext*)pDoc->GetScriptContext(); |
175 CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOrginalObject); | 175 CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOrginalObject); |
176 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); | 176 CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName); |
177 if (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Formcalc) { | 177 if (lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Formcalc) { |
178 if (szPropName == FOXIT_XFA_FM2JS_FORMCALC_RUNTIME) { | 178 if (szPropName == FOXIT_XFA_FM2JS_FORMCALC_RUNTIME) { |
179 XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, hValue); | 179 XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, hValue); |
180 return; | 180 return; |
181 } | 181 } |
182 uint32_t uHashCode = | 182 uint32_t uHashCode = FX_HashCode_GetW(wsPropName.AsStringC(), false); |
183 FX_HashCode_String_GetW(wsPropName.c_str(), wsPropName.GetLength()); | |
184 if (uHashCode != XFA_HASHCODE_Layout) { | 183 if (uHashCode != XFA_HASHCODE_Layout) { |
185 CXFA_Object* pObject = | 184 CXFA_Object* pObject = |
186 lpScriptContext->GetDocument()->GetXFAObject(uHashCode); | 185 lpScriptContext->GetDocument()->GetXFAObject(uHashCode); |
187 if (pObject) { | 186 if (pObject) { |
188 FXJSE_Value_Set(hValue, lpScriptContext->GetJSValueFromMap(pObject)); | 187 FXJSE_Value_Set(hValue, lpScriptContext->GetJSValueFromMap(pObject)); |
189 return; | 188 return; |
190 } | 189 } |
191 } | 190 } |
192 } | 191 } |
193 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | | 192 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 } | 766 } |
768 } | 767 } |
769 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { | 768 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { |
770 if (!m_pScriptNodeArray) { | 769 if (!m_pScriptNodeArray) { |
771 return; | 770 return; |
772 } | 771 } |
773 if (m_pScriptNodeArray->Find(pNode) == -1) { | 772 if (m_pScriptNodeArray->Find(pNode) == -1) { |
774 m_pScriptNodeArray->Add(pNode); | 773 m_pScriptNodeArray->Add(pNode); |
775 } | 774 } |
776 } | 775 } |
OLD | NEW |