From 92a32db931c1303388158f8a9e045e922d0b8dfa Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 14 Feb 2017 14:58:49 +0000 Subject: Revert "Convert CFX_FloatPoint to CFX_PointF" This reverts commit 4797c4240cb9e2d8cd36c583d46cd52ff94af95d. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert CFX_FloatPoint to CFX_PointF > > The two classes store the same information, remove the CFX_FloatPoint variant. > > Change-Id: Ie598c2ba5af04fb2bb3347dd48c30fd5e4845e62 > Reviewed-on: https://pdfium-review.googlesource.com/2612 > Commit-Queue: dsinclair > Reviewed-by: Tom Sepez > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia42074e706983c62d2e57497c3079b3c338343a3 Reviewed-on: https://pdfium-review.googlesource.com/2694 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/fxedit/fxet_list.cpp | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'fpdfsdk/fxedit/fxet_list.cpp') diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp index 39877c955f..cf718b9acb 100644 --- a/fpdfsdk/fxedit/fxet_list.cpp +++ b/fpdfsdk/fxedit/fxet_list.cpp @@ -207,33 +207,37 @@ void CFX_ListCtrl::SetNotify(CPWL_List_Notify* pNotify) { m_pNotify = pNotify; } -CFX_PointF CFX_ListCtrl::InToOut(const CFX_PointF& point) const { +CFX_FloatPoint CFX_ListCtrl::InToOut(const CFX_FloatPoint& point) const { CFX_FloatRect rcPlate = GetPlateRect(); - return CFX_PointF(point.x - (m_ptScrollPos.x - rcPlate.left), - point.y - (m_ptScrollPos.y - rcPlate.top)); + + return CFX_FloatPoint(point.x - (m_ptScrollPos.x - rcPlate.left), + point.y - (m_ptScrollPos.y - rcPlate.top)); } -CFX_PointF CFX_ListCtrl::OutToIn(const CFX_PointF& point) const { +CFX_FloatPoint CFX_ListCtrl::OutToIn(const CFX_FloatPoint& point) const { CFX_FloatRect rcPlate = GetPlateRect(); - return CFX_PointF(point.x + (m_ptScrollPos.x - rcPlate.left), - point.y + (m_ptScrollPos.y - rcPlate.top)); + + return CFX_FloatPoint(point.x + (m_ptScrollPos.x - rcPlate.left), + point.y + (m_ptScrollPos.y - rcPlate.top)); } CFX_FloatRect CFX_ListCtrl::InToOut(const CFX_FloatRect& rect) const { - CFX_PointF ptLeftBottom = InToOut(CFX_PointF(rect.left, rect.bottom)); - CFX_PointF ptRightTop = InToOut(CFX_PointF(rect.right, rect.top)); + CFX_FloatPoint ptLeftBottom = InToOut(CFX_FloatPoint(rect.left, rect.bottom)); + CFX_FloatPoint ptRightTop = InToOut(CFX_FloatPoint(rect.right, rect.top)); + return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } CFX_FloatRect CFX_ListCtrl::OutToIn(const CFX_FloatRect& rect) const { - CFX_PointF ptLeftBottom = OutToIn(CFX_PointF(rect.left, rect.bottom)); - CFX_PointF ptRightTop = OutToIn(CFX_PointF(rect.right, rect.top)); + CFX_FloatPoint ptLeftBottom = OutToIn(CFX_FloatPoint(rect.left, rect.bottom)); + CFX_FloatPoint ptRightTop = OutToIn(CFX_FloatPoint(rect.right, rect.top)); + return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x, ptRightTop.y); } -void CFX_ListCtrl::OnMouseDown(const CFX_PointF& point, +void CFX_ListCtrl::OnMouseDown(const CFX_FloatPoint& point, bool bShift, bool bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -272,7 +276,7 @@ void CFX_ListCtrl::OnMouseDown(const CFX_PointF& point, ScrollToListItem(nHitIndex); } -void CFX_ListCtrl::OnMouseMove(const CFX_PointF& point, +void CFX_ListCtrl::OnMouseMove(const CFX_FloatPoint& point, bool bShift, bool bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -363,7 +367,7 @@ bool CFX_ListCtrl::OnChar(uint16_t nChar, bool bShift, bool bCtrl) { void CFX_ListCtrl::SetPlateRect(const CFX_FloatRect& rect) { CFX_ListContainer::SetPlateRect(rect); m_ptScrollPos.x = rect.left; - SetScrollPos(CFX_PointF(rect.left, rect.top)); + SetScrollPos(CFX_FloatPoint(rect.left, rect.top)); ReArrange(0); InvalidateItem(-1); } @@ -538,7 +542,7 @@ void CFX_ListCtrl::SetScrollInfo() { } } -void CFX_ListCtrl::SetScrollPos(const CFX_PointF& point) { +void CFX_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) { SetScrollPosY(point.y); } @@ -626,8 +630,8 @@ void CFX_ListCtrl::Cancel() { m_aSelItems.DeselectAll(); } -int32_t CFX_ListCtrl::GetItemIndex(const CFX_PointF& point) const { - CFX_PointF pt = OuterToInner(OutToIn(point)); +int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { + CFX_FloatPoint pt = OuterToInner(OutToIn(point)); bool bFirst = true; bool bLast = true; -- cgit v1.2.3