From 822886b0c4478eb339fc5e2ec89f3fbdd78d57be Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 12 Apr 2018 17:24:45 +0000 Subject: Add return value to FPDF_DeviceToPage(). Do the same for FPDF_PageToDevice(). Clean up the internal implementation as well. Change-Id: Ia207bfa779d144cb9f0310e768750ab10e603b8f Reviewed-on: https://pdfium-review.googlesource.com/17370 Commit-Queue: Lei Zhang Reviewed-by: dsinclair --- public/fpdfview.h | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'public') diff --git a/public/fpdfview.h b/public/fpdfview.h index 62b7b88410..2c93e962f3 100644 --- a/public/fpdfview.h +++ b/public/fpdfview.h @@ -736,7 +736,8 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document); // page_y - A pointer to a double receiving the converted Y // value in page coordinates. // Return value: -// None. +// Returns true if the conversion succeeds, and |page_x| and |page_y| +// successfully receives the converted coordinates. // Comments: // The page coordinate system has its origin at the left-bottom corner // of the page, with the X-axis on the bottom going to the right, and @@ -754,16 +755,16 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document); // You must make sure the start_x, start_y, size_x, size_y // and rotate parameters have exactly same values as you used in // the FPDF_RenderPage() function call. -FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int device_x, - int device_y, - double* page_x, - double* page_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int device_x, + int device_y, + double* page_x, + double* page_y); // Function: FPDF_PageToDevice // Convert the page coordinates of a point to screen coordinates. @@ -787,19 +788,20 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, // device_y - A pointer to an integer receiving the result Y // value in device coordinates. // Return value: -// None. +// Returns true if the conversion succeeds, and |device_x| and +// |device_y| successfully receives the converted coordinates. // Comments: // See comments for FPDF_DeviceToPage(). -FPDF_EXPORT void FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - double page_x, - double page_y, - int* device_x, - int* device_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + double page_x, + double page_y, + int* device_x, + int* device_y); // Function: FPDFBitmap_Create // Create a device independent bitmap (FXDIB). -- cgit v1.2.3