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

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

Issue 1701883004: Banish CFX_ByteStringArray and CFX_WideStringArray to the XFA side. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits Created 4 years, 10 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/fsdk_mgr.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Edit.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 "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
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_mgr.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Edit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698