summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/PublicMethods.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-11 14:09:35 -0700
committerLei Zhang <thestig@chromium.org>2015-08-11 14:09:35 -0700
commitb9c3197d815295632be4612301ee635e5eb95df1 (patch)
tree2ebc8827ff3908c9514514da97a932ce11440212 /fpdfsdk/src/javascript/PublicMethods.cpp
parent119dc646ff7c108cc7319dbc11e05958d98fadfe (diff)
downloadpdfium-b9c3197d815295632be4612301ee635e5eb95df1.tar.xz
Fix some sign comparison warnings.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1279493003 . (cherry picked from commit b4c2167fff88665089eeab47afa45a9e890060a3) Review URL: https://codereview.chromium.org/1287703002 .
Diffstat (limited to 'fpdfsdk/src/javascript/PublicMethods.cpp')
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 8d7d207c79..f71ea37c20 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -1135,8 +1135,8 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc,
if (-1 != pEvent->SelStart())
w_strSelected = w_strValue2.substr(pEvent->SelStart(),
(pEvent->SelEnd() - pEvent->SelStart()));
- FX_BOOL bHasSign =
- (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
+ bool bHasSign = (w_strValue2.find('-') != std::wstring::npos) &&
+ (w_strSelected.find('-') == std::wstring::npos);
if (bHasSign) {
// can't insert "change" in front to sign postion.
if (pEvent->SelStart() == 0) {
@@ -1159,7 +1159,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc,
break;
}
- FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1);
+ bool bHasSep = (w_strValue2.find(cSep) != std::wstring::npos);
for (std::wstring::iterator it = w_strChange2.begin();
it != w_strChange2.end(); it++) {
if (*it == cSep) {