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 --- fpdfsdk/fpdfxfa/cpdfxfa_page.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_page.h') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.h b/fpdfsdk/fpdfxfa/cpdfxfa_page.h index aef1b0b539..131e811b66 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_page.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.h @@ -13,6 +13,7 @@ #include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/unowned_ptr.h" +#include "third_party/base/optional.h" class CPDFXFA_Context; class CPDF_Dictionary; @@ -38,17 +39,13 @@ class CPDFXFA_Page : public Retainable { float GetPageWidth() const; float GetPageHeight() const; - void DeviceToPage(const FX_RECT& rect, - int rotate, - const CFX_PointF& device_point, - double* page_x, - double* page_y) const; - void PageToDevice(const FX_RECT& rect, - int rotate, - double page_x, - double page_y, - int* device_x, - int* device_y) const; + Optional DeviceToPage(const FX_RECT& rect, + int rotate, + const CFX_PointF& device_point) const; + Optional PageToDevice(const FX_RECT& rect, + int rotate, + double page_x, + double page_y) const; CFX_Matrix GetDisplayMatrix(const FX_RECT& rect, int iRotate) const; -- cgit v1.2.3