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

Unified Diff: fpdfsdk/formfiller/cffl_textfield.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_textfield.h ('k') | fpdfsdk/fpdfxfa/fpdfxfa_app.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/formfiller/cffl_textfield.cpp
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index d24452fd45772f9b7baf015590775304636656f6..76f4b7414d136c2315190b5ddb21faa3af252258 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -11,14 +11,11 @@
#include "fpdfsdk/include/fsdk_mgr.h"
CFFL_TextField::CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot)
- : CFFL_FormFiller(pApp, pAnnot), m_pFontMap(nullptr) {
- m_State.nStart = m_State.nEnd = 0;
-}
+ : CFFL_FormFiller(pApp, pAnnot) {}
CFFL_TextField::~CFFL_TextField() {
for (const auto& it : m_Maps)
it.second->InvalidateFocusHandler(this);
- delete m_pFontMap;
}
PWL_CREATEPARAM CFFL_TextField::GetCreateParam() {
@@ -68,8 +65,8 @@ PWL_CREATEPARAM CFFL_TextField::GetCreateParam() {
}
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();
cp.pFocusHandler = this;
return cp;
« no previous file with comments | « fpdfsdk/formfiller/cffl_textfield.h ('k') | fpdfsdk/fpdfxfa/fpdfxfa_app.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698