summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfedittext.cpp2
-rw-r--r--fpdfsdk/fpdfppo.cpp12
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp22
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp9
4 files changed, 23 insertions, 22 deletions
diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdfedittext.cpp
index 02bf722462..f498917a19 100644
--- a/fpdfsdk/fpdfedittext.cpp
+++ b/fpdfsdk/fpdfedittext.cpp
@@ -39,7 +39,7 @@ CPDF_Dictionary* LoadFontDesc(CPDF_Document* pDoc,
int flags = 0;
if (FXFT_Is_Face_fixedwidth(pFont->GetFace()))
flags |= FXFONT_FIXED_PITCH;
- if (font_name.Find("Serif") > -1)
+ if (font_name.Find("Serif") != FX_STRNPOS)
flags |= FXFONT_SERIF;
if (FXFT_Is_Face_Italic(pFont->GetFace()))
flags |= FXFONT_ITALIC;
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index beab7d87d3..bf52932a1d 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -80,20 +80,20 @@ bool ParserPageRangeString(CFX_ByteString rangstring,
int nLength = rangstring.GetLength();
CFX_ByteString cbCompareString("0123456789-,");
for (int i = 0; i < nLength; ++i) {
- if (cbCompareString.Find(rangstring[i]) == -1)
+ if (cbCompareString.Find(rangstring[i]) == FX_STRNPOS)
return false;
}
CFX_ByteString cbMidRange;
- int nStringFrom = 0;
- int nStringTo = 0;
+ FX_STRSIZE nStringFrom = 0;
+ FX_STRSIZE nStringTo = 0;
while (nStringTo < nLength) {
nStringTo = rangstring.Find(',', nStringFrom);
- if (nStringTo == -1)
+ if (nStringTo == FX_STRNPOS)
nStringTo = nLength;
cbMidRange = rangstring.Mid(nStringFrom, nStringTo - nStringFrom);
- int nMid = cbMidRange.Find('-');
- if (nMid == -1) {
+ FX_STRSIZE nMid = cbMidRange.Find('-');
+ if (nMid == FX_STRNPOS) {
long lPageNum = atol(cbMidRange.c_str());
if (lPageNum <= 0 || lPageNum > nCount)
return false;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 052bed55d2..7cccd2fb11 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -809,19 +809,19 @@ bool CPDFXFA_DocEnvironment::ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
void CPDFXFA_DocEnvironment::ToXFAContentFlags(CFX_WideString csSrcContent,
FPDF_DWORD& flag) {
- if (csSrcContent.Find(L" config ", 0) != -1)
+ if (csSrcContent.Find(L" config ", 0) != FX_STRNPOS)
flag |= FXFA_CONFIG;
- if (csSrcContent.Find(L" template ", 0) != -1)
+ if (csSrcContent.Find(L" template ", 0) != FX_STRNPOS)
flag |= FXFA_TEMPLATE;
- if (csSrcContent.Find(L" localeSet ", 0) != -1)
+ if (csSrcContent.Find(L" localeSet ", 0) != FX_STRNPOS)
flag |= FXFA_LOCALESET;
- if (csSrcContent.Find(L" datasets ", 0) != -1)
+ if (csSrcContent.Find(L" datasets ", 0) != FX_STRNPOS)
flag |= FXFA_DATASETS;
- if (csSrcContent.Find(L" xmpmeta ", 0) != -1)
+ if (csSrcContent.Find(L" xmpmeta ", 0) != FX_STRNPOS)
flag |= FXFA_XMPMETA;
- if (csSrcContent.Find(L" xfdf ", 0) != -1)
+ if (csSrcContent.Find(L" xfdf ", 0) != FX_STRNPOS)
flag |= FXFA_XFDF;
- if (csSrcContent.Find(L" form ", 0) != -1)
+ if (csSrcContent.Find(L" form ", 0) != FX_STRNPOS)
flag |= FXFA_FORM;
if (flag == 0) {
flag = FXFA_CONFIG | FXFA_TEMPLATE | FXFA_LOCALESET | FXFA_DATASETS |
@@ -840,11 +840,11 @@ bool CPDFXFA_DocEnvironment::MailToInfo(CFX_WideString& csURL,
if (srcURL.Left(7).CompareNoCase(L"mailto:") != 0)
return false;
- int pos = srcURL.Find(L'?', 0);
+ FX_STRSIZE pos = srcURL.Find(L'?', 0);
CFX_WideString tmp;
- if (pos == -1) {
+ if (pos == FX_STRNPOS) {
pos = srcURL.Find(L'@', 0);
- if (pos == -1)
+ if (pos == FX_STRNPOS)
return false;
tmp = srcURL.Right(csURL.GetLength() - 7);
@@ -863,7 +863,7 @@ bool CPDFXFA_DocEnvironment::MailToInfo(CFX_WideString& csURL,
srcURL.TrimRight();
pos = srcURL.Find(L'&', 0);
- tmp = (pos == -1) ? srcURL : srcURL.Left(pos);
+ tmp = (pos == FX_STRNPOS) ? srcURL : srcURL.Left(pos);
tmp.TrimLeft();
tmp.TrimRight();
if (tmp.GetLength() >= 3 && tmp.Left(3).CompareNoCase(L"cc=") == 0) {
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 06ed64c7cc..f5d3c68780 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -526,7 +526,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString& value,
CFX_WideString sFullMonths = fullmonths[m];
sFullMonths.MakeLower();
- if (sFullMonths.Find(sMonth.c_str(), 0) != -1) {
+ if (sFullMonths.Find(sMonth.c_str(), 0) != FX_STRNPOS) {
nMonth = m + 1;
i += 4;
j += nSkip;
@@ -932,7 +932,8 @@ bool CJS_PublicMethods::AFNumber_Keystroke(CJS_Runtime* pRuntime,
pEvent->SelEnd() - pEvent->SelStart());
}
- bool bHasSign = wstrValue.Find(L'-') != -1 && wstrSelected.Find(L'-') == -1;
+ bool bHasSign = wstrValue.Find(L'-') != FX_STRNPOS &&
+ wstrSelected.Find(L'-') == FX_STRNPOS;
if (bHasSign) {
// can't insert "change" in front to sign postion.
if (pEvent->SelStart() == 0) {
@@ -946,7 +947,7 @@ bool CJS_PublicMethods::AFNumber_Keystroke(CJS_Runtime* pRuntime,
iSepStyle = 0;
const wchar_t cSep = iSepStyle < 2 ? L'.' : L',';
- bool bHasSep = wstrValue.Find(cSep) != -1;
+ bool bHasSep = wstrValue.Find(cSep) != FX_STRNPOS;
for (FX_STRSIZE i = 0; i < wstrChange.GetLength(); ++i) {
if (wstrChange[i] == cSep) {
if (bHasSep) {
@@ -1111,7 +1112,7 @@ bool CJS_PublicMethods::AFDate_FormatEx(CJS_Runtime* pRuntime,
CFX_WideString sFormat = params[0].ToCFXWideString(pRuntime);
double dDate = 0.0f;
- if (strValue.Find(L"GMT") != -1) {
+ if (strValue.Find(L"GMT") != FX_STRNPOS) {
// for GMT format time
// such as "Tue Aug 11 14:24:16 GMT+08002009"
dDate = MakeInterDate(strValue);