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

Unified Diff: fpdfsdk/pdfwindow/PWL_FontMap.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/pdfwindow/PWL_FontMap.h ('k') | fpdfsdk/pdfwindow/PWL_Wnd.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/pdfwindow/PWL_FontMap.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index 9192afd5e8e0549453e8991056faede4f39a013a..96acb78ec2aa0538730af46e8dfd5d3701152b7e 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -35,14 +35,11 @@ const char* const g_sDEStandardFontName[] = {"Courier",
} // namespace
CPWL_FontMap::CPWL_FontMap(CFX_SystemHandler* pSystemHandler)
- : m_pPDFDoc(nullptr), m_pSystemHandler(pSystemHandler) {
+ : m_pSystemHandler(pSystemHandler) {
ASSERT(m_pSystemHandler);
}
CPWL_FontMap::~CPWL_FontMap() {
- delete m_pPDFDoc;
- m_pPDFDoc = nullptr;
-
Empty();
}
@@ -53,12 +50,12 @@ void CPWL_FontMap::SetSystemHandler(CFX_SystemHandler* pSystemHandler) {
CPDF_Document* CPWL_FontMap::GetDocument() {
if (!m_pPDFDoc) {
if (CPDF_ModuleMgr::Get()) {
- m_pPDFDoc = new CPDF_Document(nullptr);
+ m_pPDFDoc.reset(new CPDF_Document(nullptr));
m_pPDFDoc->CreateNewDoc();
}
}
- return m_pPDFDoc;
+ return m_pPDFDoc.get();
}
CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) {
@@ -413,7 +410,7 @@ int32_t CPWL_FontMap::GetNativeCharset() {
return nCharset;
}
-const CPWL_FontMap::CharsetFontMap CPWL_FontMap::defaultTTFMap[] = {
+const FPDF_CharsetFontMap CPWL_FontMap::defaultTTFMap[] = {
{ANSI_CHARSET, "Helvetica"}, {GB2312_CHARSET, "SimSun"},
{CHINESEBIG5_CHARSET, "MingLiU"}, {SHIFTJIS_CHARSET, "MS Gothic"},
{HANGUL_CHARSET, "Batang"}, {RUSSIAN_CHARSET, "Arial"},
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_FontMap.h ('k') | fpdfsdk/pdfwindow/PWL_Wnd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698