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

Unified Diff: core/fpdfapi/fpdf_font/fpdf_font_cid.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 | « core/fpdfapi/fpdf_font/font_int.h ('k') | core/fpdfapi/fpdf_font/include/cpdf_font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 289782bfb3f6dda9ebb6a205fb5d927a85de3b13..f6d3bdc711a61b1e189085d2ffd71f830b155ca3 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -512,14 +512,12 @@ CPDF_CMap::CPDF_CMap() {
m_pLeadingBytes = nullptr;
m_pAddMapping = nullptr;
m_pEmbedMap = nullptr;
- m_pUseMap = nullptr;
m_nCodeRanges = 0;
}
CPDF_CMap::~CPDF_CMap() {
FX_Free(m_pMapping);
FX_Free(m_pAddMapping);
FX_Free(m_pLeadingBytes);
- delete m_pUseMap;
}
void CPDF_CMap::Release() {
if (m_PredefinedCMap.IsEmpty()) {
@@ -616,23 +614,14 @@ uint16_t CPDF_CMap::CIDFromCharCode(uint32_t charcode) const {
if (m_pAddMapping) {
void* found = FXSYS_bsearch(&charcode, m_pAddMapping + 4,
*(uint32_t*)m_pAddMapping, 8, CompareCID);
- if (!found) {
- if (m_pUseMap) {
- return m_pUseMap->CIDFromCharCode(charcode);
- }
+ if (!found)
return 0;
- }
return (uint16_t)(((uint32_t*)found)[1] % 65536 + charcode -
*(uint32_t*)found);
}
- if (m_pUseMap)
- return m_pUseMap->CIDFromCharCode(charcode);
return 0;
}
- uint32_t CID = m_pMapping[charcode];
- if (!CID && m_pUseMap)
- return m_pUseMap->CIDFromCharCode(charcode);
- return (uint16_t)CID;
+ return m_pMapping[charcode];
}
uint32_t CPDF_CMap::GetNextChar(const FX_CHAR* pString,
« no previous file with comments | « core/fpdfapi/fpdf_font/font_int.h ('k') | core/fpdfapi/fpdf_font/include/cpdf_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698