summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_combo_box.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pwl/cpwl_combo_box.cpp')
-rw-r--r--fpdfsdk/pwl/cpwl_combo_box.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp
index 341bd93e41..bb5890b519 100644
--- a/fpdfsdk/pwl/cpwl_combo_box.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box.cpp
@@ -8,6 +8,7 @@
#include <algorithm>
#include <sstream>
+#include <utility>
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
@@ -26,6 +27,11 @@ constexpr int kDefaultButtonWidth = 13;
} // namespace
+CPWL_CBListBox::CPWL_CBListBox(std::unique_ptr<PrivateData> pAttachedData)
+ : CPWL_ListBox(std::move(pAttachedData)) {}
+
+CPWL_CBListBox::~CPWL_CBListBox() = default;
+
bool CPWL_CBListBox::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnLButtonUp(point, nFlag);
@@ -94,6 +100,11 @@ bool CPWL_CBListBox::OnCharNotify(uint16_t nChar, uint32_t nFlag) {
return OnNotifySelectionChanged(true, nFlag);
}
+CPWL_CBButton::CPWL_CBButton(std::unique_ptr<PrivateData> pAttachedData)
+ : CPWL_Wnd(std::move(pAttachedData)) {}
+
+CPWL_CBButton::~CPWL_CBButton() = default;
+
void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
const CFX_Matrix& mtUser2Device) {
CPWL_Wnd::DrawThisAppearance(pDevice, mtUser2Device);
@@ -132,7 +143,6 @@ bool CPWL_CBButton::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnLButtonDown(point, nFlag);
SetCapture();
-
if (CPWL_Wnd* pParent = GetParentWindow())
pParent->NotifyLButtonDown(this, point);
@@ -143,13 +153,13 @@ bool CPWL_CBButton::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnLButtonUp(point, nFlag);
ReleaseCapture();
-
return true;
}
-CPWL_ComboBox::CPWL_ComboBox() {}
+CPWL_ComboBox::CPWL_ComboBox(std::unique_ptr<PrivateData> pAttachedData)
+ : CPWL_Wnd(std::move(pAttachedData)) {}
-CPWL_ComboBox::~CPWL_ComboBox() {}
+CPWL_ComboBox::~CPWL_ComboBox() = default;
void CPWL_ComboBox::OnCreate(CreateParams* pParamsToAdjust) {
pParamsToAdjust->dwFlags &= ~PWS_HSCROLL;
@@ -262,7 +272,7 @@ void CPWL_ComboBox::CreateEdit(const CreateParams& cp) {
if (m_pEdit)
return;
- m_pEdit = new CPWL_Edit();
+ m_pEdit = new CPWL_Edit(CloneAttachedData());
m_pEdit->AttachFFLData(m_pFormFiller.Get());
CreateParams ecp = cp;
@@ -286,7 +296,7 @@ void CPWL_ComboBox::CreateButton(const CreateParams& cp) {
if (m_pButton)
return;
- m_pButton = new CPWL_CBButton;
+ m_pButton = new CPWL_CBButton(CloneAttachedData());
CreateParams bcp = cp;
bcp.pParentWnd = this;
@@ -304,7 +314,7 @@ void CPWL_ComboBox::CreateListBox(const CreateParams& cp) {
if (m_pList)
return;
- m_pList = new CPWL_CBListBox();
+ m_pList = new CPWL_CBListBox(CloneAttachedData());
m_pList->AttachFFLData(m_pFormFiller.Get());
CreateParams lcp = cp;