summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_textfield.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-03 11:06:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-03 11:06:49 -0700
commit2d5b020304e8a9aa8afeb632c61daa7ece87e36d (patch)
tree4d7f04d4800577fa597b4ca1f1b4d31b87194ef0 /fpdfsdk/formfiller/cffl_textfield.h
parentca27127240fbca2184f1c576b15b5212d5b314e6 (diff)
downloadpdfium-2d5b020304e8a9aa8afeb632c61daa7ece87e36d.tar.xz
Use smart pointers for class owned pointers
For all classes under /fpdfsdk, use smart pointer to replace raw pointer type for class owned member variables so that memory management will be easier. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2173253002
Diffstat (limited to 'fpdfsdk/formfiller/cffl_textfield.h')
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/formfiller/cffl_textfield.h b/fpdfsdk/formfiller/cffl_textfield.h
index 34968e8fc3..5f9fc5d3bc 100644
--- a/fpdfsdk/formfiller/cffl_textfield.h
+++ b/fpdfsdk/formfiller/cffl_textfield.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_
#define FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_
+#include <memory>
+
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#define BF_ALIGN_LEFT 0
@@ -16,6 +18,8 @@
class CBA_FontMap;
struct FFL_TextFieldState {
+ FFL_TextFieldState() : nStart(0), nEnd(0) {}
+
int nStart;
int nEnd;
CFX_WideString sValue;
@@ -56,7 +60,7 @@ class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler {
#endif // PDF_ENABLE_XFA
private:
- CBA_FontMap* m_pFontMap;
+ std::unique_ptr<CBA_FontMap> m_pFontMap;
FFL_TextFieldState m_State;
};