summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_listbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller/cffl_listbox.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index 3ca95a89d4..3c74875d43 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -6,12 +6,15 @@
#include "fpdfsdk/formfiller/cffl_listbox.h"
+#include <utility>
+
#include "fpdfsdk/cpdfsdk_common.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cba_fontmap.h"
#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fpdfsdk/pwl/cpwl_list_box.h"
+#include "third_party/base/ptr_util.h"
#define FFL_DEFAULTLISTBOXFONTSIZE 12.0f
@@ -36,8 +39,9 @@ CPWL_Wnd::CreateParams CFFL_ListBox::GetCreateParam() {
return cp;
}
-CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const CPWL_Wnd::CreateParams& cp) {
- auto* pWnd = new CPWL_ListBox();
+std::unique_ptr<CPWL_Wnd> CFFL_ListBox::NewPDFWindow(
+ const CPWL_Wnd::CreateParams& cp) {
+ auto pWnd = pdfium::MakeUnique<CPWL_ListBox>();
pWnd->AttachFFLData(this);
pWnd->Create(cp);
pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller());
@@ -69,8 +73,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const CPWL_Wnd::CreateParams& cp) {
}
pWnd->SetTopVisibleIndex(m_pWidget->GetTopVisibleIndex());
-
- return pWnd;
+ return std::move(pWnd);
}
bool CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot,