summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_textobject.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_textobject.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_textobject.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_textobject.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index fb81a40d0c..503ea78f9e 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -134,8 +134,7 @@ CPDF_PageObject::Type CPDF_TextObject::GetType() const {
}
void CPDF_TextObject::Transform(const CFX_Matrix& matrix) {
- CFX_Matrix text_matrix;
- GetTextMatrix(&text_matrix);
+ CFX_Matrix text_matrix = GetTextMatrix();
text_matrix.Concat(matrix);
FX_FLOAT* pTextMatrix = m_TextState.GetMutableMatrix();
@@ -160,14 +159,10 @@ const CPDF_TextObject* CPDF_TextObject::AsText() const {
return this;
}
-void CPDF_TextObject::GetTextMatrix(CFX_Matrix* pMatrix) const {
+CFX_Matrix CPDF_TextObject::GetTextMatrix() const {
const FX_FLOAT* pTextMatrix = m_TextState.GetMatrix();
- pMatrix->a = pTextMatrix[0];
- pMatrix->b = pTextMatrix[2];
- pMatrix->c = pTextMatrix[1];
- pMatrix->d = pTextMatrix[3];
- pMatrix->e = m_PosX;
- pMatrix->f = m_PosY;
+ return CFX_Matrix(pTextMatrix[0], pTextMatrix[2], pTextMatrix[1],
+ pTextMatrix[3], m_PosX, m_PosY);
}
void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
@@ -361,13 +356,12 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
min_y = min_y * fontsize / 1000;
max_y = max_y * fontsize / 1000;
}
- CFX_Matrix matrix;
- GetTextMatrix(&matrix);
+
m_Left = min_x;
m_Right = max_x;
m_Bottom = min_y;
m_Top = max_y;
- matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
+ GetTextMatrix().TransformRect(m_Left, m_Right, m_Top, m_Bottom);
if (TextRenderingModeIsStrokeMode(m_TextState.GetTextMode())) {
FX_FLOAT half_width = m_GraphState.GetLineWidth() / 2;
m_Left -= half_width;