summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_checkbox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-31 07:29:34 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-31 07:29:34 -0700
commit20855384b8149a631c3c1d229551523c12eb767b (patch)
treee3cef278e322742bea6c4b48f40ed580754ebd80 /xfa/fwl/core/ifwl_checkbox.cpp
parent747dcf775c5cb661e96a639f73322cc489d8590f (diff)
downloadpdfium-20855384b8149a631c3c1d229551523c12eb767b.tar.xz
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
Diffstat (limited to 'xfa/fwl/core/ifwl_checkbox.cpp')
-rw-r--r--xfa/fwl/core/ifwl_checkbox.cpp23
1 files changed, 11 insertions, 12 deletions
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<IFWL_Widget*> radioarr;
pWidgetMgr->GetSameGroupRadioButton(this, radioarr);