summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_combolist.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-21 12:56:24 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-21 19:05:18 +0000
commit1f403cee9478021862c7cc4e516907bd51e8f0f6 (patch)
tree57829fa3b036ee9ddd57a8ad5b3541fe4e96fdb8 /xfa/fwl/cfwl_combolist.cpp
parent04557b8a7c2d3dab06fe9eadacc3c7744b3e14e2 (diff)
downloadpdfium-1f403cee9478021862c7cc4e516907bd51e8f0f6.tar.xz
Convert more TransformPoint calls to Transform
This Cl converts several uses of TransformPoint to use Transform(CFX_PointF). Change-Id: I9bc3c484e0a4304b904584218bd9e59dec7db727 Reviewed-on: https://pdfium-review.googlesource.com/2791 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_combolist.cpp')
-rw-r--r--xfa/fwl/cfwl_combolist.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/xfa/fwl/cfwl_combolist.cpp b/xfa/fwl/cfwl_combolist.cpp
index d411f03ca3..171b54121c 100644
--- a/xfa/fwl/cfwl_combolist.cpp
+++ b/xfa/fwl/cfwl_combolist.cpp
@@ -63,12 +63,11 @@ void CFWL_ComboList::ChangeSelected(int32_t iSel) {
RepaintRect(rtInvalidate);
}
-void CFWL_ComboList::ClientToOuter(FX_FLOAT& fx, FX_FLOAT& fy) {
- fx += m_pProperties->m_rtWidget.left, fy += m_pProperties->m_rtWidget.top;
+CFX_PointF CFWL_ComboList::ClientToOuter(const CFX_PointF& point) {
+ CFX_PointF ret = point + CFX_PointF(m_pProperties->m_rtWidget.left,
+ m_pProperties->m_rtWidget.top);
CFWL_Widget* pOwner = GetOwner();
- if (!pOwner)
- return;
- pOwner->TransformTo(m_pOuter, fx, fy);
+ return pOwner ? pOwner->TransformTo(m_pOuter, ret) : ret;
}
void CFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) {
@@ -148,7 +147,10 @@ void CFWL_ComboList::OnDropListMouseMove(CFWL_MessageMouse* pMsg) {
ChangeSelected(GetItemIndex(this, hItem));
} else if (m_bNotifyOwner) {
- ClientToOuter(pMsg->m_fx, pMsg->m_fy);
+ CFX_PointF point = ClientToOuter(CFX_PointF(pMsg->m_fx, pMsg->m_fy));
+ pMsg->m_fx = point.x;
+ pMsg->m_fy = point.y;
+
CFWL_ComboBox* pOuter = static_cast<CFWL_ComboBox*>(m_pOuter);
pOuter->GetDelegate()->OnProcessMessage(pMsg);
}
@@ -165,7 +167,9 @@ 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) {
- ClientToOuter(pMsg->m_fx, pMsg->m_fy);
+ CFX_PointF point = ClientToOuter(CFX_PointF(pMsg->m_fx, pMsg->m_fy));
+ pMsg->m_fx = point.x;
+ pMsg->m_fy = point.y;
pOuter->GetDelegate()->OnProcessMessage(pMsg);
return;
}