Index: xfa/fwl/core/cfwl_widget.cpp |
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp |
index 7f6bd3b07c2c3fc9a6ef4d795803c29b2675c53c..d7903ea8a86f7143074efc0382984e6c6611abe7 100644 |
--- a/xfa/fwl/core/cfwl_widget.cpp |
+++ b/xfa/fwl/core/cfwl_widget.cpp |
@@ -18,9 +18,10 @@ |
#define FWL_WGT_CalcWidth 2048 |
#define FWL_WGT_CalcMultiLineDefWidth 120.0f |
-CFWL_Widget::CFWL_Widget() |
- : m_pDelegate(nullptr), |
- m_pWidgetMgr(CFWL_WidgetMgr::GetInstance()), |
+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); |
} |
@@ -30,6 +31,11 @@ CFWL_Widget::~CFWL_Widget() { |
m_pIface->Finalize(); |
} |
+void CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) { |
+ ASSERT(m_pIface); |
+ m_pIface->SetAssociateWidget(this); |
+} |
+ |
IFWL_Widget* CFWL_Widget::GetWidget() { |
return m_pIface.get(); |
} |
@@ -38,13 +44,6 @@ const IFWL_Widget* CFWL_Widget::GetWidget() const { |
return m_pIface.get(); |
} |
-FWL_Error CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) { |
- if (!m_pIface) |
- return FWL_Error::Indefinite; |
- m_pIface->SetAssociateWidget(this); |
- return FWL_Error::Succeeded; |
-} |
- |
FWL_Error CFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
if (!m_pIface) |
return FWL_Error::Indefinite; |