diff options
author | Lei Zhang <thestig@chromium.org> | 2018-01-11 14:28:01 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-11 14:28:01 +0000 |
commit | 762502141cc93fb22fbfcf536d81752c4c6886aa (patch) | |
tree | 4157373e655fb6c3e2166ad46e45cf68ca349c7a /core/fpdftext | |
parent | 188b2e0333d161ffbac7c896f443b886b113b26a (diff) | |
download | pdfium-762502141cc93fb22fbfcf536d81752c4c6886aa.tar.xz |
Change FPDFText_GetRect() to return a boolean.
BUG=pdfium:858
Change-Id: Idc9900fe6f85b1fef06c97f5023653f77156d410
Reviewed-on: https://pdfium-review.googlesource.com/22730
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdftext')
-rw-r--r-- | core/fpdftext/cpdf_textpage.cpp | 14 | ||||
-rw-r--r-- | core/fpdftext/cpdf_textpage.h | 6 |
2 files changed, 5 insertions, 15 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp index 98eacf3c14..b448a59b33 100644 --- a/core/fpdftext/cpdf_textpage.cpp +++ b/core/fpdftext/cpdf_textpage.cpp @@ -471,18 +471,12 @@ int CPDF_TextPage::CountRects(int start, int nCount) { return pdfium::CollectionSize<int>(m_SelRects); } -void CPDF_TextPage::GetRect(int rectIndex, - float& left, - float& top, - float& right, - float& bottom) const { +bool CPDF_TextPage::GetRect(int rectIndex, CFX_FloatRect* pRect) const { if (!m_bIsParsed || !pdfium::IndexInBounds(m_SelRects, rectIndex)) - return; + return false; - left = m_SelRects[rectIndex].left; - top = m_SelRects[rectIndex].top; - right = m_SelRects[rectIndex].right; - bottom = m_SelRects[rectIndex].bottom; + *pRect = m_SelRects[rectIndex]; + return true; } CPDF_TextPage::TextOrientation CPDF_TextPage::FindTextlineFlowOrientation() diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h index cd30ace3ad..51d066071e 100644 --- a/core/fpdftext/cpdf_textpage.h +++ b/core/fpdftext/cpdf_textpage.h @@ -111,11 +111,7 @@ class CPDF_TextPage { WideString GetAllPageText() const { return GetPageText(0, CountChars()); } int CountRects(int start, int nCount); - void GetRect(int rectIndex, - float& left, - float& top, - float& right, - float& bottom) const; + bool GetRect(int rectIndex, CFX_FloatRect* pRect) const; static bool IsRectIntersect(const CFX_FloatRect& rect1, const CFX_FloatRect& rect2); |