From b7c4a0243e82f6c4ff91cd90b5bae336100c3c70 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 26 Oct 2018 23:56:27 +0000 Subject: Pass CreateParams to CPWL_Wnd constructor. The previous reshuffling means we always have the create params earlier, so pass them in at create time. Clean up two forward declarations that were not needed as noticed in the process. Change-Id: I5d3861f3c1e3508e0d25950e919859244fac5f8b Reviewed-on: https://pdfium-review.googlesource.com/c/44710 Reviewed-by: Tom Sepez Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fpdfsdk/pwl/cpwl_combo_box.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'fpdfsdk/pwl/cpwl_combo_box.cpp') diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp index 887b0225e5..eef4496118 100644 --- a/fpdfsdk/pwl/cpwl_combo_box.cpp +++ b/fpdfsdk/pwl/cpwl_combo_box.cpp @@ -27,8 +27,9 @@ constexpr int kDefaultButtonWidth = 13; } // namespace -CPWL_CBListBox::CPWL_CBListBox(std::unique_ptr pAttachedData) - : CPWL_ListBox(std::move(pAttachedData)) {} +CPWL_CBListBox::CPWL_CBListBox(const CreateParams& cp, + std::unique_ptr pAttachedData) + : CPWL_ListBox(cp, std::move(pAttachedData)) {} CPWL_CBListBox::~CPWL_CBListBox() = default; @@ -100,8 +101,9 @@ bool CPWL_CBListBox::OnCharNotify(uint16_t nChar, uint32_t nFlag) { return OnNotifySelectionChanged(true, nFlag); } -CPWL_CBButton::CPWL_CBButton(std::unique_ptr pAttachedData) - : CPWL_Wnd(std::move(pAttachedData)) {} +CPWL_CBButton::CPWL_CBButton(const CreateParams& cp, + std::unique_ptr pAttachedData) + : CPWL_Wnd(cp, std::move(pAttachedData)) {} CPWL_CBButton::~CPWL_CBButton() = default; @@ -156,8 +158,9 @@ bool CPWL_CBButton::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) { return true; } -CPWL_ComboBox::CPWL_ComboBox(std::unique_ptr pAttachedData) - : CPWL_Wnd(std::move(pAttachedData)) {} +CPWL_ComboBox::CPWL_ComboBox(const CreateParams& cp, + std::unique_ptr pAttachedData) + : CPWL_Wnd(cp, std::move(pAttachedData)) {} CPWL_ComboBox::~CPWL_ComboBox() = default; @@ -286,11 +289,11 @@ void CPWL_ComboBox::CreateEdit(const CreateParams& cp) { ecp.dwBorderWidth = 0; ecp.nBorderStyle = BorderStyle::SOLID; - auto pEdit = pdfium::MakeUnique(CloneAttachedData()); + auto pEdit = pdfium::MakeUnique(ecp, CloneAttachedData()); m_pEdit = pEdit.get(); m_pEdit->AttachFFLData(m_pFormFiller.Get()); AddChild(std::move(pEdit)); - m_pEdit->Realize(ecp); + m_pEdit->Realize(); } void CPWL_ComboBox::CreateButton(const CreateParams& cp) { @@ -306,10 +309,10 @@ void CPWL_ComboBox::CreateButton(const CreateParams& cp) { bcp.nBorderStyle = BorderStyle::BEVELED; bcp.eCursorType = FXCT_ARROW; - auto pButton = pdfium::MakeUnique(CloneAttachedData()); + auto pButton = pdfium::MakeUnique(bcp, CloneAttachedData()); m_pButton = pButton.get(); AddChild(std::move(pButton)); - m_pButton->Realize(bcp); + m_pButton->Realize(); } void CPWL_ComboBox::CreateListBox(const CreateParams& cp) { @@ -333,11 +336,11 @@ void CPWL_ComboBox::CreateListBox(const CreateParams& cp) { if (cp.sBackgroundColor.nColorType == CFX_Color::kTransparent) lcp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR; - auto pList = pdfium::MakeUnique(CloneAttachedData()); + auto pList = pdfium::MakeUnique(lcp, CloneAttachedData()); m_pList = pList.get(); m_pList->AttachFFLData(m_pFormFiller.Get()); AddChild(std::move(pList)); - m_pList->Realize(lcp); + m_pList->Realize(); } bool CPWL_ComboBox::RePosChildWnd() { -- cgit v1.2.3