summaryrefslogtreecommitdiff
path: root/fpdfsdk/fxedit/fxet_list.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-13 15:44:23 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-13 22:09:20 +0000
commit4797c4240cb9e2d8cd36c583d46cd52ff94af95d (patch)
tree0c7e856a1c82812fcc3fa038e07ff4f22e424130 /fpdfsdk/fxedit/fxet_list.cpp
parent58e4c5ac24a88f83d1ba8277dee87baf4cba36a0 (diff)
downloadpdfium-4797c4240cb9e2d8cd36c583d46cd52ff94af95d.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fxedit/fxet_list.cpp')
-rw-r--r--fpdfsdk/fxedit/fxet_list.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp
index cf718b9acb..39877c955f 100644
--- a/fpdfsdk/fxedit/fxet_list.cpp
+++ b/fpdfsdk/fxedit/fxet_list.cpp
@@ -207,37 +207,33 @@ void CFX_ListCtrl::SetNotify(CPWL_List_Notify* pNotify) {
m_pNotify = pNotify;
}
-CFX_FloatPoint CFX_ListCtrl::InToOut(const CFX_FloatPoint& point) const {
+CFX_PointF CFX_ListCtrl::InToOut(const CFX_PointF& point) const {
CFX_FloatRect rcPlate = GetPlateRect();
-
- return CFX_FloatPoint(point.x - (m_ptScrollPos.x - rcPlate.left),
- point.y - (m_ptScrollPos.y - rcPlate.top));
+ return CFX_PointF(point.x - (m_ptScrollPos.x - rcPlate.left),
+ point.y - (m_ptScrollPos.y - rcPlate.top));
}
-CFX_FloatPoint CFX_ListCtrl::OutToIn(const CFX_FloatPoint& point) const {
+CFX_PointF CFX_ListCtrl::OutToIn(const CFX_PointF& point) const {
CFX_FloatRect rcPlate = GetPlateRect();
-
- return CFX_FloatPoint(point.x + (m_ptScrollPos.x - rcPlate.left),
- point.y + (m_ptScrollPos.y - rcPlate.top));
+ return CFX_PointF(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_FloatPoint ptLeftBottom = InToOut(CFX_FloatPoint(rect.left, rect.bottom));
- CFX_FloatPoint ptRightTop = InToOut(CFX_FloatPoint(rect.right, rect.top));
-
+ CFX_PointF ptLeftBottom = InToOut(CFX_PointF(rect.left, rect.bottom));
+ CFX_PointF ptRightTop = InToOut(CFX_PointF(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_FloatPoint ptLeftBottom = OutToIn(CFX_FloatPoint(rect.left, rect.bottom));
- CFX_FloatPoint ptRightTop = OutToIn(CFX_FloatPoint(rect.right, rect.top));
-
+ CFX_PointF ptLeftBottom = OutToIn(CFX_PointF(rect.left, rect.bottom));
+ CFX_PointF ptRightTop = OutToIn(CFX_PointF(rect.right, rect.top));
return CFX_FloatRect(ptLeftBottom.x, ptLeftBottom.y, ptRightTop.x,
ptRightTop.y);
}
-void CFX_ListCtrl::OnMouseDown(const CFX_FloatPoint& point,
+void CFX_ListCtrl::OnMouseDown(const CFX_PointF& point,
bool bShift,
bool bCtrl) {
int32_t nHitIndex = GetItemIndex(point);
@@ -276,7 +272,7 @@ void CFX_ListCtrl::OnMouseDown(const CFX_FloatPoint& point,
ScrollToListItem(nHitIndex);
}
-void CFX_ListCtrl::OnMouseMove(const CFX_FloatPoint& point,
+void CFX_ListCtrl::OnMouseMove(const CFX_PointF& point,
bool bShift,
bool bCtrl) {
int32_t nHitIndex = GetItemIndex(point);
@@ -367,7 +363,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_FloatPoint(rect.left, rect.top));
+ SetScrollPos(CFX_PointF(rect.left, rect.top));
ReArrange(0);
InvalidateItem(-1);
}
@@ -542,7 +538,7 @@ void CFX_ListCtrl::SetScrollInfo() {
}
}
-void CFX_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) {
+void CFX_ListCtrl::SetScrollPos(const CFX_PointF& point) {
SetScrollPosY(point.y);
}
@@ -630,8 +626,8 @@ void CFX_ListCtrl::Cancel() {
m_aSelItems.DeselectAll();
}
-int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const {
- CFX_FloatPoint pt = OuterToInner(OutToIn(point));
+int32_t CFX_ListCtrl::GetItemIndex(const CFX_PointF& point) const {
+ CFX_PointF pt = OuterToInner(OutToIn(point));
bool bFirst = true;
bool bLast = true;