summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_combobox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-03 12:27:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-03 12:27:25 -0700
commita5811f0edbaa3be7807dd84b3d4d7876289cef8a (patch)
tree1008064c03ae8288f6329f8fc1c3cec4b928a2f1 /xfa/fwl/core/ifwl_combobox.cpp
parent20ef5b93439a0e28cd612b824831f8dfcf234dfd (diff)
downloadpdfium-a5811f0edbaa3be7807dd84b3d4d7876289cef8a.tar.xz
Unify CFWL_WidgetProperties and CFWL_WidgetImpProperties.chromium/2909
The CFWL_WidgetProperties class was just being used to create default CFWL_WidgetImpProperties classes. This CL updates the code to make it clear that we have unique_ptrs to the properties and changes CFWL_WidgetImpProperties to be named CFWL_WidgetProperties. Review-Url: https://codereview.chromium.org/2469893004
Diffstat (limited to 'xfa/fwl/core/ifwl_combobox.cpp')
-rw-r--r--xfa/fwl/core/ifwl_combobox.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/xfa/fwl/core/ifwl_combobox.cpp b/xfa/fwl/core/ifwl_combobox.cpp
index 4be684abb9..6d0a814157 100644
--- a/xfa/fwl/core/ifwl_combobox.cpp
+++ b/xfa/fwl/core/ifwl_combobox.cpp
@@ -23,8 +23,8 @@
#include "xfa/fwl/core/ifwl_themeprovider.h"
IFWL_ComboBox::IFWL_ComboBox(const IFWL_App* app,
- const CFWL_WidgetImpProperties& properties)
- : IFWL_Widget(app, properties, nullptr),
+ std::unique_ptr<CFWL_WidgetProperties> properties)
+ : IFWL_Widget(app, std::move(properties), nullptr),
m_pComboBoxProxy(nullptr),
m_bLButtonDown(false),
m_iCurSel(-1),
@@ -41,17 +41,17 @@ IFWL_ComboBox::IFWL_ComboBox(const IFWL_App* app,
return;
}
- CFWL_WidgetImpProperties prop;
- prop.m_pThemeProvider = m_pProperties->m_pThemeProvider;
- prop.m_dwStyles |= FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
+ auto prop =
+ pdfium::MakeUnique<CFWL_WidgetProperties>(m_pProperties->m_pDataProvider);
+ prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
+ prop->m_dwStyles |= FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListItemIconText)
- prop.m_dwStyleExes |= FWL_STYLEEXT_LTB_Icon;
+ prop->m_dwStyleExes |= FWL_STYLEEXT_LTB_Icon;
- prop.m_pDataProvider = m_pProperties->m_pDataProvider;
- m_pListBox.reset(new IFWL_ComboList(m_pOwnerApp, prop, this));
+ m_pListBox.reset(new IFWL_ComboList(m_pOwnerApp, std::move(prop), this));
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown) && !m_pEdit) {
- CFWL_WidgetImpProperties prop2;
- m_pEdit.reset(new IFWL_ComboEdit(m_pOwnerApp, prop2, this));
+ m_pEdit.reset(new IFWL_ComboEdit(
+ m_pOwnerApp, pdfium::MakeUnique<CFWL_WidgetProperties>(), this));
m_pEdit->SetOuter(this);
}
if (m_pEdit)
@@ -99,8 +99,8 @@ FWL_Error IFWL_ComboBox::ModifyStylesEx(uint32_t dwStylesExAdded,
bool bAddDropDown = !!(dwStylesExAdded & FWL_STYLEEXT_CMB_DropDown);
bool bRemoveDropDown = !!(dwStylesExRemoved & FWL_STYLEEXT_CMB_DropDown);
if (bAddDropDown && !m_pEdit) {
- CFWL_WidgetImpProperties prop;
- m_pEdit.reset(new IFWL_ComboEdit(m_pOwnerApp, prop, nullptr));
+ m_pEdit.reset(new IFWL_ComboEdit(
+ m_pOwnerApp, pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr));
m_pEdit->SetOuter(this);
m_pEdit->SetParent(this);
} else if (bRemoveDropDown && m_pEdit) {
@@ -693,13 +693,13 @@ void IFWL_ComboBox::InitProxyForm() {
if (!m_pListBox)
return;
- CFWL_WidgetImpProperties propForm;
- propForm.m_pOwner = this;
- propForm.m_dwStyles = FWL_WGTSTYLE_Popup;
- propForm.m_dwStates = FWL_WGTSTATE_Invisible;
+ auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ prop->m_pOwner = this;
+ prop->m_dwStyles = FWL_WGTSTYLE_Popup;
+ prop->m_dwStates = FWL_WGTSTATE_Invisible;
- m_pComboBoxProxy =
- new IFWL_ComboBoxProxy(this, m_pOwnerApp, propForm, m_pListBox.get());
+ m_pComboBoxProxy = new IFWL_ComboBoxProxy(this, m_pOwnerApp, std::move(prop),
+ m_pListBox.get());
m_pListBox->SetParent(m_pComboBoxProxy);
}
@@ -707,23 +707,23 @@ void IFWL_ComboBox::DisForm_InitComboList() {
if (m_pListBox)
return;
- CFWL_WidgetImpProperties prop;
- prop.m_pParent = this;
- prop.m_dwStyles = FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
- prop.m_dwStates = FWL_WGTSTATE_Invisible;
- prop.m_pDataProvider = m_pProperties->m_pDataProvider;
- prop.m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pListBox.reset(new IFWL_ComboList(m_pOwnerApp, prop, this));
+ auto prop =
+ pdfium::MakeUnique<CFWL_WidgetProperties>(m_pProperties->m_pDataProvider);
+ prop->m_pParent = this;
+ prop->m_dwStyles = FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
+ prop->m_dwStates = FWL_WGTSTATE_Invisible;
+ prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
+ m_pListBox.reset(new IFWL_ComboList(m_pOwnerApp, std::move(prop), this));
}
void IFWL_ComboBox::DisForm_InitComboEdit() {
if (m_pEdit)
return;
- CFWL_WidgetImpProperties prop;
- prop.m_pParent = this;
- prop.m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pEdit.reset(new IFWL_ComboEdit(m_pOwnerApp, prop, this));
+ auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ prop->m_pParent = this;
+ prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
+ m_pEdit.reset(new IFWL_ComboEdit(m_pOwnerApp, std::move(prop), this));
m_pEdit->SetOuter(this);
}