Remove bare |new| in CPWL_ListImpl constructor.
The equivalent member is already an unique_ptr, so initialize it
with MakeUnique<>().
- Do some scalar inits in header.
Change-Id: Iaa163c9c33fe21f8691eaf5807621662ec497d2b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/57452
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/pwl/cpwl_list_impl.cpp b/fpdfsdk/pwl/cpwl_list_impl.cpp
index edcf138..e06dedb 100644
--- a/fpdfsdk/pwl/cpwl_list_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_list_impl.cpp
@@ -16,15 +16,12 @@
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
-CPWL_ListCtrl::Item::Item()
- : m_pEdit(new CPWL_EditImpl),
- m_bSelected(false),
- m_rcListItem(0.0f, 0.0f, 0.0f, 0.0f) {
+CPWL_ListCtrl::Item::Item() : m_pEdit(pdfium::MakeUnique<CPWL_EditImpl>()) {
m_pEdit->SetAlignmentV(1, true);
m_pEdit->Initialize();
}
-CPWL_ListCtrl::Item::~Item() {}
+CPWL_ListCtrl::Item::~Item() = default;
void CPWL_ListCtrl::Item::SetFontMap(IPVT_FontMap* pFontMap) {
m_pEdit->SetFontMap(pFontMap);
diff --git a/fpdfsdk/pwl/cpwl_list_impl.h b/fpdfsdk/pwl/cpwl_list_impl.h
index 95e4e4e..baf5c6f 100644
--- a/fpdfsdk/pwl/cpwl_list_impl.h
+++ b/fpdfsdk/pwl/cpwl_list_impl.h
@@ -115,9 +115,9 @@
private:
CPWL_EditImpl_Iterator* GetIterator() const;
- std::unique_ptr<CPWL_EditImpl> m_pEdit;
- bool m_bSelected;
+ bool m_bSelected = false;
CFX_FloatRect m_rcListItem;
+ std::unique_ptr<CPWL_EditImpl> const m_pEdit;
};
CFX_PointF InToOut(const CFX_PointF& point) const;