summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_formfiller.cpp
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 /fpdfsdk/formfiller/cffl_formfiller.cpp
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>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_formfiller.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp25
1 files changed, 10 insertions, 15 deletions
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);