From 29d56a4476071b9aafd1fd7af725ee193bdec952 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 26 Oct 2018 20:49:16 +0000 Subject: cp.pParentWindow is always NULL in NewPWLWindow() Because the CreateParams come from one of the GetCreateParam() overrides, and none of these set that particual field. This implies that the caller will always own the result, since it is never handed off by an AddChild() call, which is consistent with the function return. Change-Id: I1a9f580f347e911855c695807795541282d43f3f Reviewed-on: https://pdfium-review.googlesource.com/c/44691 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fpdfsdk/formfiller/cffl_checkbox.cpp | 2 -- fpdfsdk/formfiller/cffl_combobox.cpp | 2 -- fpdfsdk/formfiller/cffl_listbox.cpp | 2 -- fpdfsdk/formfiller/cffl_pushbutton.cpp | 2 -- fpdfsdk/formfiller/cffl_radiobutton.cpp | 2 -- fpdfsdk/formfiller/cffl_textfield.cpp | 2 -- 6 files changed, 12 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp index d9add785aa..fbf6c34bf8 100644 --- a/fpdfsdk/formfiller/cffl_checkbox.cpp +++ b/fpdfsdk/formfiller/cffl_checkbox.cpp @@ -25,8 +25,6 @@ std::unique_ptr CFFL_CheckBox::NewPWLWindow( const CPWL_Wnd::CreateParams& cp, std::unique_ptr pAttachedData) { auto pWnd = pdfium::MakeUnique(std::move(pAttachedData)); - if (cp.pParentWnd) - cp.pParentWnd->AddChild(pWnd.get()); pWnd->Realize(cp); pWnd->SetCheck(m_pWidget->IsChecked()); return std::move(pWnd); diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp index 7d2124c306..358596e526 100644 --- a/fpdfsdk/formfiller/cffl_combobox.cpp +++ b/fpdfsdk/formfiller/cffl_combobox.cpp @@ -48,8 +48,6 @@ std::unique_ptr CFFL_ComboBox::NewPWLWindow( const CPWL_Wnd::CreateParams& cp, std::unique_ptr pAttachedData) { auto pWnd = pdfium::MakeUnique(std::move(pAttachedData)); - if (cp.pParentWnd) - cp.pParentWnd->AddChild(pWnd.get()); pWnd->AttachFFLData(this); pWnd->Realize(cp); diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp index 335073293f..e601c8305e 100644 --- a/fpdfsdk/formfiller/cffl_listbox.cpp +++ b/fpdfsdk/formfiller/cffl_listbox.cpp @@ -43,8 +43,6 @@ std::unique_ptr CFFL_ListBox::NewPWLWindow( const CPWL_Wnd::CreateParams& cp, std::unique_ptr pAttachedData) { auto pWnd = pdfium::MakeUnique(std::move(pAttachedData)); - if (cp.pParentWnd) - cp.pParentWnd->AddChild(pWnd.get()); pWnd->AttachFFLData(this); pWnd->Realize(cp); pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller()); diff --git a/fpdfsdk/formfiller/cffl_pushbutton.cpp b/fpdfsdk/formfiller/cffl_pushbutton.cpp index 4c9a1ed4cb..d7a421886c 100644 --- a/fpdfsdk/formfiller/cffl_pushbutton.cpp +++ b/fpdfsdk/formfiller/cffl_pushbutton.cpp @@ -21,8 +21,6 @@ std::unique_ptr CFFL_PushButton::NewPWLWindow( const CPWL_Wnd::CreateParams& cp, std::unique_ptr pAttachedData) { auto pWnd = pdfium::MakeUnique(std::move(pAttachedData)); - if (cp.pParentWnd) - cp.pParentWnd->AddChild(pWnd.get()); pWnd->Realize(cp); return std::move(pWnd); } diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp index f987d7613c..ffe1ee7f2b 100644 --- a/fpdfsdk/formfiller/cffl_radiobutton.cpp +++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp @@ -24,8 +24,6 @@ std::unique_ptr CFFL_RadioButton::NewPWLWindow( const CPWL_Wnd::CreateParams& cp, std::unique_ptr pAttachedData) { auto pWnd = pdfium::MakeUnique(std::move(pAttachedData)); - if (cp.pParentWnd) - cp.pParentWnd->AddChild(pWnd.get()); pWnd->Realize(cp); pWnd->SetCheck(m_pWidget->IsChecked()); return std::move(pWnd); diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp index fbbc63763b..79f4f3d3e8 100644 --- a/fpdfsdk/formfiller/cffl_textfield.cpp +++ b/fpdfsdk/formfiller/cffl_textfield.cpp @@ -74,8 +74,6 @@ std::unique_ptr CFFL_TextField::NewPWLWindow( std::unique_ptr pAttachedData) { auto pWnd = pdfium::MakeUnique(std::move(pAttachedData)); pWnd->AttachFFLData(this); - if (cp.pParentWnd) - cp.pParentWnd->AddChild(pWnd.get()); pWnd->Realize(cp); pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller()); -- cgit v1.2.3