From 20855384b8149a631c3c1d229551523c12eb767b Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 31 Oct 2016 07:29:34 -0700 Subject: Remove FWL globals. This CL removes the FWL_GetApp, FWL_SetApp and FWL_GetWidgetAdapter methods. In the process it changes the various Initialize methods to return void. Review-Url: https://codereview.chromium.org/2436103002 --- xfa/fwl/core/ifwl_checkbox.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'xfa/fwl/core/ifwl_checkbox.cpp') diff --git a/xfa/fwl/core/ifwl_checkbox.cpp b/xfa/fwl/core/ifwl_checkbox.cpp index 2dd8c2d5db..8af413e602 100644 --- a/xfa/fwl/core/ifwl_checkbox.cpp +++ b/xfa/fwl/core/ifwl_checkbox.cpp @@ -13,6 +13,7 @@ #include "xfa/fwl/core/cfwl_themebackground.h" #include "xfa/fwl/core/cfwl_themetext.h" #include "xfa/fwl/core/cfwl_widgetmgr.h" +#include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/fwl_noteimp.h" #include "xfa/fwl/core/ifwl_checkbox.h" #include "xfa/fwl/core/ifwl_themeprovider.h" @@ -23,8 +24,9 @@ const int kCaptionMargin = 5; } // namespace -IFWL_CheckBox::IFWL_CheckBox(const CFWL_WidgetImpProperties& properties) - : IFWL_Widget(properties, nullptr), +IFWL_CheckBox::IFWL_CheckBox(const IFWL_App* app, + const CFWL_WidgetImpProperties& properties) + : IFWL_Widget(app, properties, nullptr), m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), m_iTTOAlign(FDE_TTOALIGNMENT_Center), m_bBtnDown(FALSE) { @@ -36,16 +38,9 @@ IFWL_CheckBox::IFWL_CheckBox(const CFWL_WidgetImpProperties& properties) IFWL_CheckBox::~IFWL_CheckBox() {} -FWL_Type IFWL_CheckBox::GetClassID() const { - return FWL_Type::CheckBox; -} - -FWL_Error IFWL_CheckBox::Initialize() { - if (IFWL_Widget::Initialize() != FWL_Error::Succeeded) - return FWL_Error::Indefinite; - +void IFWL_CheckBox::Initialize() { + IFWL_Widget::Initialize(); m_pDelegate = new CFWL_CheckBoxImpDelegate(this); - return FWL_Error::Succeeded; } void IFWL_CheckBox::Finalize() { @@ -54,6 +49,10 @@ void IFWL_CheckBox::Finalize() { IFWL_Widget::Finalize(); } +FWL_Type IFWL_CheckBox::GetClassID() const { + return FWL_Type::CheckBox; +} + FWL_Error IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (bAutoSize) { rect.Set(0, 0, 0, 0); @@ -353,7 +352,7 @@ void IFWL_CheckBox::NextStates() { if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) { if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Unchecked) { - CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); + CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr(); if (!pWidgetMgr->IsFormDisabled()) { CFX_ArrayTemplate radioarr; pWidgetMgr->GetSameGroupRadioButton(this, radioarr); -- cgit v1.2.3