summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_datetimepicker.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-12-14 06:25:02 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 06:25:02 -0800
commit603f57b85c0643f0598f03b97c4525501f3e1221 (patch)
tree85c9521a8f0fec47ba84041d64cb84e6bc019638 /xfa/fwl/cfwl_datetimepicker.cpp
parenta9caab94c1f16929e5acf2676117224617d80f53 (diff)
downloadpdfium-603f57b85c0643f0598f03b97c4525501f3e1221.tar.xz
Update CFWL_ListBox to return instead of using out params.
This CL updates the CFWL_ListBox code to work with return values instead of out params. This also extracts the CFWL_ListItem code out of CFWL_ListBox and puts into the correct class. Review-Url: https://codereview.chromium.org/2572783002
Diffstat (limited to 'xfa/fwl/cfwl_datetimepicker.cpp')
-rw-r--r--xfa/fwl/cfwl_datetimepicker.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index 10e26b4891..5819a27cfc 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -183,19 +183,18 @@ CFX_WideString CFWL_DateTimePicker::GetEditText() const {
return m_pEdit ? m_pEdit->GetText() : L"";
}
-void CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) const {
- if (m_pWidgetMgr->IsFormDisabled()) {
- DisForm_GetBBox(rect);
- return;
- }
+CFX_RectF CFWL_DateTimePicker::GetBBox() const {
+ if (m_pWidgetMgr->IsFormDisabled())
+ return DisForm_GetBBox();
- rect = m_pProperties->m_rtWidget;
- if (IsMonthCalendarVisible()) {
- CFX_RectF rtMonth = m_pMonthCal->GetWidgetRect();
- rtMonth.Offset(m_pProperties->m_rtWidget.left,
- m_pProperties->m_rtWidget.top);
- rect.Union(rtMonth);
- }
+ CFX_RectF rect = m_pProperties->m_rtWidget;
+ if (!IsMonthCalendarVisible())
+ return rect;
+
+ CFX_RectF rtMonth = m_pMonthCal->GetWidgetRect();
+ rtMonth.Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top);
+ rect.Union(rtMonth);
+ return rect;
}
void CFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded,
@@ -450,16 +449,17 @@ void CFWL_DateTimePicker::DisForm_Update() {
m_pMonthCal->Update();
}
-void CFWL_DateTimePicker::DisForm_GetBBox(CFX_RectF& rect) const {
- rect = m_pProperties->m_rtWidget;
+CFX_RectF CFWL_DateTimePicker::DisForm_GetBBox() const {
+ CFX_RectF rect = m_pProperties->m_rtWidget;
if (DisForm_IsNeedShowButton())
rect.width += m_fBtn;
if (!IsMonthCalendarVisible())
- return;
+ return rect;
CFX_RectF rtMonth = m_pMonthCal->GetWidgetRect();
rtMonth.Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top);
rect.Union(rtMonth);
+ return rect;
}
void CFWL_DateTimePicker::DisForm_DrawWidget(CFX_Graphics* pGraphics,