summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_datetimepicker.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-01 08:33:02 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-01 08:33:02 -0700
commit9ec22175f945d227e71c459e7e0b7c464159c18b (patch)
tree1c4836aa35a9e8a1da1761562088b1f9df6aa94f /xfa/fwl/core/ifwl_datetimepicker.cpp
parent5a22582ca1dbe1d66b18d5253bfa1d202fcc3b4a (diff)
downloadpdfium-9ec22175f945d227e71c459e7e0b7c464159c18b.tar.xz
Rename IFWL_Widget::SetDelegate
The ::SetDelegate method was misleading. The primary use was SetDelegate(nullptr) which returned the current delegate and didn't actually set anything. When a value was passed it would set the |m_pCurDelegate| not the |m_pDelegate|. This Cl breaks ::SetDelegate into ::GetCurrentDelegate and ::SetCurrentDelegate to make it clear what is happening and that this does not effect the |m_pDelegate| variable. Review-Url: https://codereview.chromium.org/2459423003
Diffstat (limited to 'xfa/fwl/core/ifwl_datetimepicker.cpp')
-rw-r--r--xfa/fwl/core/ifwl_datetimepicker.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/xfa/fwl/core/ifwl_datetimepicker.cpp b/xfa/fwl/core/ifwl_datetimepicker.cpp
index 9292a5acfa..148a85cfe6 100644
--- a/xfa/fwl/core/ifwl_datetimepicker.cpp
+++ b/xfa/fwl/core/ifwl_datetimepicker.cpp
@@ -545,8 +545,7 @@ void IFWL_DateTimePicker::DisForm_ShowMonthCalendar(FX_BOOL bActivate) {
CFWL_MsgSetFocus msg;
msg.m_pDstTarget = m_pMonthCal.get();
msg.m_pSrcTarget = m_pEdit.get();
- IFWL_WidgetDelegate* pDelegate = m_pEdit->SetDelegate(nullptr);
- pDelegate->OnProcessMessage(&msg);
+ m_pEdit->GetCurrentDelegate()->OnProcessMessage(&msg);
}
CFX_RectF rtInvalidate, rtCal;
rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width,
@@ -712,9 +711,7 @@ void CFWL_DateTimePickerImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
}
case CFWL_MessageType::Key: {
if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
- IFWL_WidgetDelegate* pDelegate =
- m_pOwner->m_pEdit->SetDelegate(nullptr);
- pDelegate->OnProcessMessage(pMessage);
+ m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMessage);
return;
}
break;
@@ -817,8 +814,7 @@ void CFWL_DateTimePickerImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg,
}
rtInvalidate = m_pOwner->m_rtBtn;
pMsg->m_pDstTarget = m_pOwner->m_pEdit.get();
- IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr);
- pDelegate->OnProcessMessage(pMsg);
+ m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg);
} else {
m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
m_pOwner->m_rtBtn.Set(0, 0, 0, 0);
@@ -827,8 +823,7 @@ void CFWL_DateTimePickerImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg,
}
if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get();
- IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(nullptr);
- pDelegate->OnProcessMessage(pMsg);
+ m_pOwner->m_pEdit->GetCurrentDelegate()->OnProcessMessage(pMsg);
}
}
rtInvalidate.Inflate(2, 2);