diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-08 14:05:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-08 14:05:14 -0800 |
commit | 43ac44cbf52076fd2354d5276c95d5b4b4a06d64 (patch) | |
tree | 28670fc2d1ee83358c717fb43ca7bc9301b2480f /xfa/fwl/cfwl_datetimepicker.cpp | |
parent | 53ed03d9d865c312fdaa4434b83ed60619881226 (diff) | |
download | pdfium-43ac44cbf52076fd2354d5276c95d5b4b4a06d64.tar.xz |
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
Diffstat (limited to 'xfa/fwl/cfwl_datetimepicker.cpp')
-rw-r--r-- | xfa/fwl/cfwl_datetimepicker.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp index 8bc17f3c57..fe7b90307b 100644 --- a/xfa/fwl/cfwl_datetimepicker.cpp +++ b/xfa/fwl/cfwl_datetimepicker.cpp @@ -77,7 +77,7 @@ void CFWL_DateTimePicker::Update() { m_pProperties->m_pThemeProvider = GetAvailableTheme(); m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); - GetClientRect(m_rtClient); + m_rtClient = GetClientRect(); FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pFWidth) @@ -172,7 +172,7 @@ void CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) { return; m_pEdit->SetText(wsText); - Repaint(&m_rtClient); + RepaintRect(m_rtClient); CFWL_Event ev(CFWL_Event::Type::EditChanged); DispatchEvent(&ev); @@ -327,7 +327,7 @@ void CFWL_DateTimePicker::ProcessSelChanged(int32_t iYear, FormatDateString(m_iYear, m_iMonth, m_iDay, wsText); m_pEdit->SetText(wsText); m_pEdit->Update(); - Repaint(&m_rtClient); + RepaintRect(m_rtClient); CFWL_EventSelectChanged ev(this); ev.iYear = m_iYear; @@ -393,7 +393,7 @@ void CFWL_DateTimePicker::DisForm_ShowMonthCalendar(bool bActivate) { CFX_RectF rtCal = m_pMonthCal->GetWidgetRect(); rtInvalidate.Union(rtCal); rtInvalidate.Inflate(2, 2); - Repaint(&rtInvalidate); + RepaintRect(rtInvalidate); } FWL_WidgetHit CFWL_DateTimePicker::DisForm_HitTest(FX_FLOAT fx, @@ -427,7 +427,7 @@ void CFWL_DateTimePicker::DisForm_Update() { m_pProperties->m_pThemeProvider = GetAvailableTheme(); m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); - GetClientRect(m_rtClient); + m_rtClient = GetClientRect(); m_pEdit->SetWidgetRect(m_rtClient); ResetEditAlignment(); m_pEdit->Update(); @@ -543,15 +543,15 @@ void CFWL_DateTimePicker::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { if (bSet) { m_pProperties->m_dwStates |= (FWL_WGTSTATE_Focused); - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } else { m_pProperties->m_dwStates &= ~(FWL_WGTSTATE_Focused); - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } if (pMsg->m_pSrcTarget == m_pMonthCal.get() && IsMonthCalendarVisible()) { ShowMonthCalendar(false); } - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } void CFWL_DateTimePicker::OnLButtonDown(CFWL_MessageMouse* pMsg) { @@ -570,7 +570,7 @@ void CFWL_DateTimePicker::OnLButtonDown(CFWL_MessageMouse* pMsg) { ShowMonthCalendar(true); m_bLBtnDown = true; - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } void CFWL_DateTimePicker::OnLButtonUp(CFWL_MessageMouse* pMsg) { @@ -582,20 +582,20 @@ void CFWL_DateTimePicker::OnLButtonUp(CFWL_MessageMouse* pMsg) { m_iBtnState = CFWL_PartState_Hovered; else m_iBtnState = CFWL_PartState_Normal; - Repaint(&m_rtBtn); + RepaintRect(m_rtBtn); } void CFWL_DateTimePicker::OnMouseMove(CFWL_MessageMouse* pMsg) { if (!m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) m_iBtnState = CFWL_PartState_Normal; - Repaint(&m_rtBtn); + RepaintRect(m_rtBtn); } void CFWL_DateTimePicker::OnMouseLeave(CFWL_MessageMouse* pMsg) { if (!pMsg) return; m_iBtnState = CFWL_PartState_Normal; - Repaint(&m_rtBtn); + RepaintRect(m_rtBtn); } void CFWL_DateTimePicker::DisForm_OnFocusChanged(CFWL_Message* pMsg, @@ -621,5 +621,5 @@ void CFWL_DateTimePicker::DisForm_OnFocusChanged(CFWL_Message* pMsg, } } rtInvalidate.Inflate(2, 2); - Repaint(&rtInvalidate); + RepaintRect(rtInvalidate); } |