summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-01 01:37:51 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-02 17:39:35 +0000
commit0a91394b4edba9bc2110161c9a12cecab77ea9e3 (patch)
tree74b3a1ce66e7d1622ee0beec77f9a1d571524807
parentfeea08cd050b8902bc58d563e0b265063bec417e (diff)
downloadpdfium-0a91394b4edba9bc2110161c9a12cecab77ea9e3.tar.xz
Remove explicit CFX_Matrix identity matrix instantiations.
Change-Id: I96c3429dbe2c572ed409706adfe3707b8b9bf51b Reviewed-on: https://pdfium-review.googlesource.com/6176 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--core/fpdftext/cpdf_textpage.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp3
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp25
-rw-r--r--xfa/fwl/cfwl_combobox.cpp2
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp2
5 files changed, 14 insertions, 20 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index e3db1c62c9..b8860122f1 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -590,7 +590,7 @@ void CPDF_TextPage::ProcessObject() {
CFX_Matrix matrix;
ProcessTextObject(pObj->AsText(), matrix, pObjList, it);
} else if (pObj->IsForm()) {
- CFX_Matrix formMatrix(1, 0, 0, 1, 0, 0);
+ CFX_Matrix formMatrix;
ProcessFormObject(pObj->AsForm(), formMatrix);
}
}
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 7d9357adb9..bd586a999c 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -1723,9 +1723,8 @@ CFX_Matrix CPDFSDK_Widget::GetMatrix() const {
float fHeight = rcAnnot.top - rcAnnot.bottom;
switch (abs(pControl->GetRotation() % 360)) {
- case 0:
default:
- mt = CFX_Matrix(1, 0, 0, 1, 0, 0);
+ case 0:
break;
case 90:
mt = CFX_Matrix(0, 1, -1, 0, fWidth, 0);
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 2bc240fc2e..98b914101d 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -386,29 +386,24 @@ void CFFL_FormFiller::DestroyPDFWindow(CPDFSDK_PageView* pPageView) {
}
CFX_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) {
- if (CFFL_PrivateData* pPrivateData = (CFFL_PrivateData*)pAttachedData) {
- if (pPrivateData->pPageView) {
- CFX_Matrix mtPageView;
- pPrivateData->pPageView->GetCurrentMatrix(mtPageView);
-
- CFX_Matrix mt = GetCurMatrix();
- mt.Concat(mtPageView);
-
- return mt;
- }
- }
- return CFX_Matrix(1, 0, 0, 1, 0, 0);
+ CFX_Matrix mt;
+ auto* pPrivateData = reinterpret_cast<CFFL_PrivateData*>(pAttachedData);
+ if (!pAttachedData || !pPrivateData->pPageView)
+ return mt;
+
+ CFX_Matrix mtPageView;
+ pPrivateData->pPageView->GetCurrentMatrix(mtPageView);
+ mt = GetCurMatrix();
+ mt.Concat(mtPageView);
+ return mt;
}
CFX_Matrix CFFL_FormFiller::GetCurMatrix() {
CFX_Matrix mt;
-
CFX_FloatRect rcDA = m_pWidget->GetPDFAnnot()->GetRect();
-
switch (m_pWidget->GetRotate()) {
default:
case 0:
- mt = CFX_Matrix(1, 0, 0, 1, 0, 0);
break;
case 90:
mt = CFX_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0);
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp
index ba72d3d2b2..cdb4f81d67 100644
--- a/xfa/fwl/cfwl_combobox.cpp
+++ b/xfa/fwl/cfwl_combobox.cpp
@@ -618,7 +618,7 @@ FWL_WidgetHit CFWL_ComboBox::DisForm_HitTest(const CFX_PointF& point) {
void CFWL_ComboBox::DisForm_DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
- CFX_Matrix mtOrg(1, 0, 0, 1, 0, 0);
+ CFX_Matrix mtOrg;
if (pMatrix)
mtOrg = *pMatrix;
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 0a3ae88a46..6386611b54 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -263,7 +263,7 @@ void CFWL_CheckBoxTP::InitCheckPath(float fCheckLen) {
m_pCheckPath->BezierTo(pt5 + p1, pt1 + p2, pt1);
float fScale = fCheckLen / kSignPath;
- CFX_Matrix mt(1, 0, 0, 1, 0, 0);
+ CFX_Matrix mt;
mt.Scale(fScale, fScale);
m_pCheckPath->TransformBy(mt);