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

Unified Diff: core/src/fpdftext/fpdf_text_int.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfdoc/doc_form.cpp ('k') | core/src/fpdftext/text_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b6e39de004d427f8764900e39d3404e9a52fb80a..aa13acee8ad2c383af7aa99022f7b6c165d8c575 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -1988,7 +1988,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) != ' ') {
@@ -1999,9 +1999,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;
@@ -2027,7 +2027,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;
@@ -2102,8 +2102,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);
@@ -2175,7 +2174,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 {
@@ -2192,10 +2191,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;
@@ -2207,7 +2205,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) {
pos++;
}
if (!csWord.IsEmpty()) {
- m_csFindWhatArray.Add(csWord);
+ m_csFindWhatArray.push_back(csWord);
}
index++;
}
« no previous file with comments | « core/src/fpdfdoc/doc_form.cpp ('k') | core/src/fpdftext/text_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698