OLD | NEW |
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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 m_pLeadingBytes = nullptr; | 511 m_pLeadingBytes = nullptr; |
512 m_pAddMapping = nullptr; | 512 m_pAddMapping = nullptr; |
513 m_pEmbedMap = nullptr; | 513 m_pEmbedMap = 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 } | 520 } |
521 void CPDF_CMap::Release() { | |
522 if (m_PredefinedCMap.IsEmpty()) { | |
523 delete this; | |
524 } | |
525 } | |
526 | 521 |
527 FX_BOOL CPDF_CMap::IsLoaded() const { | 522 FX_BOOL CPDF_CMap::IsLoaded() const { |
528 return m_bLoaded; | 523 return m_bLoaded; |
529 } | 524 } |
530 | 525 |
531 FX_BOOL CPDF_CMap::IsVertWriting() const { | 526 FX_BOOL CPDF_CMap::IsVertWriting() const { |
532 return m_bVertical; | 527 return m_bVertical; |
533 } | 528 } |
534 | 529 |
535 FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, | 530 FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 m_EmbeddedCount = pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count; | 785 m_EmbeddedCount = pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count; |
791 } | 786 } |
792 | 787 |
793 CIDSet CharsetFromOrdering(const CFX_ByteStringC& ordering) { | 788 CIDSet CharsetFromOrdering(const CFX_ByteStringC& ordering) { |
794 for (size_t charset = 1; charset < FX_ArraySize(g_CharsetNames); ++charset) { | 789 for (size_t charset = 1; charset < FX_ArraySize(g_CharsetNames); ++charset) { |
795 if (ordering == g_CharsetNames[charset]) | 790 if (ordering == g_CharsetNames[charset]) |
796 return CIDSetFromSizeT(charset); | 791 return CIDSetFromSizeT(charset); |
797 } | 792 } |
798 return CIDSET_UNKNOWN; | 793 return CIDSET_UNKNOWN; |
799 } | 794 } |
OLD | NEW |