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

Unified Diff: core/fpdfapi/font/cpdf_cidfont.cpp

Issue 2641853004: use unique_ptr in fpdf_font_cid.cpp (Closed)
Patch Set: iwyu, maybe owned Created 3 years, 11 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
Index: core/fpdfapi/font/cpdf_cidfont.cpp
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index c6c6992562a356e5cfcd8a16807e59ee41fc2eef..e96f824bd5ed7cb1c93d62682ca5211387ef6292 100644
--- a/core/fpdfapi/font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/font/cpdf_cidfont.cpp
@@ -200,8 +200,7 @@ bool IsMetricForCID(const uint32_t* pEntry, uint16_t CID) {
} // namespace
CPDF_CIDFont::CPDF_CIDFont()
- : m_pCMap(nullptr),
- m_pCID2UnicodeMap(nullptr),
+ : m_pCID2UnicodeMap(nullptr),
m_bCIDIsGID(false),
m_bAnsiWidthsFixed(false),
m_bAdobeCourierStd(false) {
@@ -360,8 +359,7 @@ bool CPDF_CIDFont::Load() {
if (!m_pCMap)
return false;
} else if (CPDF_Stream* pStream = pEncoding->AsStream()) {
- m_pCMap = new CPDF_CMap;
- m_pAllocatedCMap.reset(m_pCMap);
+ m_pCMap = pdfium::MakeUnique<CPDF_CMap>();
CPDF_StreamAcc acc;
acc.LoadAllData(pStream, false);
m_pCMap->LoadEmbedded(acc.GetData(), acc.GetSize());

Powered by Google App Engine
This is Rietveld 408576698