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

Unified Diff: core/fpdfapi/fpdf_font/cpdf_font.cpp

Issue 2119013002: Change class member variables in raw pointer type into unique_ptr (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 5 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 | « no previous file | core/fpdfapi/fpdf_font/font_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/cpdf_font.cpp
diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp
index 061b477f17cfa3290dcd2902d93937d7f70d8a53..07a79ed60747ab84bee78793d5999bf156b8d412 100644
--- a/core/fpdfapi/fpdf_font/cpdf_font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp
@@ -6,8 +6,6 @@
#include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
-#include <memory>
-
#include "core/fpdfapi/fpdf_font/cpdf_truetypefont.h"
#include "core/fpdfapi/fpdf_font/cpdf_type1font.h"
#include "core/fpdfapi/fpdf_font/cpdf_type3font.h"
@@ -50,7 +48,6 @@ FX_BOOL GetPredefinedEncoding(int& basemap, const CFX_ByteString& value) {
CPDF_Font::CPDF_Font()
: m_pFontFile(nullptr),
m_pFontDict(nullptr),
- m_pToUnicodeMap(nullptr),
m_bToUnicodeLoaded(FALSE),
m_Flags(0),
m_StemV(0),
@@ -59,9 +56,6 @@ CPDF_Font::CPDF_Font()
m_ItalicAngle(0) {}
CPDF_Font::~CPDF_Font() {
- delete m_pToUnicodeMap;
- m_pToUnicodeMap = nullptr;
-
if (m_pFontFile) {
m_pDocument->GetPageData()->ReleaseFontFileStreamAcc(
const_cast<CPDF_Stream*>(m_pFontFile->GetStream()->AsStream()));
@@ -285,7 +279,7 @@ void CPDF_Font::LoadUnicodeMap() const {
if (!pStream) {
return;
}
- m_pToUnicodeMap = new CPDF_ToUnicodeMap;
+ m_pToUnicodeMap.reset(new CPDF_ToUnicodeMap);
m_pToUnicodeMap->Load(pStream);
}
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_font/font_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698