summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtpage.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-16 16:37:37 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-17 15:42:24 +0000
commite30e9cc05b62b046e5299ecc058957d93d2c68ea (patch)
tree28c192b5ecec3ca490082e0bfe435e895cf67dc4 /xfa/fde/cfde_txtedtpage.cpp
parentb3e7bfa6ed35651a22df314352883ccb44a7203d (diff)
downloadpdfium-e30e9cc05b62b046e5299ecc058957d93d2c68ea.tar.xz
Unify GetTextLength and GetTextBufLength in CFDE_TxtEdtEngine
The GetTextLength method just proxies to GetTextBufLength. This CL removes GetTextBufLength and puts the functionality into GetTextLength. Change-Id: If324fbeddd05cd63570b6942dc613e273a1fbce7 Reviewed-on: https://pdfium-review.googlesource.com/11272 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtpage.cpp')
-rw-r--r--xfa/fde/cfde_txtedtpage.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp
index e00d2daa79..cbc652da76 100644
--- a/xfa/fde/cfde_txtedtpage.cpp
+++ b/xfa/fde/cfde_txtedtpage.cpp
@@ -92,9 +92,9 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) {
for (int32_t j = 0; j < nRtCount; j++) {
if (rectArr[j].Contains(ptF)) {
nCaret = m_nPageStart + pPiece->nStart + j;
- if (nCaret >= m_pEditEngine->GetTextBufLength()) {
+ if (nCaret >= m_pEditEngine->GetTextLength()) {
bBefore = true;
- return m_pEditEngine->GetTextBufLength();
+ return m_pEditEngine->GetTextLength();
}
wchar_t wChar = m_pEditEngine->GetTextBuf()->GetCharByIndex(nCaret);
if (wChar == L'\n' || wChar == L'\r') {
@@ -165,8 +165,8 @@ int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF& fPoint, int32_t& nCount) {
CFDE_TxtEdtBuf* pBuf = m_pEditEngine->GetTextBuf();
bool bBefore;
int32_t nIndex = GetCharIndex(fPoint, bBefore);
- if (nIndex == m_pEditEngine->GetTextBufLength()) {
- nIndex = m_pEditEngine->GetTextBufLength() - 1;
+ if (nIndex == m_pEditEngine->GetTextLength()) {
+ nIndex = m_pEditEngine->GetTextLength() - 1;
}
if (nIndex < 0) {
return -1;