diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-26 23:56:27 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-26 23:56:27 +0000 |
commit | b7c4a0243e82f6c4ff91cd90b5bae336100c3c70 (patch) | |
tree | 782b8b225dbc01d78c0dff7b126f90f606d13fb1 /fpdfsdk/pwl/cpwl_combo_box.cpp | |
parent | 314380e271d0a1e3117c67cb5a417cbc5b5b81b3 (diff) | |
download | pdfium-chromium/3594.tar.xz |
Pass CreateParams to CPWL_Wnd constructor.chromium/3595chromium/3594
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 <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl/cpwl_combo_box.cpp')
-rw-r--r-- | fpdfsdk/pwl/cpwl_combo_box.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
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<PrivateData> pAttachedData) - : CPWL_ListBox(std::move(pAttachedData)) {} +CPWL_CBListBox::CPWL_CBListBox(const CreateParams& cp, + std::unique_ptr<PrivateData> 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<PrivateData> pAttachedData) - : CPWL_Wnd(std::move(pAttachedData)) {} +CPWL_CBButton::CPWL_CBButton(const CreateParams& cp, + std::unique_ptr<PrivateData> 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<PrivateData> pAttachedData) - : CPWL_Wnd(std::move(pAttachedData)) {} +CPWL_ComboBox::CPWL_ComboBox(const CreateParams& cp, + std::unique_ptr<PrivateData> 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<CPWL_Edit>(CloneAttachedData()); + auto pEdit = pdfium::MakeUnique<CPWL_Edit>(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<CPWL_CBButton>(CloneAttachedData()); + auto pButton = pdfium::MakeUnique<CPWL_CBButton>(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<CPWL_CBListBox>(CloneAttachedData()); + auto pList = pdfium::MakeUnique<CPWL_CBListBox>(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() { |