From bba2a7cf30da9e84bcc14ef32dbb0bb944229219 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 7 Feb 2017 16:36:39 -0500 Subject: Update to use CFX_Rect{F} and CFX_Matrix constructors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl updates the code to use the constructors instead of creating an empty object and calling Set(). It also removes the various memsets of the CFX_Rect{F} classes. Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4 Reviewed-on: https://pdfium-review.googlesource.com/2550 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez --- fpdfsdk/fpdfxfa/cpdfxfa_page.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_page.cpp') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp index 8cc325009b..8011295f96 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp @@ -156,12 +156,12 @@ void CPDFXFA_Page::DeviceToPage(int start_x, if (!m_pPDFPage && !m_pXFAPageView) return; - CFX_Matrix page2device; - CFX_Matrix device2page; FX_FLOAT page_x_f, page_y_f; + CFX_Matrix page2device; GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate); + CFX_Matrix device2page; device2page.SetReverse(page2device); device2page.Transform((FX_FLOAT)(device_x), (FX_FLOAT)(device_y), page_x_f, page_y_f); @@ -182,9 +182,9 @@ void CPDFXFA_Page::PageToDevice(int start_x, if (!m_pPDFPage && !m_pXFAPageView) return; - CFX_Matrix page2device; FX_FLOAT device_x_f, device_y_f; + CFX_Matrix page2device; GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate); page2device.Transform(((FX_FLOAT)page_x), ((FX_FLOAT)page_y), device_x_f, @@ -207,8 +207,7 @@ void CPDFXFA_Page::GetDisplayMatrix(CFX_Matrix& matrix, switch (nDocType) { case DOCTYPE_DYNAMIC_XFA: { if (m_pXFAPageView) { - CFX_Rect rect; - rect.Set(xPos, yPos, xSize, ySize); + CFX_Rect rect(xPos, yPos, xSize, ySize); m_pXFAPageView->GetDisplayMatrix(matrix, rect, iRotate); } } break; -- cgit v1.2.3