summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_widget.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/cfwl_widget.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/cfwl_widget.cpp')
-rw-r--r--xfa/fwl/core/cfwl_widget.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp
index 9aeb127e9e..d277f26a76 100644
--- a/xfa/fwl/core/cfwl_widget.cpp
+++ b/xfa/fwl/core/cfwl_widget.cpp
@@ -20,7 +20,6 @@
CFWL_Widget::CFWL_Widget(const IFWL_App* app)
: m_pApp(app),
- m_pDelegate(nullptr),
m_pWidgetMgr(app->GetWidgetMgr()),
m_pProperties(new CFWL_WidgetProperties) {
ASSERT(m_pWidgetMgr);
@@ -131,10 +130,11 @@ FWL_Error CFWL_Widget::DrawWidget(CFX_Graphics* pGraphics,
return m_pIface->DrawWidget(pGraphics, pMatrix);
}
-IFWL_WidgetDelegate* CFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) {
- if (!m_pIface)
- return nullptr;
+IFWL_WidgetDelegate* CFWL_Widget::GetCurrentDelegate() {
+ return m_pIface ? m_pIface->GetCurrentDelegate() : nullptr;
+}
- m_pDelegate = m_pIface->SetDelegate(pDelegate);
- return m_pDelegate;
+void CFWL_Widget::SetCurrentDelegate(IFWL_WidgetDelegate* pDelegate) {
+ if (m_pIface)
+ m_pIface->SetCurrentDelegate(pDelegate);
}