diff options
author | weili <weili@chromium.org> | 2016-08-03 11:06:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-03 11:06:49 -0700 |
commit | 2d5b020304e8a9aa8afeb632c61daa7ece87e36d (patch) | |
tree | 4d7f04d4800577fa597b4ca1f1b4d31b87194ef0 /fpdfsdk/pdfwindow/PWL_FontMap.h | |
parent | ca27127240fbca2184f1c576b15b5212d5b314e6 (diff) | |
download | pdfium-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/pdfwindow/PWL_FontMap.h')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_FontMap.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.h b/fpdfsdk/pdfwindow/PWL_FontMap.h index 2c40c92a97..7f347f5eb5 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.h +++ b/fpdfsdk/pdfwindow/PWL_FontMap.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ #define FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ +#include <memory> + #include "core/fpdfdoc/include/ipvt_fontmap.h" #include "fpdfsdk/fxedit/include/fx_edit.h" #include "public/fpdf_sysfontinfo.h" @@ -80,6 +82,8 @@ class CPWL_FontMap : public IPVT_FontMap { CFX_ByteString& sFontName, uint8_t nCharset); + static const FPDF_CharsetFontMap defaultTTFMap[]; + protected: virtual void Initialize(); virtual CPDF_Document* GetDocument(); @@ -102,6 +106,9 @@ class CPWL_FontMap : public IPVT_FontMap { int32_t nCharset); CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName); + CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; + CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; + private: CFX_ByteString GetFontName(int32_t nFontIndex); int32_t FindFont(const CFX_ByteString& sFontName, @@ -109,16 +116,7 @@ class CPWL_FontMap : public IPVT_FontMap { CFX_ByteString GetNativeFont(int32_t nCharset); - public: - using CharsetFontMap = FPDF_CharsetFontMap; - static const CharsetFontMap defaultTTFMap[]; - - protected: - CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; - CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; - - private: - CPDF_Document* m_pPDFDoc; + std::unique_ptr<CPDF_Document> m_pPDFDoc; CFX_SystemHandler* m_pSystemHandler; }; |