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

Side by Side Diff: core/fpdfapi/fpdf_font/fpdf_font_cid.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix a bad merge Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_font/fpdf_font.cpp ('k') | core/fpdfapi/fpdf_font/ttgsubtable.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_font/font_int.h" 7 #include "core/fpdfapi/fpdf_font/font_int.h"
8 8
9 #include "core/fpdfapi/fpdf_cmaps/cmap_int.h" 9 #include "core/fpdfapi/fpdf_cmaps/cmap_int.h"
10 #include "core/fpdfapi/fpdf_font/ttgsubtable.h" 10 #include "core/fpdfapi/fpdf_font/ttgsubtable.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 FX_BOOL bPromptCJK) { 329 FX_BOOL bPromptCJK) {
330 if (!m_CID2UnicodeMaps[charset]) 330 if (!m_CID2UnicodeMaps[charset])
331 m_CID2UnicodeMaps[charset] = LoadCID2UnicodeMap(charset, bPromptCJK); 331 m_CID2UnicodeMaps[charset] = LoadCID2UnicodeMap(charset, bPromptCJK);
332 return m_CID2UnicodeMaps[charset]; 332 return m_CID2UnicodeMaps[charset];
333 } 333 }
334 CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(CIDSet charset, 334 CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(CIDSet charset,
335 FX_BOOL bPromptCJK) { 335 FX_BOOL bPromptCJK) {
336 CPDF_CID2UnicodeMap* pMap = new CPDF_CID2UnicodeMap(); 336 CPDF_CID2UnicodeMap* pMap = new CPDF_CID2UnicodeMap();
337 if (!pMap->Initialize()) { 337 if (!pMap->Initialize()) {
338 delete pMap; 338 delete pMap;
339 return NULL; 339 return nullptr;
340 } 340 }
341 pMap->Load(this, charset, bPromptCJK); 341 pMap->Load(this, charset, bPromptCJK);
342 return pMap; 342 return pMap;
343 } 343 }
344 CPDF_CMapParser::CPDF_CMapParser() { 344 CPDF_CMapParser::CPDF_CMapParser() {
345 m_pCMap = NULL; 345 m_pCMap = nullptr;
346 m_Status = 0; 346 m_Status = 0;
347 m_CodeSeq = 0; 347 m_CodeSeq = 0;
348 } 348 }
349 FX_BOOL CPDF_CMapParser::Initialize(CPDF_CMap* pCMap) { 349 FX_BOOL CPDF_CMapParser::Initialize(CPDF_CMap* pCMap) {
350 m_pCMap = pCMap; 350 m_pCMap = pCMap;
351 m_Status = 0; 351 m_Status = 0;
352 m_CodeSeq = 0; 352 m_CodeSeq = 0;
353 m_AddMaps.EstimateSize(0, 10240); 353 m_AddMaps.EstimateSize(0, 10240);
354 return TRUE; 354 return TRUE;
355 } 355 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 499 }
500 return true; 500 return true;
501 } 501 }
502 502
503 CPDF_CMap::CPDF_CMap() { 503 CPDF_CMap::CPDF_CMap() {
504 m_Charset = CIDSET_UNKNOWN; 504 m_Charset = CIDSET_UNKNOWN;
505 m_Coding = CIDCODING_UNKNOWN; 505 m_Coding = CIDCODING_UNKNOWN;
506 m_CodingScheme = TwoBytes; 506 m_CodingScheme = TwoBytes;
507 m_bVertical = 0; 507 m_bVertical = 0;
508 m_bLoaded = FALSE; 508 m_bLoaded = FALSE;
509 m_pMapping = NULL; 509 m_pMapping = nullptr;
510 m_pLeadingBytes = NULL; 510 m_pLeadingBytes = nullptr;
511 m_pAddMapping = NULL; 511 m_pAddMapping = nullptr;
512 m_pEmbedMap = NULL; 512 m_pEmbedMap = nullptr;
513 m_pUseMap = NULL; 513 m_pUseMap = nullptr;
514 m_nCodeRanges = 0; 514 m_nCodeRanges = 0;
515 } 515 }
516 CPDF_CMap::~CPDF_CMap() { 516 CPDF_CMap::~CPDF_CMap() {
517 FX_Free(m_pMapping); 517 FX_Free(m_pMapping);
518 FX_Free(m_pAddMapping); 518 FX_Free(m_pAddMapping);
519 FX_Free(m_pLeadingBytes); 519 FX_Free(m_pLeadingBytes);
520 delete m_pUseMap; 520 delete m_pUseMap;
521 } 521 }
522 void CPDF_CMap::Release() { 522 void CPDF_CMap::Release() {
523 if (m_PredefinedCMap.IsEmpty()) { 523 if (m_PredefinedCMap.IsEmpty()) {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount); 788 FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount);
789 } 789 }
790 790
791 CIDSet CharsetFromOrdering(const CFX_ByteStringC& ordering) { 791 CIDSet CharsetFromOrdering(const CFX_ByteStringC& ordering) {
792 for (size_t charset = 1; charset < FX_ArraySize(g_CharsetNames); ++charset) { 792 for (size_t charset = 1; charset < FX_ArraySize(g_CharsetNames); ++charset) {
793 if (ordering == g_CharsetNames[charset]) 793 if (ordering == g_CharsetNames[charset])
794 return CIDSetFromSizeT(charset); 794 return CIDSetFromSizeT(charset);
795 } 795 }
796 return CIDSET_UNKNOWN; 796 return CIDSET_UNKNOWN;
797 } 797 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/fpdf_font.cpp ('k') | core/fpdfapi/fpdf_font/ttgsubtable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698