diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-21 14:27:59 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-21 20:44:29 +0000 |
commit | b45ea1fce52d93615470bab8b671cba5907fb01e (patch) | |
tree | 15153c437a253f73b3f5bb154a294ace77fe2c6d /xfa/fwl/cfwl_combolist.cpp | |
parent | 37a35df8c878d6e21a62ce0dfd2d480997d9e86c (diff) | |
download | pdfium-b45ea1fce52d93615470bab8b671cba5907fb01e.tar.xz |
Convert CFWL messages to use CFX_PointF
This Cl updates the various CFWL_Message classes to take CFX_PointF instead of
x,y values.
Change-Id: I5d9d01d68be64fc9e69c04574994c01286ad24e1
Reviewed-on: https://pdfium-review.googlesource.com/2811
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_combolist.cpp')
-rw-r--r-- | xfa/fwl/cfwl_combolist.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/xfa/fwl/cfwl_combolist.cpp b/xfa/fwl/cfwl_combolist.cpp index 171b54121c..5b700a90de 100644 --- a/xfa/fwl/cfwl_combolist.cpp +++ b/xfa/fwl/cfwl_combolist.cpp @@ -84,9 +84,8 @@ void CFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) { CFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect = vertSB->GetWidgetRect(); - if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) { - pMsg->m_fx -= rect.left; - pMsg->m_fy -= rect.top; + if (rect.Contains(pMsg->m_pos)) { + pMsg->m_pos -= rect.TopLeft(); vertSB->GetDelegate()->OnProcessMessage(pMsg); return; } @@ -130,26 +129,24 @@ void CFWL_ComboList::OnDropListFocusChanged(CFWL_Message* pMsg, bool bSet) { } void CFWL_ComboList::OnDropListMouseMove(CFWL_MessageMouse* pMsg) { - if (GetRTClient().Contains(pMsg->m_fx, pMsg->m_fy)) { + if (GetRTClient().Contains(pMsg->m_pos)) { if (m_bNotifyOwner) m_bNotifyOwner = false; CFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect = vertSB->GetWidgetRect(); - if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) + if (rect.Contains(pMsg->m_pos)) return; } - CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); + CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_pos); if (!hItem) return; ChangeSelected(GetItemIndex(this, hItem)); } else if (m_bNotifyOwner) { - CFX_PointF point = ClientToOuter(CFX_PointF(pMsg->m_fx, pMsg->m_fy)); - pMsg->m_fx = point.x; - pMsg->m_fy = point.y; + pMsg->m_pos = ClientToOuter(pMsg->m_pos); CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); pOuter->GetDelegate()->OnProcessMessage(pMsg); @@ -157,7 +154,7 @@ void CFWL_ComboList::OnDropListMouseMove(CFWL_MessageMouse* pMsg) { } void CFWL_ComboList::OnDropListLButtonDown(CFWL_MessageMouse* pMsg) { - if (GetRTClient().Contains(pMsg->m_fx, pMsg->m_fy)) + if (GetRTClient().Contains(pMsg->m_pos)) return; CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); @@ -167,9 +164,7 @@ void CFWL_ComboList::OnDropListLButtonDown(CFWL_MessageMouse* pMsg) { void CFWL_ComboList::OnDropListLButtonUp(CFWL_MessageMouse* pMsg) { CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter); if (m_bNotifyOwner) { - CFX_PointF point = ClientToOuter(CFX_PointF(pMsg->m_fx, pMsg->m_fy)); - pMsg->m_fx = point.x; - pMsg->m_fy = point.y; + pMsg->m_pos = ClientToOuter(pMsg->m_pos); pOuter->GetDelegate()->OnProcessMessage(pMsg); return; } @@ -177,12 +172,12 @@ void CFWL_ComboList::OnDropListLButtonUp(CFWL_MessageMouse* pMsg) { CFWL_ScrollBar* vertSB = GetVertScrollBar(); if (IsShowScrollBar(true) && vertSB) { CFX_RectF rect = vertSB->GetWidgetRect(); - if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) + if (rect.Contains(pMsg->m_pos)) return; } pOuter->ShowDropList(false); - CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy); + CFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_pos); if (hItem) pOuter->ProcessSelChanged(true); } |