diff options
author | Daniel Hosseinian <dhoss@chromium.org> | 2020-01-28 19:52:32 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2020-01-28 19:52:32 +0000 |
commit | a9a704ed821f7038e56da259166dfe17d95a1cf3 (patch) | |
tree | 36dd7ed7c5b2f73c29d26dfc94dca2fdd983cb87 /core/fpdftext | |
parent | 90f68856f14fc641fa884eca72c0b52a1e723845 (diff) | |
download | pdfium-a9a704ed821f7038e56da259166dfe17d95a1cf3.tar.gz |
Rename Left() and Right() in {Byte,Wide}String{,View} classes
Rename to First() and Last().
Bug: pdfium:1406
Change-Id: I786313c4ea044c9e27e532d9d25ba6c26f9228f4
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/65613
Auto-Submit: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdftext')
-rw-r--r-- | core/fpdftext/cpdf_linkextract.cpp | 6 | ||||
-rw-r--r-- | core/fpdftext/cpdf_textpagefind.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/fpdftext/cpdf_linkextract.cpp b/core/fpdftext/cpdf_linkextract.cpp index 001ff1d11..f822f3bcc 100644 --- a/core/fpdftext/cpdf_linkextract.cpp +++ b/core/fpdftext/cpdf_linkextract.cpp @@ -156,7 +156,7 @@ void CPDF_LinkExtract::ExtractLinks() { if (ch != L')' && ch != L',' && ch != L'>' && ch != L'.') break; - strBeCheck = strBeCheck.Left(strBeCheck.GetLength() - 1); + strBeCheck = strBeCheck.First(strBeCheck.GetLength() - 1); nCount--; } @@ -249,7 +249,7 @@ bool CPDF_LinkExtract::CheckMailLink(WideString* str) { // End extracting for other invalid chars, '.' at the beginning, or // consecutive '.'. size_t removed_len = i == pPos ? i + 1 : i; - *str = str->Right(str->GetLength() - removed_len); + *str = str->Last(str->GetLength() - removed_len); break; } // Found a valid '.'. @@ -282,7 +282,7 @@ bool CPDF_LinkExtract::CheckMailLink(WideString* str) { size_t host_end = i == pPos + 1 ? i - 2 : i - 1; if (pPos > 0 && host_end - aPos.value() >= 3) { // Trim the ending invalid chars if there is at least one '.' and name. - *str = str->Left(host_end + 1); + *str = str->First(host_end + 1); break; } return false; diff --git a/core/fpdftext/cpdf_textpagefind.cpp b/core/fpdftext/cpdf_textpagefind.cpp index d40967007..3df499f73 100644 --- a/core/fpdftext/cpdf_textpagefind.cpp +++ b/core/fpdftext/cpdf_textpagefind.cpp @@ -147,13 +147,13 @@ std::vector<WideString> ExtractFindWhat(const WideString& findwhat) { continue; } if (pos > 0) - findwhat_array.push_back(word->Left(pos)); + findwhat_array.push_back(word->First(pos)); findwhat_array.push_back(curStr); if (pos == word->GetLength() - 1) { word->clear(); break; } - word.emplace(word->Right(word->GetLength() - pos - 1)); + word.emplace(word->Last(word->GetLength() - pos - 1)); pos = 0; continue; } |