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

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

Issue 726143002: Remove FX_LPCWSTR cast to wchar_t* literals (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 1 month 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/PublicMethods.cpp ('k') | fpdfsdk/src/javascript/util.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_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_Object.h" 10 #include "../../include/javascript/JS_Object.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 { 505 {
506 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME RROR); 506 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME RROR);
507 return FALSE; 507 return FALSE;
508 } 508 }
509 509
510 CJS_Context* pContext = (CJS_Context*)cc; 510 CJS_Context* pContext = (CJS_Context*)cc;
511 ASSERT(pContext != NULL); 511 ASSERT(pContext != NULL);
512 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); 512 CJS_Runtime* pRuntime = pContext->GetJSRuntime();
513 ASSERT(pRuntime != NULL); 513 ASSERT(pRuntime != NULL);
514 514
515 » CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].oper ator CFX_WideString()) : (FX_LPCWSTR)L""; 515 » CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].oper ator CFX_WideString()) : L"";
516 if (script.IsEmpty()) 516 if (script.IsEmpty())
517 { 517 {
518 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMB ER_KEYSTROKE); 518 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMB ER_KEYSTROKE);
519 return TRUE; 519 return TRUE;
520 } 520 }
521 521
522 FX_DWORD dwInterval = params.size() > 1 ? (int)params[1] : 1000; 522 FX_DWORD dwInterval = params.size() > 1 ? (int)params[1] : 1000;
523 523
524 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp(); 524 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
525 ASSERT(pApp); 525 ASSERT(pApp);
(...skipping 28 matching lines...) Expand all
554 { 554 {
555 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME RROR); 555 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME RROR);
556 return FALSE; 556 return FALSE;
557 } 557 }
558 558
559 CJS_Context* pContext = (CJS_Context*)cc; 559 CJS_Context* pContext = (CJS_Context*)cc;
560 ASSERT(pContext != NULL); 560 ASSERT(pContext != NULL);
561 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); 561 CJS_Runtime* pRuntime = pContext->GetJSRuntime();
562 ASSERT(pRuntime != NULL); 562 ASSERT(pRuntime != NULL);
563 563
564 » CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].oper ator CFX_WideString()) : (FX_LPCWSTR)L""; 564 » CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].oper ator CFX_WideString()) : L"";
565 if (script.IsEmpty()) 565 if (script.IsEmpty())
566 { 566 {
567 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMB ER_KEYSTROKE); 567 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMB ER_KEYSTROKE);
568 return TRUE; 568 return TRUE;
569 } 569 }
570 570
571 FX_DWORD dwTimeOut = params.size() > 1 ? (int)params[1] : 1000; 571 FX_DWORD dwTimeOut = params.size() > 1 ? (int)params[1] : 1000;
572 572
573 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp(); 573 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
574 ASSERT(pApp); 574 ASSERT(pApp);
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 //strLPath = "D:\temporay.fdf"; 982 //strLPath = "D:\temporay.fdf";
983 CFX_WideString strOPath = sOldPath; 983 CFX_WideString strOPath = sOldPath;
984 strOPath.TrimLeft(); 984 strOPath.TrimLeft();
985 strOPath.TrimRight(); 985 strOPath.TrimRight();
986 986
987 if (strOPath.GetAt(0) == L'/' && strOPath.GetAt(2) == L'/') 987 if (strOPath.GetAt(0) == L'/' && strOPath.GetAt(2) == L'/')
988 { 988 {
989 wchar_t c_Drive = strOPath.GetAt(1); 989 wchar_t c_Drive = strOPath.GetAt(1);
990 if ((c_Drive >= L'a' && c_Drive <= L'z' )||( c_Drive >= L'A' && c_Drive <= L'Z')) 990 if ((c_Drive >= L'a' && c_Drive <= L'z' )||( c_Drive >= L'A' && c_Drive <= L'Z'))
991 { 991 {
992 » » » strOPath.Replace((FX_LPCWSTR)L"/",(FX_LPCWSTR)L"\\"); 992 » » » strOPath.Replace(L"/",L"\\");
993 //strOPath.SetAt(0,''); 993 //strOPath.SetAt(0,'');
994 strOPath.Insert(2,':'); 994 strOPath.Insert(2,':');
995 strOPath.Delete(0); 995 strOPath.Delete(0);
996 } 996 }
997 } 997 }
998 998
999 return strOPath; 999 return strOPath;
1000 } 1000 }
1001 1001
1002 CFX_WideString app::RelativePathToSysPath(const CFX_WideString& sOldPath, const CFX_WideString& sFilePath) 1002 CFX_WideString app::RelativePathToSysPath(const CFX_WideString& sOldPath, const CFX_WideString& sFilePath)
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 FX_BOOL app::media(OBJ_PROP_PARAMS) 1113 FX_BOOL app::media(OBJ_PROP_PARAMS)
1114 { 1114 {
1115 return FALSE; 1115 return FALSE;
1116 } 1116 }
1117 1117
1118 FX_BOOL app::execDialog(OBJ_METHOD_PARAMS) 1118 FX_BOOL app::execDialog(OBJ_METHOD_PARAMS)
1119 { 1119 {
1120 return TRUE; 1120 return TRUE;
1121 } 1121 }
1122 1122
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/PublicMethods.cpp ('k') | fpdfsdk/src/javascript/util.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698