summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-26 20:49:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-26 20:49:16 +0000
commit29d56a4476071b9aafd1fd7af725ee193bdec952 (patch)
tree4ccffbb45939673d423b3504d3d877fc1ccfa8f0
parent2cae3e26526a8aeef5744665589d1bfaf5efe6f3 (diff)
downloadpdfium-29d56a4476071b9aafd1fd7af725ee193bdec952.tar.xz
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 <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
-rw-r--r--fpdfsdk/formfiller/cffl_checkbox.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_combobox.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_pushbutton.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_radiobutton.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp2
6 files changed, 0 insertions, 12 deletions
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<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));
- 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<CPWL_Wnd> CFFL_ComboBox::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) {
auto pWnd = pdfium::MakeUnique<CPWL_ComboBox>(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<CPWL_Wnd> CFFL_ListBox::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) {
auto pWnd = pdfium::MakeUnique<CPWL_ListBox>(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<CPWL_Wnd> CFFL_PushButton::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) {
auto pWnd = pdfium::MakeUnique<CPWL_PushButton>(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<CPWL_Wnd> CFFL_RadioButton::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) {
auto pWnd = pdfium::MakeUnique<CPWL_RadioButton>(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<CPWL_Wnd> CFFL_TextField::NewPWLWindow(
std::unique_ptr<CPWL_Wnd::PrivateData> pAttachedData) {
auto pWnd = pdfium::MakeUnique<CPWL_Edit>(std::move(pAttachedData));
pWnd->AttachFFLData(this);
- if (cp.pParentWnd)
- cp.pParentWnd->AddChild(pWnd.get());
pWnd->Realize(cp);
pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller());