From 7d865b611bf5b029723ec3143180d23c95c907e8 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 Apr 2018 19:29:25 +0000 Subject: Remove CFX_Rect. It is rarely used and FX_RECT is the more common integer rect type. Change-Id: I7c5b875321c2d587becedcd058bb3a57fd1f0b61 Reviewed-on: https://pdfium-review.googlesource.com/30053 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- xfa/fxfa/cxfa_ffpageview.cpp | 28 ++++++++++++++-------------- xfa/fxfa/cxfa_ffpageview.h | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffpageview.cpp b/xfa/fxfa/cxfa_ffpageview.cpp index fa68cb7b81..d85ff07c0f 100644 --- a/xfa/fxfa/cxfa_ffpageview.cpp +++ b/xfa/fxfa/cxfa_ffpageview.cpp @@ -28,7 +28,7 @@ namespace { CFX_Matrix GetPageMatrix(const CFX_RectF& docPageRect, - const CFX_Rect& devicePageRect, + const FX_RECT& devicePageRect, int32_t iRotate, uint32_t dwCoordinatesType) { ASSERT(iRotate >= 0 && iRotate <= 3); @@ -37,29 +37,29 @@ CFX_Matrix GetPageMatrix(const CFX_RectF& docPageRect, bool bFlipY = (dwCoordinatesType & 0x02) != 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 *= (float)devicePageRect.width / docPageRect.width; - m.d *= (float)devicePageRect.height / docPageRect.height; + m.a *= (float)devicePageRect.Width() / docPageRect.width; + m.d *= (float)devicePageRect.Height() / docPageRect.height; } else { - m.a *= (float)devicePageRect.height / docPageRect.width; - m.d *= (float)devicePageRect.width / docPageRect.height; + m.a *= (float)devicePageRect.Height() / docPageRect.width; + m.d *= (float)devicePageRect.Width() / docPageRect.height; } m.Rotate(iRotate * 1.57079632675f); switch (iRotate) { case 0: - m.e = bFlipX ? (float)devicePageRect.right() : (float)devicePageRect.left; - m.f = bFlipY ? (float)devicePageRect.bottom() : (float)devicePageRect.top; + m.e = bFlipX ? devicePageRect.right : devicePageRect.left; + m.f = bFlipY ? devicePageRect.bottom : devicePageRect.top; break; case 1: - m.e = bFlipY ? (float)devicePageRect.left : (float)devicePageRect.right(); - m.f = bFlipX ? (float)devicePageRect.bottom() : (float)devicePageRect.top; + m.e = bFlipY ? devicePageRect.left : devicePageRect.right; + m.f = bFlipX ? devicePageRect.bottom : devicePageRect.top; break; case 2: - m.e = bFlipX ? (float)devicePageRect.left : (float)devicePageRect.right(); - m.f = bFlipY ? (float)devicePageRect.top : (float)devicePageRect.bottom(); + m.e = bFlipX ? devicePageRect.left : devicePageRect.right; + m.f = bFlipY ? devicePageRect.top : devicePageRect.bottom; break; case 3: - m.e = bFlipY ? (float)devicePageRect.right() : (float)devicePageRect.left; - m.f = bFlipX ? (float)devicePageRect.top : (float)devicePageRect.bottom(); + m.e = bFlipY ? devicePageRect.right : devicePageRect.left; + m.f = bFlipX ? devicePageRect.top : devicePageRect.bottom; break; default: break; @@ -122,7 +122,7 @@ CFX_RectF CXFA_FFPageView::GetPageViewRect() const { return CFX_RectF(0, 0, GetPageSize()); } -CFX_Matrix CXFA_FFPageView::GetDisplayMatrix(const CFX_Rect& rtDisp, +CFX_Matrix CXFA_FFPageView::GetDisplayMatrix(const FX_RECT& rtDisp, int32_t iRotate) const { return GetPageMatrix(CFX_RectF(0, 0, GetPageSize()), rtDisp, iRotate, 0); } diff --git a/xfa/fxfa/cxfa_ffpageview.h b/xfa/fxfa/cxfa_ffpageview.h index b33e25f79d..10dac26b92 100644 --- a/xfa/fxfa/cxfa_ffpageview.h +++ b/xfa/fxfa/cxfa_ffpageview.h @@ -25,7 +25,7 @@ class CXFA_FFPageView : public CXFA_ContainerLayoutItem { CXFA_FFDocView* GetDocView() const; CFX_RectF GetPageViewRect() const; - CFX_Matrix GetDisplayMatrix(const CFX_Rect& rtDisp, int32_t iRotate) const; + CFX_Matrix GetDisplayMatrix(const FX_RECT& rtDisp, int32_t iRotate) const; std::unique_ptr CreateWidgetIterator( uint32_t dwTraverseWay, uint32_t dwWidgetFilter); -- cgit v1.2.3