summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_checkbox.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-26 19:42:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-26 19:42:40 +0000
commit7df950ac2ef484880fe3cbfb9961bed34fee191d (patch)
tree922958659a46f1344c61cf16a1f7b92b3541ac1d /fpdfsdk/formfiller/cffl_checkbox.cpp
parent385bf2e0481230b1f5e50a2627063383bd297451 (diff)
downloadpdfium-7df950ac2ef484880fe3cbfb9961bed34fee191d.tar.xz
Stop transfering ownership of |this| as CPWL_Wnd::Create() side-effect
Instead, make it an explicit method called on the parent outside of create. Rename Create() to Realize() to be sure to catch all usages, and add the new required call. Attachment to the parent now takes place a little earlier on in the life-cycle as a result but should be ok. Precursor to converting to smart pointers. Change-Id: I45c459fcd28b5d03c428ce5809d0432506cf4ec6 Reviewed-on: https://pdfium-review.googlesource.com/c/44690 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_checkbox.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_checkbox.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index 3dbac1aa84..d9add785aa 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -25,7 +25,9 @@ std::unique_ptr<CPWL_Wnd> CFFL_CheckBox::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) {
auto pWnd = pdfium::MakeUnique<CPWL_CheckBox>(std::move(pAttachedData));
- pWnd->Create(cp);
+ if (cp.pParentWnd)
+ cp.pParentWnd->AddChild(pWnd.get());
+ pWnd->Realize(cp);
pWnd->SetCheck(m_pWidget->IsChecked());
return std::move(pWnd);
}