From 02d42b65b779e29737275a258cb9f30fa8449e5e Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 24 Oct 2018 17:56:26 +0000 Subject: Add CFX_Matrix::AsTuple(). Change-Id: I53c1b148cb8cdc77461766fc9996a0a3ce5f4cb7 Reviewed-on: https://pdfium-review.googlesource.com/c/44536 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- fpdfsdk/fpdf_editimg.cpp | 10 +++------- fpdfsdk/fpdf_editpage.cpp | 8 +------- fpdfsdk/fpdf_editpath.cpp | 8 ++------ fpdfsdk/fpdf_edittext.cpp | 9 +-------- 4 files changed, 7 insertions(+), 28 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp index 21ed434d7f..8282eebdc1 100644 --- a/fpdfsdk/fpdf_editimg.cpp +++ b/fpdfsdk/fpdf_editimg.cpp @@ -6,6 +6,8 @@ #include "public/fpdf_edit.h" +#include + #include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fpdfapi/page/cpdf_image.h" #include "core/fpdfapi/page/cpdf_imageobject.h" @@ -129,13 +131,7 @@ FPDFImageObj_GetMatrix(FPDF_PAGEOBJECT image_object, if (!pImgObj || !a || !b || !c || !d || !e || !f) return false; - const CFX_Matrix& matrix = pImgObj->matrix(); - *a = matrix.a; - *b = matrix.b; - *c = matrix.c; - *d = matrix.d; - *e = matrix.e; - *f = matrix.f; + std::tie(*a, *b, *c, *d, *e, *f) = pImgObj->matrix().AsTuple(); return true; } diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp index 9026c72a4e..981baec70a 100644 --- a/fpdfsdk/fpdf_editpage.cpp +++ b/fpdfsdk/fpdf_editpage.cpp @@ -873,12 +873,6 @@ FPDFFormObj_GetMatrix(FPDF_PAGEOBJECT form_object, if (!pFormObj || !a || !b || !c || !d || !e || !f) return false; - const CFX_Matrix& matrix = pFormObj->form_matrix(); - *a = matrix.a; - *b = matrix.b; - *c = matrix.c; - *d = matrix.d; - *e = matrix.e; - *f = matrix.f; + std::tie(*a, *b, *c, *d, *e, *f) = pFormObj->form_matrix().AsTuple(); return true; } diff --git a/fpdfsdk/fpdf_editpath.cpp b/fpdfsdk/fpdf_editpath.cpp index 83662aa8b5..8601a60508 100644 --- a/fpdfsdk/fpdf_editpath.cpp +++ b/fpdfsdk/fpdf_editpath.cpp @@ -4,6 +4,7 @@ #include "public/fpdf_edit.h" +#include #include #include "core/fpdfapi/page/cpdf_path.h" @@ -251,12 +252,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetMatrix(FPDF_PAGEOBJECT path, if (!pPathObj) return false; - *a = pPathObj->m_Matrix.a; - *b = pPathObj->m_Matrix.b; - *c = pPathObj->m_Matrix.c; - *d = pPathObj->m_Matrix.d; - *e = pPathObj->m_Matrix.e; - *f = pPathObj->m_Matrix.f; + std::tie(*a, *b, *c, *d, *e, *f) = pPathObj->m_Matrix.AsTuple(); return true; } diff --git a/fpdfsdk/fpdf_edittext.cpp b/fpdfsdk/fpdf_edittext.cpp index 1c6709f915..3e1067dff8 100644 --- a/fpdfsdk/fpdf_edittext.cpp +++ b/fpdfsdk/fpdf_edittext.cpp @@ -524,14 +524,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetMatrix(FPDF_PAGEOBJECT text, if (!pTextObj) return false; - CFX_Matrix text_matrix = pTextObj->GetTextMatrix(); - *a = text_matrix.a; - *b = text_matrix.b; - *c = text_matrix.c; - *d = text_matrix.d; - *e = text_matrix.e; - *f = text_matrix.f; - + std::tie(*a, *b, *c, *d, *e, *f) = pTextObj->GetTextMatrix().AsTuple(); return true; } -- cgit v1.2.3