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

Side by Side Diff: fpdfsdk/javascript/PublicMethods.cpp

Issue 1882043004: Remove implicit cast from CFX_WideString to (const wchar_t*) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: win error #2 Created 4 years, 8 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/fsdk_baseform.cpp ('k') | fpdfsdk/javascript/public_methods_embeddertest.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 "fpdfsdk/javascript/PublicMethods.h" 7 #include "fpdfsdk/javascript/PublicMethods.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 const std::vector<CJS_Value>& params, 1647 const std::vector<CJS_Value>& params,
1648 CJS_Value& vRet, 1648 CJS_Value& vRet,
1649 CFX_WideString& sError) { 1649 CFX_WideString& sError) {
1650 CJS_Context* pContext = (CJS_Context*)cc; 1650 CJS_Context* pContext = (CJS_Context*)cc;
1651 if (params.size() != 1) { 1651 if (params.size() != 1) {
1652 sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); 1652 sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
1653 return FALSE; 1653 return FALSE;
1654 } 1654 }
1655 CFX_WideString ws = params[0].ToCFXWideString(); 1655 CFX_WideString ws = params[0].ToCFXWideString();
1656 ws.Replace(L",", L"."); 1656 ws.Replace(L",", L".");
1657 vRet = ws; 1657 vRet = ws.c_str();
1658 vRet.MaybeCoerceToNumber(); 1658 vRet.MaybeCoerceToNumber();
1659 if (vRet.GetType() != CJS_Value::VT_number) 1659 if (vRet.GetType() != CJS_Value::VT_number)
1660 vRet = 0; 1660 vRet = 0;
1661 return TRUE; 1661 return TRUE;
1662 } 1662 }
1663 1663
1664 FX_BOOL CJS_PublicMethods::AFSimple_Calculate( 1664 FX_BOOL CJS_PublicMethods::AFSimple_Calculate(
1665 IJS_Context* cc, 1665 IJS_Context* cc,
1666 const std::vector<CJS_Value>& params, 1666 const std::vector<CJS_Value>& params,
1667 CJS_Value& vRet, 1667 CJS_Value& vRet,
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 nums.SetElement(nIndex, CJS_Value(pRuntime, sPart.c_str())); 1845 nums.SetElement(nIndex, CJS_Value(pRuntime, sPart.c_str()));
1846 } 1846 }
1847 1847
1848 if (nums.GetLength() > 0) 1848 if (nums.GetLength() > 0)
1849 vRet = nums; 1849 vRet = nums;
1850 else 1850 else
1851 vRet.SetNull(); 1851 vRet.SetNull();
1852 1852
1853 return TRUE; 1853 return TRUE;
1854 } 1854 }
OLDNEW
« no previous file with comments | « fpdfsdk/fsdk_baseform.cpp ('k') | fpdfsdk/javascript/public_methods_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698