From 275e260a6cd4a8e506ba974feb85ebcd926c1739 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 18 Sep 2017 14:23:18 -0400 Subject: Convert string class names Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez Commit-Queue: Ryan Harrison --- core/fpdftext/cpdf_textpagefind.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/fpdftext/cpdf_textpagefind.cpp') diff --git a/core/fpdftext/cpdf_textpagefind.cpp b/core/fpdftext/cpdf_textpagefind.cpp index 3678e42515..f00b8a9f4d 100644 --- a/core/fpdftext/cpdf_textpagefind.cpp +++ b/core/fpdftext/cpdf_textpagefind.cpp @@ -79,14 +79,14 @@ int CPDF_TextPageFind::GetCharIndex(int index) const { return m_pTextPage->CharIndexFromTextIndex(index); } -bool CPDF_TextPageFind::FindFirst(const CFX_WideString& findwhat, +bool CPDF_TextPageFind::FindFirst(const WideString& findwhat, int flags, pdfium::Optional startPos) { if (!m_pTextPage) return false; if (m_strText.IsEmpty() || m_bMatchCase != (flags & FPDFTEXT_MATCHCASE)) m_strText = m_pTextPage->GetPageText(); - CFX_WideString findwhatStr = findwhat; + WideString findwhatStr = findwhat; m_findWhat = findwhatStr; m_flags = flags; m_bMatchCase = flags & FPDFTEXT_MATCHCASE; @@ -147,7 +147,7 @@ bool CPDF_TextPageFind::FindNext() { FX_STRSIZE nStartPos = m_findNextStart.value(); bool bSpaceStart = false; for (int iWord = 0; iWord < nCount; iWord++) { - CFX_WideString csWord = m_csFindWhatArray[iWord]; + WideString csWord = m_csFindWhatArray[iWord]; if (csWord.IsEmpty()) { if (iWord == nCount - 1) { wchar_t strInsert = m_strText[nStartPos]; @@ -175,7 +175,7 @@ bool CPDF_TextPageFind::FindNext() { if (iWord != 0 && !bSpaceStart) { FX_STRSIZE PreResEndPos = nStartPos; int curChar = csWord[0]; - CFX_WideString lastWord = m_csFindWhatArray[iWord - 1]; + WideString lastWord = m_csFindWhatArray[iWord - 1]; int lastChar = lastWord[lastWord.GetLength() - 1]; if (nStartPos == nResultPos.value() && !(IsIgnoreSpaceCharacter(lastChar) || @@ -275,12 +275,12 @@ bool CPDF_TextPageFind::FindPrev() { return m_IsFind; } -void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { +void CPDF_TextPageFind::ExtractFindWhat(const WideString& findwhat) { if (findwhat.IsEmpty()) return; int index = 0; while (1) { - CFX_WideString csWord = TEXT_EMPTY; + WideString csWord = TEXT_EMPTY; int ret = ExtractSubString(csWord, findwhat.c_str(), index, TEXT_SPACE_CHAR); if (csWord.IsEmpty()) { @@ -294,7 +294,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { } FX_STRSIZE pos = 0; while (pos < csWord.GetLength()) { - CFX_WideString curStr = csWord.Mid(pos, 1); + WideString curStr = csWord.Mid(pos, 1); wchar_t curChar = csWord[pos]; if (IsIgnoreSpaceCharacter(curChar)) { if (pos > 0 && curChar == 0x2019) { @@ -320,7 +320,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { } } -bool CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText, +bool CPDF_TextPageFind::IsMatchWholeWord(const WideString& csPageText, FX_STRSIZE startPos, FX_STRSIZE endPos) { if (startPos > endPos) @@ -360,7 +360,7 @@ bool CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText, return true; } -bool CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, +bool CPDF_TextPageFind::ExtractSubString(WideString& rString, const wchar_t* lpszFullString, int iSubString, wchar_t chSep) { -- cgit v1.2.3