From 43ac44cbf52076fd2354d5276c95d5b4b4a06d64 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 8 Dec 2016 14:05:14 -0800 Subject: Cleanup CFWL_Widget code to return CFX_RectFs where appropriate This Cl changes the various Get*Rect methods in CFWL_Widget to return CFX_RectF classes instead of taking an out parameter. The Repaint method is split into Repaint() and RepaintRect() in order to change the param to a const CFX_RectF& from a CFX_RectF*. Review-Url: https://codereview.chromium.org/2560873005 --- xfa/fwl/cfwl_pushbutton.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xfa/fwl/cfwl_pushbutton.cpp') diff --git a/xfa/fwl/cfwl_pushbutton.cpp b/xfa/fwl/cfwl_pushbutton.cpp index 4e5ab8baf6..a1566bdad2 100644 --- a/xfa/fwl/cfwl_pushbutton.cpp +++ b/xfa/fwl/cfwl_pushbutton.cpp @@ -50,7 +50,7 @@ void CFWL_PushButton::Update() { m_pProperties->m_pThemeProvider = GetAvailableTheme(); UpdateTextOutStyles(); - GetClientRect(m_rtClient); + m_rtClient = GetClientRect(); m_rtCaption = m_rtClient; FX_FLOAT* fcaption = static_cast(GetThemeCapacity(CFWL_WidgetCapacity::Margin)); @@ -208,7 +208,7 @@ void CFWL_PushButton::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { else m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } void CFWL_PushButton::OnLButtonDown(CFWL_MessageMouse* pMsg) { @@ -218,7 +218,7 @@ void CFWL_PushButton::OnLButtonDown(CFWL_MessageMouse* pMsg) { m_bBtnDown = true; m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered; m_pProperties->m_dwStates |= FWL_STATE_PSB_Pressed; - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } void CFWL_PushButton::OnLButtonUp(CFWL_MessageMouse* pMsg) { @@ -234,7 +234,7 @@ void CFWL_PushButton::OnLButtonUp(CFWL_MessageMouse* pMsg) { CFWL_Event wmClick(CFWL_Event::Type::Click, this); DispatchEvent(&wmClick); } - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } void CFWL_PushButton::OnMouseMove(CFWL_MessageMouse* pMsg) { @@ -268,14 +268,14 @@ void CFWL_PushButton::OnMouseMove(CFWL_MessageMouse* pMsg) { } } if (bRepaint) - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } void CFWL_PushButton::OnMouseLeave(CFWL_MessageMouse* pMsg) { m_bBtnDown = false; m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered; m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed; - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } void CFWL_PushButton::OnKeyDown(CFWL_MessageKey* pMsg) { -- cgit v1.2.3