diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-12 17:24:45 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-12 17:24:45 +0000 |
commit | 822886b0c4478eb339fc5e2ec89f3fbdd78d57be (patch) | |
tree | b51a1b4748fd8503beb05b4a22dd2d9d4740908a /core/fpdfapi/page/cpdf_page.h | |
parent | 56cc5c12a7f569f218c44a6186cdc3676ea0793b (diff) | |
download | pdfium-822886b0c4478eb339fc5e2ec89f3fbdd78d57be.tar.xz |
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 <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_page.h')
-rw-r--r-- | core/fpdfapi/page/cpdf_page.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/core/fpdfapi/page/cpdf_page.h b/core/fpdfapi/page/cpdf_page.h index d199ea41db..34c9ef45a8 100644 --- a/core/fpdfapi/page/cpdf_page.h +++ b/core/fpdfapi/page/cpdf_page.h @@ -12,6 +12,7 @@ #include "core/fpdfapi/page/cpdf_pageobjectholder.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" +#include "third_party/base/optional.h" class CPDF_Dictionary; class CPDF_Document; @@ -33,17 +34,13 @@ class CPDF_Page : public CPDF_PageObjectHolder { void ParseContent(); - 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<CFX_PointF> DeviceToPage(const FX_RECT& rect, + int rotate, + const CFX_PointF& device_point) const; + Optional<CFX_PointF> PageToDevice(const FX_RECT& rect, + int rotate, + double page_x, + double page_y) const; CFX_Matrix GetDisplayMatrix(const FX_RECT& rect, int iRotate) const; |