summaryrefslogtreecommitdiff
path: root/chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-12 14:07:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-17 10:29:26 +0000
commitec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch)
tree25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp
parentbb09965444b5bb20b096a291445170876225268d (diff)
downloadqtwebengine-chromium-ec02ee4181c49b61fce1c8fb99292dbb8139cc90.tar.gz
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp')
-rw-r--r--chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp b/chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp
index a79b5e7e8a1..7eaac35194e 100644
--- a/chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp
+++ b/chromium/third_party/pdfium/core/fpdftext/cpdf_textpagefind.cpp
@@ -17,7 +17,7 @@
namespace {
-bool IsIgnoreSpaceCharacter(FX_WCHAR curChar) {
+bool IsIgnoreSpaceCharacter(wchar_t curChar) {
if (curChar < 255 || (curChar >= 0x0600 && curChar <= 0x06FF) ||
(curChar >= 0xFE70 && curChar <= 0xFEFF) ||
(curChar >= 0xFB50 && curChar <= 0xFDFF) ||
@@ -150,7 +150,7 @@ bool CPDF_TextPageFind::FindNext() {
CFX_WideString csWord = m_csFindWhatArray[iWord];
if (csWord.IsEmpty()) {
if (iWord == nCount - 1) {
- FX_WCHAR strInsert = m_strText.GetAt(nStartPos);
+ wchar_t strInsert = m_strText.GetAt(nStartPos);
if (strInsert == TEXT_LINEFEED_CHAR || strInsert == TEXT_SPACE_CHAR ||
strInsert == TEXT_RETURN_CHAR || strInsert == 160) {
nResultPos = nStartPos + 1;
@@ -183,7 +183,7 @@ bool CPDF_TextPageFind::FindNext() {
bMatch = false;
}
for (int d = PreResEndPos; d < nResultPos; d++) {
- FX_WCHAR strInsert = m_strText.GetAt(d);
+ wchar_t strInsert = m_strText.GetAt(d);
if (strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_SPACE_CHAR &&
strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
bMatch = false;
@@ -192,7 +192,7 @@ bool CPDF_TextPageFind::FindNext() {
}
} else if (bSpaceStart) {
if (nResultPos > 0) {
- FX_WCHAR strInsert = m_strText.GetAt(nResultPos - 1);
+ wchar_t strInsert = m_strText.GetAt(nResultPos - 1);
if (strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_SPACE_CHAR &&
strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
bMatch = false;
@@ -293,7 +293,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) {
int pos = 0;
while (pos < csWord.GetLength()) {
CFX_WideString curStr = csWord.Mid(pos, 1);
- FX_WCHAR curChar = csWord.GetAt(pos);
+ wchar_t curChar = csWord.GetAt(pos);
if (IsIgnoreSpaceCharacter(curChar)) {
if (pos > 0 && curChar == 0x2019) {
pos++;
@@ -321,8 +321,8 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) {
bool CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText,
int startPos,
int endPos) {
- FX_WCHAR char_left = 0;
- FX_WCHAR char_right = 0;
+ wchar_t char_left = 0;
+ wchar_t char_right = 0;
int char_count = endPos - startPos + 1;
if (char_count < 1)
return false;
@@ -362,9 +362,9 @@ bool CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText,
}
bool CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString,
- const FX_WCHAR* lpszFullString,
+ const wchar_t* lpszFullString,
int iSubString,
- FX_WCHAR chSep) {
+ wchar_t chSep) {
if (!lpszFullString)
return false;
while (iSubString--) {
@@ -377,12 +377,11 @@ bool CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString,
while (*lpszFullString == chSep)
lpszFullString++;
}
- const FX_WCHAR* lpchEnd = std::wcschr(lpszFullString, chSep);
+ const wchar_t* lpchEnd = std::wcschr(lpszFullString, chSep);
int nLen = lpchEnd ? (int)(lpchEnd - lpszFullString)
: (int)FXSYS_wcslen(lpszFullString);
ASSERT(nLen >= 0);
- FXSYS_memcpy(rString.GetBuffer(nLen), lpszFullString,
- nLen * sizeof(FX_WCHAR));
+ memcpy(rString.GetBuffer(nLen), lpszFullString, nLen * sizeof(wchar_t));
rString.ReleaseBuffer();
return true;
}