diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-08-14 15:03:20 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-14 19:57:00 +0000 |
commit | 2d03e604b3979db45f6f2ea8c00c8d7fe0790790 (patch) | |
tree | ca8dd7b7115e66b5e72c1367cb5ddb6923b9dc7c /xfa/fde/cfde_txtedtpage.cpp | |
parent | c068c8e1ac5d41ace2a89827601669e8b573ef48 (diff) | |
download | pdfium-2d03e604b3979db45f6f2ea8c00c8d7fe0790790.tar.xz |
Cleaning up the visual set iterator
This CL starts cleaning up the visual set iterator code.
Change-Id: I643dc9edeeb0c7ff06ccd34a1977f811675413d8
Reviewed-on: https://pdfium-review.googlesource.com/10615
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.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp index 5008ca15ce..bfe30baa19 100644 --- a/xfa/fde/cfde_txtedtpage.cpp +++ b/xfa/fde/cfde_txtedtpage.cpp @@ -40,10 +40,6 @@ CFDE_TxtEdtEngine* CFDE_TxtEdtPage::GetEngine() const { return m_pEditEngine.Get(); } -FDE_VISUALOBJTYPE CFDE_TxtEdtPage::GetType() { - return FDE_VISUALOBJ_Text; -} - CFX_RectF CFDE_TxtEdtPage::GetRect(const FDE_TEXTEDITPIECE& hVisualObj) { return CFX_RectF(); } @@ -411,27 +407,13 @@ const CFX_RectF& CFDE_TxtEdtPage::GetContentsBox() { return m_rtPageContents; } -size_t CFDE_TxtEdtPage::GetFirstPosition() { - return m_Pieces.empty() ? 0 : 1; +size_t CFDE_TxtEdtPage::GetTextPieceCount() const { + return m_pTextSet ? m_Pieces.size() : 0; } -FDE_TEXTEDITPIECE* CFDE_TxtEdtPage::GetNext(size_t* pos, - IFDE_VisualSet*& pVisualSet) { - ASSERT(pos); - - if (!m_pTextSet) { - *pos = 0; - return nullptr; - } - - size_t nPos = *pos; - pVisualSet = m_pTextSet.get(); - if (nPos + 1 > m_Pieces.size()) - *pos = 0; - else - *pos = nPos + 1; - - return &m_Pieces[nPos - 1]; +const FDE_TEXTEDITPIECE& CFDE_TxtEdtPage::GetTextPiece(size_t pos) const { + ASSERT(pos < m_Pieces.size()); + return m_Pieces[pos]; } wchar_t CFDE_TxtEdtPage::GetChar(const FDE_TEXTEDITPIECE* pIdentity, |