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

Side by Side Diff: fpdfsdk/src/javascript/JS_Context.cpp

Issue 1108903002: Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 7 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 | « fpdfsdk/src/javascript/Field.cpp ('k') | fpdfsdk/src/javascript/JS_GlobalData.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 "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 //#include "../../include/javascript/JS_ResMgr.h" 9 //#include "../../include/javascript/JS_ResMgr.h"
10 #include "../../include/javascript/JS_Context.h" 10 #include "../../include/javascript/JS_Context.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return FALSE; 65 return FALSE;
66 } 66 }
67 67
68 FXJSErr error ={NULL,NULL, 0}; 68 FXJSErr error ={NULL,NULL, 0};
69 int nRet = 0; 69 int nRet = 0;
70 70
71 if (script.GetLength() > 0) 71 if (script.GetLength() > 0)
72 { 72 {
73 if (nMode == 0) 73 if (nMode == 0)
74 { 74 {
75 » » » nRet = JS_Execute(*m_pRuntime, this, script, script.GetL ength(), &error); 75 » » » nRet = JS_Execute(*m_pRuntime, this, script.c_str(), scr ipt.GetLength(), &error);
76 } 76 }
77 else 77 else
78 { 78 {
79 » » » nRet = JS_Parse(*m_pRuntime, this, script, script.GetLen gth(), &error); 79 » » » nRet = JS_Parse(*m_pRuntime, this, script.c_str(), scrip t.GetLength(), &error);
80 } 80 }
81 } 81 }
82 82
83 if (nRet < 0) 83 if (nRet < 0)
84 { 84 {
85 CFX_WideString sLine; 85 CFX_WideString sLine;
86 sLine.Format(L"[ Line: %05d { %s } ] : %s",error.linnum-1,error. srcline,error.message); 86 sLine.Format(L"[ Line: %05d { %s } ] : %s",error.linnum-1,error. srcline,error.message);
87 87
88 // TRACE(L"/* -------------- JS Error -------------- */\n") ; 88 // TRACE(L"/* -------------- JS Error -------------- */\n") ;
89 // TRACE(sLine); 89 // TRACE(sLine);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 ASSERT(m_pEventHandler != NULL); 347 ASSERT(m_pEventHandler != NULL);
348 m_pEventHandler->OnBatchExec(pTarget); 348 m_pEventHandler->OnBatchExec(pTarget);
349 } 349 }
350 350
351 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget,const CFX_WideString& st rTargetName) 351 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget,const CFX_WideString& st rTargetName)
352 { 352 {
353 ASSERT(m_pEventHandler != NULL); 353 ASSERT(m_pEventHandler != NULL);
354 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName); 354 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName);
355 } 355 }
356 356
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Field.cpp ('k') | fpdfsdk/src/javascript/JS_GlobalData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698