From 1b08df18300bbc67dabd12fb35ab6ce1732a1024 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 9 Feb 2017 09:17:20 -0500 Subject: Convert Get methods to return instead of using out params. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl changes several Get methods to return their values instead of using out parameters. Change-Id: Ie9a930a5c2d0e809f2d7181ca033d801945c1cf9 Reviewed-on: https://pdfium-review.googlesource.com/2556 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- core/fpdfapi/page/cpdf_page.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core/fpdfapi/page/cpdf_page.cpp') diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp index 7714369df8..ba30ce57c3 100644 --- a/core/fpdfapi/page/cpdf_page.cpp +++ b/core/fpdfapi/page/cpdf_page.cpp @@ -120,15 +120,14 @@ CPDF_Object* CPDF_Page::GetPageAttr(const CFX_ByteString& name) const { return nullptr; } -void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix, - int xPos, - int yPos, - int xSize, - int ySize, - int iRotate) const { - if (m_PageWidth == 0 || m_PageHeight == 0) { - return; - } +CFX_Matrix CPDF_Page::GetDisplayMatrix(int xPos, + int yPos, + int xSize, + int ySize, + int iRotate) const { + if (m_PageWidth == 0 || m_PageHeight == 0) + return CFX_Matrix(); + float x0 = 0; float y0 = 0; float x1 = 0; @@ -170,8 +169,9 @@ void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix, y2 = yPos; break; } - matrix = m_PageMatrix; + CFX_Matrix matrix = m_PageMatrix; matrix.Concat(CFX_Matrix((x2 - x0) / m_PageWidth, (y2 - y0) / m_PageWidth, (x1 - x0) / m_PageHeight, (y1 - y0) / m_PageHeight, x0, y0)); + return matrix; } -- cgit v1.2.3