| 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 "font_int.h" | 7 #include "font_int.h" |
| 8 | 8 |
| 9 #include "core/src/fpdfapi/fpdf_page/pageint.h" | 9 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
| 10 #include "core/include/fpdfapi/fpdf_module.h" | 10 #include "core/include/fpdfapi/fpdf_module.h" |
| (...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 const FX_CHAR* name = | 1693 const FX_CHAR* name = |
| 1694 GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode); | 1694 GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode); |
| 1695 if (!name) | 1695 if (!name) |
| 1696 return nullptr; | 1696 return nullptr; |
| 1697 | 1697 |
| 1698 CPDF_Stream* pStream = | 1698 CPDF_Stream* pStream = |
| 1699 ToStream(m_pCharProcs ? m_pCharProcs->GetElementValue(name) : nullptr); | 1699 ToStream(m_pCharProcs ? m_pCharProcs->GetElementValue(name) : nullptr); |
| 1700 if (!pStream) | 1700 if (!pStream) |
| 1701 return nullptr; | 1701 return nullptr; |
| 1702 | 1702 |
| 1703 nonstd::unique_ptr<CPDF_Type3Char> pNewChar(new CPDF_Type3Char(new CPDF_Form( | 1703 std::unique_ptr<CPDF_Type3Char> pNewChar(new CPDF_Type3Char(new CPDF_Form( |
| 1704 m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, | 1704 m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, |
| 1705 pStream, nullptr))); | 1705 pStream, nullptr))); |
| 1706 | 1706 |
| 1707 // This can trigger recursion into this method. The content of |m_CacheMap| | 1707 // This can trigger recursion into this method. The content of |m_CacheMap| |
| 1708 // can change as a result. Thus after it returns, check the cache again for | 1708 // can change as a result. Thus after it returns, check the cache again for |
| 1709 // a cache hit. | 1709 // a cache hit. |
| 1710 pNewChar->m_pForm->ParseContent(nullptr, nullptr, pNewChar.get(), nullptr, | 1710 pNewChar->m_pForm->ParseContent(nullptr, nullptr, pNewChar.get(), nullptr, |
| 1711 level + 1); | 1711 level + 1); |
| 1712 it = m_CacheMap.find(charcode); | 1712 it = m_CacheMap.find(charcode); |
| 1713 if (it != m_CacheMap.end()) | 1713 if (it != m_CacheMap.end()) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 rect = pChar->m_BBox; | 1761 rect = pChar->m_BBox; |
| 1762 } | 1762 } |
| 1763 | 1763 |
| 1764 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) | 1764 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) |
| 1765 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} | 1765 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} |
| 1766 | 1766 |
| 1767 CPDF_Type3Char::~CPDF_Type3Char() { | 1767 CPDF_Type3Char::~CPDF_Type3Char() { |
| 1768 delete m_pForm; | 1768 delete m_pForm; |
| 1769 delete m_pBitmap; | 1769 delete m_pBitmap; |
| 1770 } | 1770 } |
| OLD | NEW |