| OLD | NEW |
| 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 "PublicMethods.h" | 7 #include "PublicMethods.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 sFormat.c_str()); | 1194 sFormat.c_str()); |
| 1195 Alert(pContext, swMsg.c_str()); | 1195 Alert(pContext, swMsg.c_str()); |
| 1196 return FALSE; | 1196 return FALSE; |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 val = MakeFormatDate(dDate, sFormat); | 1199 val = MakeFormatDate(dDate, sFormat); |
| 1200 return TRUE; | 1200 return TRUE; |
| 1201 } | 1201 } |
| 1202 | 1202 |
| 1203 double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) { | 1203 double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) { |
| 1204 CFX_WideStringArray wsArray; | 1204 std::vector<CFX_WideString> wsArray; |
| 1205 CFX_WideString sTemp = L""; | 1205 CFX_WideString sTemp = L""; |
| 1206 for (int i = 0; i < strValue.GetLength(); ++i) { | 1206 for (int i = 0; i < strValue.GetLength(); ++i) { |
| 1207 FX_WCHAR c = strValue.GetAt(i); | 1207 FX_WCHAR c = strValue.GetAt(i); |
| 1208 if (c == L' ' || c == L':') { | 1208 if (c == L' ' || c == L':') { |
| 1209 wsArray.Add(sTemp); | 1209 wsArray.push_back(sTemp); |
| 1210 sTemp = L""; | 1210 sTemp = L""; |
| 1211 continue; | 1211 continue; |
| 1212 } | 1212 } |
| 1213 sTemp += c; | 1213 sTemp += c; |
| 1214 } | 1214 } |
| 1215 wsArray.Add(sTemp); | 1215 wsArray.push_back(sTemp); |
| 1216 if (wsArray.GetSize() != 8) | 1216 if (wsArray.size() != 8) |
| 1217 return 0; | 1217 return 0; |
| 1218 | 1218 |
| 1219 int nMonth = 1; | 1219 int nMonth = 1; |
| 1220 sTemp = wsArray[1]; | 1220 sTemp = wsArray[1]; |
| 1221 if (sTemp.Compare(L"Jan") == 0) | 1221 if (sTemp.Compare(L"Jan") == 0) |
| 1222 nMonth = 1; | 1222 nMonth = 1; |
| 1223 else if (sTemp.Compare(L"Feb") == 0) | 1223 else if (sTemp.Compare(L"Feb") == 0) |
| 1224 nMonth = 2; | 1224 nMonth = 2; |
| 1225 else if (sTemp.Compare(L"Mar") == 0) | 1225 else if (sTemp.Compare(L"Mar") == 0) |
| 1226 nMonth = 3; | 1226 nMonth = 3; |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 nums.SetElement(nIndex, CJS_Value(pRuntime, sPart.c_str())); | 1906 nums.SetElement(nIndex, CJS_Value(pRuntime, sPart.c_str())); |
| 1907 } | 1907 } |
| 1908 | 1908 |
| 1909 if (nums.GetLength() > 0) | 1909 if (nums.GetLength() > 0) |
| 1910 vRet = nums; | 1910 vRet = nums; |
| 1911 else | 1911 else |
| 1912 vRet.SetNull(); | 1912 vRet.SetNull(); |
| 1913 | 1913 |
| 1914 return TRUE; | 1914 return TRUE; |
| 1915 } | 1915 } |
| OLD | NEW |