diff options
author | Lei Zhang <thestig@chromium.org> | 2018-01-10 17:33:06 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-10 17:33:06 +0000 |
commit | 50bd8fa8a9505487c1109e2645ef785ad73b1cbc (patch) | |
tree | 09853cec7a8cbc32e3f5f5222db654f31907b097 /fpdfsdk/fpdftext.cpp | |
parent | 54f86140d436ce2f457dc588f5b2c183d4e94452 (diff) | |
download | pdfium-50bd8fa8a9505487c1109e2645ef785ad73b1cbc.tar.xz |
Change FPDFLink_GetRect() to return a boolean.
BUG=pdfium:858
Change-Id: Ib8effb64a1622feb2837f536b36b9e46847a2210
Reviewed-on: https://pdfium-review.googlesource.com/22631
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdftext.cpp')
-rw-r--r-- | fpdfsdk/fpdftext.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp index 9392981df1..85dc6e475e 100644 --- a/fpdfsdk/fpdftext.cpp +++ b/fpdfsdk/fpdftext.cpp @@ -362,25 +362,26 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page, return pdfium::CollectionSize<int>(pageLink->GetRects(link_index)); } -FPDF_EXPORT void FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page, - int link_index, - int rect_index, - double* left, - double* top, - double* right, - double* bottom) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page, + int link_index, + int rect_index, + double* left, + double* top, + double* right, + double* bottom) { if (!link_page || link_index < 0 || rect_index < 0) - return; + return false; CPDF_LinkExtract* pageLink = CPDFLinkExtractFromFPDFPageLink(link_page); std::vector<CFX_FloatRect> rectArray = pageLink->GetRects(link_index); if (rect_index >= pdfium::CollectionSize<int>(rectArray)) - return; + return false; *left = rectArray[rect_index].left; *right = rectArray[rect_index].right; *top = rectArray[rect_index].top; *bottom = rectArray[rect_index].bottom; + return true; } FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { |