summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/core/cfwl_widget.cpp')
-rw-r--r--xfa/fwl/core/cfwl_widget.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp
index 7f6bd3b07c..d7903ea8a8 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;