summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_page.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-09 09:17:20 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-09 15:04:51 +0000
commit1b08df18300bbc67dabd12fb35ab6ce1732a1024 (patch)
tree9773931c8d18709860c9fbc1177e290e7713044e /core/fpdfapi/page/cpdf_page.cpp
parentac2e04797b258115b2dc768a56377d7e78038f42 (diff)
downloadpdfium-1b08df18300bbc67dabd12fb35ab6ce1732a1024.tar.xz
Convert Get methods to return instead of using out params.
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 <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_page.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_page.cpp20
1 files changed, 10 insertions, 10 deletions
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;
}