summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-24 17:56:26 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-24 17:56:26 +0000
commit02d42b65b779e29737275a258cb9f30fa8449e5e (patch)
tree12e2b27d3883378315ab32efb1d5b86359783494 /fpdfsdk
parent866d688766dbfc01d69f586bfa197d57df0d9b96 (diff)
downloadpdfium-02d42b65b779e29737275a258cb9f30fa8449e5e.tar.xz
Add CFX_Matrix::AsTuple().chromium/3591
Change-Id: I53c1b148cb8cdc77461766fc9996a0a3ce5f4cb7 Reviewed-on: https://pdfium-review.googlesource.com/c/44536 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_editimg.cpp10
-rw-r--r--fpdfsdk/fpdf_editpage.cpp8
-rw-r--r--fpdfsdk/fpdf_editpath.cpp8
-rw-r--r--fpdfsdk/fpdf_edittext.cpp9
4 files changed, 7 insertions, 28 deletions
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 <utility>
+
#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 <utility>
#include <vector>
#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;
}