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

Side by Side Diff: fpdfsdk/src/javascript/Document.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/Consts.cpp ('k') | fpdfsdk/src/javascript/Field.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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; 330 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
331 331
332 FX_BOOL bAllFields = params.size() > 0 ? (FX_BOOL)params[0] : FALSE; 332 FX_BOOL bAllFields = params.size() > 0 ? (FX_BOOL)params[0] : FALSE;
333 FX_BOOL bNoPassWord = params.size() > 1 ? (FX_BOOL)params[1] : TRUE; 333 FX_BOOL bNoPassWord = params.size() > 1 ? (FX_BOOL)params[1] : TRUE;
334 FX_BOOL bWhole = params.size() > 2 ? (params[2].GetType() == VT_null) : TRUE; 334 FX_BOOL bWhole = params.size() > 2 ? (params[2].GetType() == VT_null) : TRUE;
335 CJS_Array arrayFileds(isolate); 335 CJS_Array arrayFileds(isolate);
336 if (!bWhole) 336 if (!bWhole)
337 arrayFileds.Attach(params[2]); 337 arrayFileds.Attach(params[2]);
338 //FX_BOOL bFlags = params.size() > 3 ? (FX_BOOL)params[3] : FALSE; 338 //FX_BOOL bFlags = params.size() > 3 ? (FX_BOOL)params[3] : FALSE;
339 » CFX_WideString swFilePath = params.size() > 4 ? (FX_LPCWSTR)params[4].op erator CFX_WideString() : (FX_LPCWSTR)L""; 339 » CFX_WideString swFilePath = params.size() > 4 ? (FX_LPCWSTR)params[4].op erator CFX_WideString() : L"";
340 340
341 if (swFilePath.IsEmpty()) 341 if (swFilePath.IsEmpty())
342 { 342 {
343 CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); 343 CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
344 swFilePath = pEnv->JS_fieldBrowse(); 344 swFilePath = pEnv->JS_fieldBrowse();
345 if(swFilePath.IsEmpty()) 345 if(swFilePath.IsEmpty())
346 return TRUE; 346 return TRUE;
347 } 347 }
348 else 348 else
349 { 349 {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 577
578 FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS) 578 FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS)
579 { 579 {
580 ASSERT(m_pDocument != NULL); 580 ASSERT(m_pDocument != NULL);
581 581
582 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE; 582 if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
583 583
584 int iLength = params.size(); 584 int iLength = params.size();
585 585
586 FX_BOOL bUI = iLength > 0 ? (FX_BOOL)params[0] : TRUE; 586 FX_BOOL bUI = iLength > 0 ? (FX_BOOL)params[0] : TRUE;
587 » CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_Wi deString() : (FX_LPCWSTR)L""; 587 » CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_Wi deString() : L"";
588 » CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_Wi deString() : (FX_LPCWSTR)L""; 588 » CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_Wi deString() : L"";
589 » CFX_WideString cBcc = iLength > 3 ? (FX_LPCWSTR)params[3].operator CFX_W ideString() : (FX_LPCWSTR)L""; 589 » CFX_WideString cBcc = iLength > 3 ? (FX_LPCWSTR)params[3].operator CFX_W ideString() : L"";
590 » CFX_WideString cSubject = iLength > 4 ? (FX_LPCWSTR)params[4].operator C FX_WideString() : (FX_LPCWSTR)L""; 590 » CFX_WideString cSubject = iLength > 4 ? (FX_LPCWSTR)params[4].operator C FX_WideString() : L"";
591 » CFX_WideString cMsg = iLength > 5 ? (FX_LPCWSTR)params[5].operator CFX_W ideString() : (FX_LPCWSTR)L""; 591 » CFX_WideString cMsg = iLength > 5 ? (FX_LPCWSTR)params[5].operator CFX_W ideString() : L"";
592 592
593 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte rForm(); 593 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte rForm();
594 ASSERT(pInterForm != NULL); 594 ASSERT(pInterForm != NULL);
595 595
596 CFX_ByteTextBuf textBuf; 596 CFX_ByteTextBuf textBuf;
597 if (!pInterForm->ExportFormToFDFTextBuf(textBuf)) 597 if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
598 return FALSE; 598 return FALSE;
599 599
600 CJS_Context* pContext = (CJS_Context*)cc; 600 CJS_Context* pContext = (CJS_Context*)cc;
601 ASSERT(pContext != NULL); 601 ASSERT(pContext != NULL);
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 2525
2526 void Document::DoAnnotDelay() 2526 void Document::DoAnnotDelay()
2527 { 2527 {
2528 CFX_DWordArray DelArray; 2528 CFX_DWordArray DelArray;
2529 2529
2530 for (int j=DelArray.GetSize()-1; j>=0; j--) 2530 for (int j=DelArray.GetSize()-1; j>=0; j--)
2531 { 2531 {
2532 m_DelayData.RemoveAt(DelArray[j]); 2532 m_DelayData.RemoveAt(DelArray[j]);
2533 } 2533 }
2534 } 2534 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Consts.cpp ('k') | fpdfsdk/src/javascript/Field.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698