From 56cc5c12a7f569f218c44a6186cdc3676ea0793b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 12 Apr 2018 16:35:49 +0000 Subject: Add CPDF_Page::DeviceToPage() / PageToDevice(). Just like CPDFXFA_Page. Also mark the methods const. Change-Id: I6717b4b61a29663780f45bf872f76fe8e671df75 Reviewed-on: https://pdfium-review.googlesource.com/30132 Commit-Queue: Lei Zhang Reviewed-by: dsinclair --- fpdfsdk/fpdf_view.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'fpdfsdk/fpdf_view.cpp') diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp index 51cfd8976b..f39d80cab0 100644 --- a/fpdfsdk/fpdf_view.cpp +++ b/fpdfsdk/fpdf_view.cpp @@ -746,18 +746,8 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y); -#ifdef PDF_ENABLE_XFA pPage->DeviceToPage(rect, rotate, CFX_PointF(device_x, device_y), page_x, page_y); -#else // PDF_ENABLE_XFA - CFX_Matrix page2device = pPage->GetDisplayMatrix(rect, rotate); - - CFX_PointF pos = page2device.GetInverse().Transform( - CFX_PointF(static_cast(device_x), static_cast(device_y))); - - *page_x = pos.x; - *page_y = pos.y; -#endif // PDF_ENABLE_XFA } FPDF_EXPORT void FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, @@ -775,16 +765,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y); -#ifdef PDF_ENABLE_XFA pPage->PageToDevice(rect, rotate, page_x, page_y, device_x, device_y); -#else // PDF_ENABLE_XFA - CFX_Matrix page2device = pPage->GetDisplayMatrix(rect, rotate); - CFX_PointF pos = page2device.Transform( - CFX_PointF(static_cast(page_x), static_cast(page_y))); - - *device_x = FXSYS_round(pos.x); - *device_y = FXSYS_round(pos.y); -#endif // PDF_ENABLE_XFA } FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_Create(int width, -- cgit v1.2.3