Index: core/src/fpdftext/fpdf_text_int.cpp |
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp |
index a0f0c6482230ab2d29ed221030b5de90e8f0db77..a4891c1caf22a952a6a173494bdefc00601fa0d0 100644 |
--- a/core/src/fpdftext/fpdf_text_int.cpp |
+++ b/core/src/fpdftext/fpdf_text_int.cpp |
@@ -1999,7 +1999,7 @@ FX_BOOL CPDF_TextPageFind::FindFirst(const CFX_WideString& findwhat, |
} else { |
m_findPreStart = startPos; |
} |
- m_csFindWhatArray.RemoveAll(); |
+ m_csFindWhatArray.clear(); |
int i = 0; |
while (i < len) { |
if (findwhatStr.GetAt(i) != ' ') { |
@@ -2010,9 +2010,9 @@ FX_BOOL CPDF_TextPageFind::FindFirst(const CFX_WideString& findwhat, |
if (i < len) { |
ExtractFindWhat(findwhatStr); |
} else { |
- m_csFindWhatArray.Add(findwhatStr); |
+ m_csFindWhatArray.push_back(findwhatStr); |
} |
- if (m_csFindWhatArray.GetSize() <= 0) { |
+ if (m_csFindWhatArray.empty()) { |
return FALSE; |
} |
m_IsFind = TRUE; |
@@ -2038,7 +2038,7 @@ FX_BOOL CPDF_TextPageFind::FindNext() { |
m_IsFind = FALSE; |
return m_IsFind; |
} |
- int nCount = m_csFindWhatArray.GetSize(); |
+ int nCount = pdfium::CollectionSize<int>(m_csFindWhatArray); |
int nResultPos = 0; |
int nStartPos = 0; |
nStartPos = m_findNextStart; |
@@ -2113,8 +2113,7 @@ FX_BOOL CPDF_TextPageFind::FindNext() { |
} |
} |
} |
- m_resEnd = nResultPos + |
- m_csFindWhatArray[m_csFindWhatArray.GetSize() - 1].GetLength() - 1; |
+ m_resEnd = nResultPos + m_csFindWhatArray.back().GetLength() - 1; |
m_IsFind = TRUE; |
int resStart = GetCharIndex(m_resStart); |
int resEnd = GetCharIndex(m_resEnd); |
@@ -2186,7 +2185,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { |
ExtractSubString(csWord, findwhat.c_str(), index, TEXT_BLANK_CHAR); |
if (csWord.IsEmpty()) { |
if (ret) { |
- m_csFindWhatArray.Add(CFX_WideString(L"")); |
+ m_csFindWhatArray.push_back(L""); |
index++; |
continue; |
} else { |
@@ -2203,10 +2202,9 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { |
continue; |
} |
if (pos > 0) { |
- CFX_WideString preStr = csWord.Mid(0, pos); |
- m_csFindWhatArray.Add(preStr); |
+ m_csFindWhatArray.push_back(csWord.Mid(0, pos)); |
} |
- m_csFindWhatArray.Add(curStr); |
+ m_csFindWhatArray.push_back(curStr); |
if (pos == csWord.GetLength() - 1) { |
csWord.Empty(); |
break; |
@@ -2218,7 +2216,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { |
pos++; |
} |
if (!csWord.IsEmpty()) { |
- m_csFindWhatArray.Add(csWord); |
+ m_csFindWhatArray.push_back(csWord); |
} |
index++; |
} |