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

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

Issue 1841643002: Code change to avoid signed/unsigned mismatch warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase 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/javascript/Field.cpp ('k') | no next file » | 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 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 pEvent->Rc() = FALSE; 1495 pEvent->Rc() = FALSE;
1496 } 1496 }
1497 return TRUE; 1497 return TRUE;
1498 } 1498 }
1499 1499
1500 CFX_WideString& wideChange = pEvent->Change(); 1500 CFX_WideString& wideChange = pEvent->Change();
1501 std::wstring wChange = wideChange.c_str(); 1501 std::wstring wChange = wideChange.c_str();
1502 if (wChange.empty()) 1502 if (wChange.empty())
1503 return TRUE; 1503 return TRUE;
1504 1504
1505 int iIndexMask = pEvent->SelStart(); 1505 size_t iIndexMask = pEvent->SelStart();
1506 1506
1507 size_t combined_len = wstrValue.length() + wChange.length() - 1507 size_t combined_len = wstrValue.length() + wChange.length() -
1508 (pEvent->SelEnd() - pEvent->SelStart()); 1508 (pEvent->SelEnd() - pEvent->SelStart());
1509 if (combined_len > wstrMaskLen) { 1509 if (combined_len > wstrMaskLen) {
1510 Alert(pContext, 1510 Alert(pContext,
1511 JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str()); 1511 JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str());
1512 pEvent->Rc() = FALSE; 1512 pEvent->Rc() = FALSE;
1513 return TRUE; 1513 return TRUE;
1514 } 1514 }
1515 1515
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 nums.SetElement(nIndex, CJS_Value(pRuntime, sPart.c_str())); 1875 nums.SetElement(nIndex, CJS_Value(pRuntime, sPart.c_str()));
1876 } 1876 }
1877 1877
1878 if (nums.GetLength() > 0) 1878 if (nums.GetLength() > 0)
1879 vRet = nums; 1879 vRet = nums;
1880 else 1880 else
1881 vRet.SetNull(); 1881 vRet.SetNull();
1882 1882
1883 return TRUE; 1883 return TRUE;
1884 } 1884 }
OLDNEW
« no previous file with comments | « fpdfsdk/javascript/Field.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698