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

Unified Diff: xfa/fwl/theme/cfwl_widgettp.cpp

Issue 2227883002: Use smart pointers for class owned pointers in xfa/fxfa (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 | « xfa/fwl/theme/cfwl_widgettp.h ('k') | xfa/fxfa/app/xfa_ffapp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/theme/cfwl_widgettp.cpp
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 99602577306009e7c8380edbdf40063a913fa697..b5658cf7b29a9eef1a009bbbf042d7aef92e8e3d 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -697,31 +697,9 @@ CFWL_ArrowData::CFWL_ArrowData() : m_pColorData(nullptr) {
SetColorData(0);
}
-CFWL_FontData::CFWL_FontData()
- : m_dwStyles(0),
- m_dwCodePage(0),
- m_pFont(0),
- m_pFontMgr(nullptr)
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
- ,
- m_pFontSource(nullptr)
-#endif
-{
-}
+CFWL_FontData::CFWL_FontData() : m_dwStyles(0), m_dwCodePage(0) {}
-CFWL_FontData::~CFWL_FontData() {
- if (m_pFont) {
- m_pFont->Release();
- }
- if (m_pFontMgr) {
- m_pFontMgr->Release();
- }
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
- if (m_pFontSource) {
- m_pFontSource->Release();
- }
-#endif
-}
+CFWL_FontData::~CFWL_FontData() {}
FX_BOOL CFWL_FontData::Equal(const CFX_WideStringC& wsFontFamily,
uint32_t dwFontStyles,
@@ -740,12 +718,12 @@ FX_BOOL CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily,
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
m_pFontMgr = IFGAS_FontMgr::Create(FX_GetDefFontEnumerator());
#else
- m_pFontSource = new CFX_FontSourceEnum_File;
- m_pFontMgr = IFGAS_FontMgr::Create(m_pFontSource);
+ m_pFontSource.reset(new CFX_FontSourceEnum_File);
+ m_pFontMgr = IFGAS_FontMgr::Create(m_pFontSource.get());
#endif
}
- m_pFont = CFGAS_GEFont::LoadFont(wsFontFamily.c_str(), dwFontStyles,
- dwCodePage, m_pFontMgr);
+ m_pFont.reset(CFGAS_GEFont::LoadFont(wsFontFamily.c_str(), dwFontStyles,
+ dwCodePage, m_pFontMgr.get()));
return !!m_pFont;
}
« no previous file with comments | « xfa/fwl/theme/cfwl_widgettp.h ('k') | xfa/fxfa/app/xfa_ffapp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698