summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffpageview.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-07 16:36:39 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-08 01:36:02 +0000
commitbba2a7cf30da9e84bcc14ef32dbb0bb944229219 (patch)
tree94a74de8d07b3e395bf6e08a62811a3a0d652d19 /xfa/fxfa/app/xfa_ffpageview.cpp
parent55e026b7b6eec17b012c819c4a7d39e63094b5c4 (diff)
downloadpdfium-bba2a7cf30da9e84bcc14ef32dbb0bb944229219.tar.xz
Update to use CFX_Rect{F} and CFX_Matrix constructors.
This Cl updates the code to use the constructors instead of creating an empty object and calling Set(). It also removes the various memsets of the CFX_Rect{F} classes. Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4 Reviewed-on: https://pdfium-review.googlesource.com/2550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/xfa_ffpageview.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffpageview.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp
index 3dfa237c0f..da31cbf3b3 100644
--- a/xfa/fxfa/app/xfa_ffpageview.cpp
+++ b/xfa/fxfa/app/xfa_ffpageview.cpp
@@ -33,8 +33,7 @@ void GetPageMatrix(CFX_Matrix& pageMatrix,
ASSERT(iRotate >= 0 && iRotate <= 3);
bool bFlipX = (dwCoordinatesType & 0x01) != 0;
bool bFlipY = (dwCoordinatesType & 0x02) != 0;
- CFX_Matrix m;
- m.Set((bFlipX ? -1.0f : 1.0f), 0, 0, (bFlipY ? -1.0f : 1.0f), 0, 0);
+ CFX_Matrix m((bFlipX ? -1.0f : 1.0f), 0, 0, (bFlipY ? -1.0f : 1.0f), 0, 0);
if (iRotate == 0 || iRotate == 2) {
m.a *= (FX_FLOAT)devicePageRect.width / docPageRect.width;
m.d *= (FX_FLOAT)devicePageRect.height / docPageRect.height;
@@ -126,16 +125,14 @@ CXFA_FFDocView* CXFA_FFPageView::GetDocView() const {
}
void CXFA_FFPageView::GetPageViewRect(CFX_RectF& rtPage) const {
- rtPage.Set(0, 0, GetPageSize());
+ rtPage = CFX_RectF(0, 0, GetPageSize());
}
void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix& mt,
const CFX_Rect& rtDisp,
int32_t iRotate) const {
CFX_SizeF sz = GetPageSize();
- CFX_RectF fdePage;
- fdePage.Set(0, 0, sz.x, sz.y);
- GetPageMatrix(mt, fdePage, rtDisp, iRotate, 0);
+ GetPageMatrix(mt, CFX_RectF(0, 0, sz.x, sz.y), rtDisp, iRotate, 0);
}
IXFA_WidgetIterator* CXFA_FFPageView::CreateWidgetIterator(
@@ -370,8 +367,10 @@ static int32_t XFA_TabOrderWidgetComparator(const void* phWidget1,
const void* phWidget2) {
CXFA_FFWidget* pWidget1 = (*(CXFA_TabParam**)phWidget1)->m_pWidget;
CXFA_FFWidget* pWidget2 = (*(CXFA_TabParam**)phWidget2)->m_pWidget;
- CFX_RectF rt1, rt2;
+ CFX_RectF rt1;
pWidget1->GetWidgetRect(rt1);
+
+ CFX_RectF rt2;
pWidget2->GetWidgetRect(rt2);
FX_FLOAT x1 = rt1.left, y1 = rt1.top, x2 = rt2.left, y2 = rt2.top;
if (y1 < y2 || (y1 - y2 < XFA_FLOAT_PERCISION && x1 < x2)) {