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

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

Issue 2044293004: Convert CFXJSE_Value::ToString to return. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@fm2jscontext_cleanup_9
Patch Set: Created 4 years, 6 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/xfa_object_imp.cpp ('k') | xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp » ('j') | 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/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/include/xfa_ffwidgethandler.h" 10 #include "xfa/fxfa/include/xfa_ffwidgethandler.h"
(...skipping 10 matching lines...) Expand all
21 21
22 CScript_EventPseudoModel::CScript_EventPseudoModel(CXFA_Document* pDocument) 22 CScript_EventPseudoModel::CScript_EventPseudoModel(CXFA_Document* pDocument)
23 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_EventPseudoModel) { 23 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_EventPseudoModel) {
24 m_uScriptHash = XFA_HASHCODE_Event; 24 m_uScriptHash = XFA_HASHCODE_Event;
25 } 25 }
26 CScript_EventPseudoModel::~CScript_EventPseudoModel() {} 26 CScript_EventPseudoModel::~CScript_EventPseudoModel() {}
27 void Script_EventPseudoModel_StringProperty(CFXJSE_Value* pValue, 27 void Script_EventPseudoModel_StringProperty(CFXJSE_Value* pValue,
28 CFX_WideString& wsValue, 28 CFX_WideString& wsValue,
29 FX_BOOL bSetting) { 29 FX_BOOL bSetting) {
30 if (bSetting) { 30 if (bSetting) {
31 CFX_ByteString bsValue; 31 wsValue = pValue->ToWideString();
32 pValue->ToString(bsValue);
33 wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC());
34 } else { 32 } else {
35 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); 33 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC());
36 } 34 }
37 } 35 }
38 void Script_EventPseudoModel_InterProperty(CFXJSE_Value* pValue, 36 void Script_EventPseudoModel_InterProperty(CFXJSE_Value* pValue,
39 int32_t& iValue, 37 int32_t& iValue,
40 FX_BOOL bSetting) { 38 FX_BOOL bSetting) {
41 if (bSetting) { 39 if (bSetting) {
42 iValue = pValue->ToInteger(); 40 iValue = pValue->ToInteger();
43 } else { 41 } else {
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); 257 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
260 if (!pScriptContext) { 258 if (!pScriptContext) {
261 return; 259 return;
262 } 260 }
263 CXFA_EventParam* pEventParam = pScriptContext->GetEventParam(); 261 CXFA_EventParam* pEventParam = pScriptContext->GetEventParam();
264 if (!pEventParam) { 262 if (!pEventParam) {
265 return; 263 return;
266 } 264 }
267 pEventParam->Reset(); 265 pEventParam->Reset();
268 } 266 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_object_imp.cpp ('k') | xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698