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

Side by Side Diff: fpdfsdk/src/javascript/PublicMethods.h

Issue 1603173004: Merge to XFA: Bugs in CJS_PublicMethods::ParseNumber(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 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/JS_Value.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.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 #ifndef FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
8 #define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ 8 #define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
9 9
10 #include "JS_Define.h" 10 #include "JS_Define.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 int& nSkip, 137 int& nSkip,
138 int nMaxStep); 138 int nMaxStep);
139 static CFX_WideString ParseStringString(const CFX_WideString& string, 139 static CFX_WideString ParseStringString(const CFX_WideString& string,
140 int nStart, 140 int nStart,
141 int& nSkip); 141 int& nSkip);
142 static double MakeRegularDate(const CFX_WideString& value, 142 static double MakeRegularDate(const CFX_WideString& value,
143 const CFX_WideString& format, 143 const CFX_WideString& format,
144 bool* bWrongFormat); 144 bool* bWrongFormat);
145 static CFX_WideString MakeFormatDate(double dDate, 145 static CFX_WideString MakeFormatDate(double dDate,
146 const CFX_WideString& format); 146 const CFX_WideString& format);
147 static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource,
148 double& dRet,
149 FX_BOOL& bDot);
150 static double ParseStringToNumber(const FX_WCHAR* swSource);
151 static double ParseNormalDate(const CFX_WideString& value, 147 static double ParseNormalDate(const CFX_WideString& value,
152 bool* bWrongFormat); 148 bool* bWrongFormat);
153 static double MakeInterDate(CFX_WideString strValue); 149 static double MakeInterDate(CFX_WideString strValue);
154 static double ParseNumber(const FX_WCHAR* swSource,
155 FX_BOOL& bAllDigits,
156 FX_BOOL& bDot,
157 FX_BOOL& bSign,
158 FX_BOOL& bKXJS);
159 150
160 public: 151 public:
161 static CFX_WideString StrLTrim(const FX_WCHAR* pStr); 152 static CFX_WideString StrLTrim(const FX_WCHAR* pStr);
162 static CFX_WideString StrRTrim(const FX_WCHAR* pStr); 153 static CFX_WideString StrRTrim(const FX_WCHAR* pStr);
163 static CFX_WideString StrTrim(const FX_WCHAR* pStr); 154 static CFX_WideString StrTrim(const FX_WCHAR* pStr);
164 155
165 static CFX_ByteString StrLTrim(const FX_CHAR* pStr); 156 static CFX_ByteString StrLTrim(const FX_CHAR* pStr);
166 static CFX_ByteString StrRTrim(const FX_CHAR* pStr); 157 static CFX_ByteString StrRTrim(const FX_CHAR* pStr);
167 static CFX_ByteString StrTrim(const FX_CHAR* pStr); 158 static CFX_ByteString StrTrim(const FX_CHAR* pStr);
168 159
169 static FX_BOOL IsNumber(const FX_CHAR* string); 160 static FX_BOOL IsNumber(const FX_CHAR* string);
170 static FX_BOOL IsNumber(const FX_WCHAR* string); 161 static FX_BOOL IsNumber(const FX_WCHAR* string);
171 162
172 static FX_BOOL maskSatisfied(wchar_t c_Change, wchar_t c_Mask); 163 static FX_BOOL maskSatisfied(wchar_t c_Change, wchar_t c_Mask);
173 static FX_BOOL isReservedMaskChar(wchar_t ch); 164 static FX_BOOL isReservedMaskChar(wchar_t ch);
174 165
175 static double AF_Simple(const FX_WCHAR* sFuction, 166 static double AF_Simple(const FX_WCHAR* sFuction,
176 double dValue1, 167 double dValue1,
177 double dValue2); 168 double dValue2);
178 static CJS_Array AF_MakeArrayFromList(CJS_Runtime* pRuntime, CJS_Value val); 169 static CJS_Array AF_MakeArrayFromList(CJS_Runtime* pRuntime, CJS_Value val);
179 }; 170 };
180 171
181 #endif // FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ 172 #endif // FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/JS_Value.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698