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_monthcalendar.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_monthcalendar.cpp')
-rw-r--r-- | xfa/fwl/cfwl_monthcalendar.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp index 94d198599d..c93ee04491 100644 --- a/xfa/fwl/cfwl_monthcalendar.cpp +++ b/xfa/fwl/cfwl_monthcalendar.cpp @@ -601,7 +601,7 @@ void CFWL_MonthCalendar::CalcTodaySize() { } void CFWL_MonthCalendar::Layout() { - GetClientRect(m_rtClient); + m_rtClient = GetClientRect(); m_rtHead.Set( m_rtClient.left + MONTHCAL_HEADER_BTN_HMARGIN, m_rtClient.top, @@ -934,15 +934,15 @@ void CFWL_MonthCalendar::OnLButtonDown(CFWL_MessageMouse* pMsg) { if (m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { m_iLBtnPartStates = CFWL_PartState_Pressed; PrevMonth(); - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } else if (m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { m_iRBtnPartStates |= CFWL_PartState_Pressed; NextMonth(); - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } else if (m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) { if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_NoToday) == 0) { JumpToToday(); - Repaint(&m_rtClient); + RepaintRect(m_rtClient); } } else { CFWL_DateTimePicker* pIPicker = static_cast<CFWL_DateTimePicker*>(m_pOuter); @@ -957,12 +957,12 @@ void CFWL_MonthCalendar::OnLButtonUp(CFWL_MessageMouse* pMsg) { if (m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { m_iLBtnPartStates = 0; - Repaint(&m_rtLBtn); + RepaintRect(m_rtLBtn); return; } if (m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { m_iRBtnPartStates = 0; - Repaint(&m_rtRBtn); + RepaintRect(m_rtRBtn); return; } if (m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) @@ -998,12 +998,12 @@ void CFWL_MonthCalendar::OnLButtonUp(CFWL_MessageMouse* pMsg) { void CFWL_MonthCalendar::DisForm_OnLButtonUp(CFWL_MessageMouse* pMsg) { if (m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { m_iLBtnPartStates = 0; - Repaint(&(m_rtLBtn)); + RepaintRect(m_rtLBtn); return; } if (m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { m_iRBtnPartStates = 0; - Repaint(&(m_rtRBtn)); + RepaintRect(m_rtRBtn); return; } if (m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) @@ -1060,7 +1060,7 @@ void CFWL_MonthCalendar::OnMouseMove(CFWL_MessageMouse* pMsg) { m_iHovered = -1; } if (bRepaint && !rtInvalidate.IsEmpty()) - Repaint(&rtInvalidate); + RepaintRect(rtInvalidate); } void CFWL_MonthCalendar::OnMouseLeave(CFWL_MessageMouse* pMsg) { @@ -1072,7 +1072,7 @@ void CFWL_MonthCalendar::OnMouseLeave(CFWL_MessageMouse* pMsg) { GetDayRect(m_iHovered, rtInvalidate); m_iHovered = -1; if (!rtInvalidate.IsEmpty()) - Repaint(&rtInvalidate); + RepaintRect(rtInvalidate); } CFWL_MonthCalendar::DATEINFO::DATEINFO(int32_t day, |