Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: fpdfsdk/formfiller/cffl_listbox.cpp

Issue 2173253002: Use smart pointers for class owned pointers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/formfiller/cffl_listbox.h ('k') | fpdfsdk/formfiller/cffl_textfield.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/formfiller/cffl_listbox.cpp
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index cbac83cb559e8c57e54d06741c2b5fc35ce2841a..a70a1f33ff025fd66044d9ecc32f5158201bd32c 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -16,11 +16,9 @@
#define FFL_DEFAULTLISTBOXFONTSIZE 12.0f
CFFL_ListBox::CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget)
- : CFFL_FormFiller(pApp, pWidget), m_pFontMap(nullptr) {}
+ : CFFL_FormFiller(pApp, pWidget) {}
-CFFL_ListBox::~CFFL_ListBox() {
- delete m_pFontMap;
-}
+CFFL_ListBox::~CFFL_ListBox() {}
PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() {
PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
@@ -37,8 +35,8 @@ PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() {
cp.fFontSize = FFL_DEFAULTLISTBOXFONTSIZE;
if (!m_pFontMap)
- m_pFontMap = new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler());
- cp.pFontMap = m_pFontMap;
+ m_pFontMap.reset(new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler()));
+ cp.pFontMap = m_pFontMap.get();
return cp;
}
« no previous file with comments | « fpdfsdk/formfiller/cffl_listbox.h ('k') | fpdfsdk/formfiller/cffl_textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698