summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdftext.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-11 14:28:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-11 14:28:01 +0000
commit762502141cc93fb22fbfcf536d81752c4c6886aa (patch)
tree4157373e655fb6c3e2166ad46e45cf68ca349c7a /fpdfsdk/fpdftext.cpp
parent188b2e0333d161ffbac7c896f443b886b113b26a (diff)
downloadpdfium-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 'fpdfsdk/fpdftext.cpp')
-rw-r--r--fpdfsdk/fpdftext.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp
index 85dc6e475e..bc86c1c099 100644
--- a/fpdfsdk/fpdftext.cpp
+++ b/fpdfsdk/fpdftext.cpp
@@ -205,22 +205,24 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page,
return textpage->CountRects(start, count);
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
- int rect_index,
- double* left,
- double* top,
- double* right,
- double* bottom) {
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
+ int rect_index,
+ double* left,
+ double* top,
+ double* right,
+ double* bottom) {
if (!text_page)
- return;
+ return false;
CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
CFX_FloatRect rect;
- textpage->GetRect(rect_index, rect.left, rect.top, rect.right, rect.bottom);
+ bool result = textpage->GetRect(rect_index, &rect);
+
*left = rect.left;
*top = rect.top;
*right = rect.right;
*bottom = rect.bottom;
+ return result;
}
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,