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_eventpseudomodel.h" | 7 #include "xfa/fxfa/parser/xfa_script_eventpseudomodel.h" |
8 | 8 |
9 #include "xfa/fxfa/app/xfa_ffnotify.h" | 9 #include "xfa/fxfa/app/xfa_ffnotify.h" |
10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_EventPseudoModel) { | 25 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_EventPseudoModel) { |
26 m_uScriptHash = XFA_HASHCODE_Event; | 26 m_uScriptHash = XFA_HASHCODE_Event; |
27 } | 27 } |
28 CScript_EventPseudoModel::~CScript_EventPseudoModel() {} | 28 CScript_EventPseudoModel::~CScript_EventPseudoModel() {} |
29 void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue, | 29 void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue, |
30 CFX_WideString& wsValue, | 30 CFX_WideString& wsValue, |
31 FX_BOOL bSetting) { | 31 FX_BOOL bSetting) { |
32 if (bSetting) { | 32 if (bSetting) { |
33 CFX_ByteString bsValue; | 33 CFX_ByteString bsValue; |
34 FXJSE_Value_ToUTF8String(hValue, bsValue); | 34 FXJSE_Value_ToUTF8String(hValue, bsValue); |
35 wsValue = CFX_WideString::FromUTF8(bsValue.AsByteStringC()); | 35 wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); |
36 } else { | 36 } else { |
37 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsByteStringC()); | 37 FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue).AsStringC()); |
38 } | 38 } |
39 } | 39 } |
40 void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue, | 40 void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue, |
41 int32_t& iValue, | 41 int32_t& iValue, |
42 FX_BOOL bSetting) { | 42 FX_BOOL bSetting) { |
43 if (bSetting) { | 43 if (bSetting) { |
44 iValue = FXJSE_Value_ToInteger(hValue); | 44 iValue = FXJSE_Value_ToInteger(hValue); |
45 } else { | 45 } else { |
46 FXJSE_Value_SetInteger(hValue, iValue); | 46 FXJSE_Value_SetInteger(hValue, iValue); |
47 } | 47 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 265 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
266 if (!pScriptContext) { | 266 if (!pScriptContext) { |
267 return; | 267 return; |
268 } | 268 } |
269 CXFA_EventParam* pEventParam = pScriptContext->GetEventParam(); | 269 CXFA_EventParam* pEventParam = pScriptContext->GetEventParam(); |
270 if (!pEventParam) { | 270 if (!pEventParam) { |
271 return; | 271 return; |
272 } | 272 } |
273 pEventParam->Reset(); | 273 pEventParam->Reset(); |
274 } | 274 } |
OLD | NEW |