From 25de4c67f8a0b197191d5e6b36f19821d0253ba0 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 14 Mar 2017 15:07:03 -0400 Subject: Replace CFDE_TxtEdtPage FX_POSITION usage with uint32_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8cd68aaeb3c1f7ba92f32bc4846bf2e7d02111e4 Reviewed-on: https://pdfium-review.googlesource.com/3033 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- xfa/fde/cfde_txtedtpage.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'xfa/fde/cfde_txtedtpage.cpp') diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp index 4bf3e9fb5e..c3d21430bd 100644 --- a/xfa/fde/cfde_txtedtpage.cpp +++ b/xfa/fde/cfde_txtedtpage.cpp @@ -412,24 +412,25 @@ const CFX_RectF& CFDE_TxtEdtPage::GetContentsBox() { return m_rtPageContents; } -FX_POSITION CFDE_TxtEdtPage::GetFirstPosition() { - if (m_Pieces.empty()) - return nullptr; - return (FX_POSITION)1; +size_t CFDE_TxtEdtPage::GetFirstPosition() { + return m_Pieces.empty() ? 0 : 1; } -FDE_TEXTEDITPIECE* CFDE_TxtEdtPage::GetNext(FX_POSITION& pos, +FDE_TEXTEDITPIECE* CFDE_TxtEdtPage::GetNext(size_t* pos, IFDE_VisualSet*& pVisualSet) { + ASSERT(pos); + if (!m_pTextSet) { - pos = nullptr; + *pos = 0; return nullptr; } - int32_t nPos = (int32_t)(uintptr_t)pos; + + size_t nPos = *pos; pVisualSet = m_pTextSet.get(); - if (nPos + 1 > pdfium::CollectionSize(m_Pieces)) - pos = nullptr; + if (nPos + 1 > m_Pieces.size()) + *pos = 0; else - pos = (FX_POSITION)(uintptr_t)(nPos + 1); + *pos = nPos + 1; return &m_Pieces[nPos - 1]; } -- cgit v1.2.3