summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_checkbox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-07 10:28:47 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-07 10:28:47 -0800
commiteb3f68cc7f25a1e28464eb251161b8f08fcd04bc (patch)
tree36e565bac1a7760e605b181b7da4c08bda151cdd /xfa/fwl/core/cfwl_checkbox.cpp
parenta97fc7c6392c0adbd702bdf898cb9e20cee00a3e (diff)
downloadpdfium-eb3f68cc7f25a1e28464eb251161b8f08fcd04bc.tar.xz
Fold DataProviders into parent classes
This CL removes the data provider classes and folds the code into the parent classes. Review-Url: https://codereview.chromium.org/2480233003
Diffstat (limited to 'xfa/fwl/core/cfwl_checkbox.cpp')
-rw-r--r--xfa/fwl/core/cfwl_checkbox.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/xfa/fwl/core/cfwl_checkbox.cpp b/xfa/fwl/core/cfwl_checkbox.cpp
index 9baea41c4d..5372083b4c 100644
--- a/xfa/fwl/core/cfwl_checkbox.cpp
+++ b/xfa/fwl/core/cfwl_checkbox.cpp
@@ -19,7 +19,8 @@ IFWL_CheckBox* ToCheckBox(IFWL_Widget* widget) {
} // namespace
-CFWL_CheckBox::CFWL_CheckBox(const IFWL_App* app) : CFWL_Widget(app) {}
+CFWL_CheckBox::CFWL_CheckBox(const IFWL_App* app)
+ : CFWL_Widget(app), m_fBoxHeight(16.0f), m_wsCaption(L"Check box") {}
CFWL_CheckBox::~CFWL_CheckBox() {}
@@ -27,18 +28,18 @@ void CFWL_CheckBox::Initialize() {
ASSERT(!m_pIface);
m_pIface = pdfium::MakeUnique<IFWL_CheckBox>(
- m_pApp, pdfium::MakeUnique<CFWL_WidgetProperties>(&m_checkboxData));
+ m_pApp, pdfium::MakeUnique<CFWL_WidgetProperties>(this));
CFWL_Widget::Initialize();
}
FWL_Error CFWL_CheckBox::SetCaption(const CFX_WideStringC& wsCaption) {
- m_checkboxData.m_wsCaption = wsCaption;
+ m_wsCaption = wsCaption;
return FWL_Error::Succeeded;
}
FWL_Error CFWL_CheckBox::SetBoxSize(FX_FLOAT fHeight) {
- m_checkboxData.m_fBoxHeight = fHeight;
+ m_fBoxHeight = fHeight;
return FWL_Error::Succeeded;
}
@@ -50,16 +51,12 @@ FWL_Error CFWL_CheckBox::SetCheckState(int32_t iCheck) {
return ToCheckBox(GetWidget())->SetCheckState(iCheck);
}
-CFWL_CheckBox::CFWL_CheckBoxDP::CFWL_CheckBoxDP()
- : m_fBoxHeight(16.0f), m_wsCaption(L"Check box") {}
-
-FWL_Error CFWL_CheckBox::CFWL_CheckBoxDP::GetCaption(
- IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) {
+FWL_Error CFWL_CheckBox::GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) {
wsCaption = m_wsCaption;
return FWL_Error::Succeeded;
}
-FX_FLOAT CFWL_CheckBox::CFWL_CheckBoxDP::GetBoxSize(IFWL_Widget* pWidget) {
+FX_FLOAT CFWL_CheckBox::GetBoxSize(IFWL_Widget* pWidget) {
return m_fBoxHeight;
}