Index: xfa/fwl/core/cfwl_widget.cpp |
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp |
index 9aeb127e9e67d1f91d1e993ca75a410876a2896c..ef5d3e41a89a2ecb80250418c40438887e985590 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,12 @@ 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) |
Tom Sepez
2016/10/31 19:12:33
nit: maybe invert the test and remove early return
dsinclair
2016/10/31 19:54:50
Done.
|
+ return; |
+ m_pIface->SetCurrentDelegate(pDelegate); |
} |