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/font/font_int.h" | 7 #include "core/fpdfapi/font/font_int.h" |
8 | 8 |
9 #include "core/fpdfapi/cpdf_modulemgr.h" | 9 #include "core/fpdfapi/cpdf_modulemgr.h" |
10 #include "core/fpdfapi/page/cpdf_form.h" | 10 #include "core/fpdfapi/page/cpdf_form.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 return true; | 40 return true; |
41 } | 41 } |
42 } | 42 } |
43 return false; | 43 return false; |
44 } | 44 } |
45 | 45 |
46 CFX_StockFontArray::CFX_StockFontArray() {} | 46 CFX_StockFontArray::CFX_StockFontArray() {} |
47 | 47 |
48 CFX_StockFontArray::~CFX_StockFontArray() { | 48 CFX_StockFontArray::~CFX_StockFontArray() { |
49 for (size_t i = 0; i < FX_ArraySize(m_StockFonts); ++i) { | 49 for (size_t i = 0; i < FX_ArraySize(m_StockFonts); ++i) { |
50 if (!m_StockFonts[i]) | 50 if (m_StockFonts[i]) |
51 continue; | 51 delete m_StockFonts[i]->GetFontDict(); |
52 CPDF_Dictionary* pFontDict = m_StockFonts[i]->GetFontDict(); | |
53 if (pFontDict) | |
54 pFontDict->Release(); | |
55 } | 52 } |
56 } | 53 } |
57 | 54 |
58 CPDF_Font* CFX_StockFontArray::GetFont(uint32_t index) const { | 55 CPDF_Font* CFX_StockFontArray::GetFont(uint32_t index) const { |
59 if (index >= FX_ArraySize(m_StockFonts)) | 56 if (index >= FX_ArraySize(m_StockFonts)) |
60 return nullptr; | 57 return nullptr; |
61 return m_StockFonts[index].get(); | 58 return m_StockFonts[index].get(); |
62 } | 59 } |
63 | 60 |
64 CPDF_Font* CFX_StockFontArray::SetFont(uint32_t index, | 61 CPDF_Font* CFX_StockFontArray::SetFont(uint32_t index, |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 302 } |
306 if (cid_set) { | 303 if (cid_set) { |
307 m_pBaseMap = CPDF_ModuleMgr::Get() | 304 m_pBaseMap = CPDF_ModuleMgr::Get() |
308 ->GetPageModule() | 305 ->GetPageModule() |
309 ->GetFontGlobals() | 306 ->GetFontGlobals() |
310 ->m_CMapManager.GetCID2UnicodeMap(cid_set, false); | 307 ->m_CMapManager.GetCID2UnicodeMap(cid_set, false); |
311 } else { | 308 } else { |
312 m_pBaseMap = nullptr; | 309 m_pBaseMap = nullptr; |
313 } | 310 } |
314 } | 311 } |
OLD | NEW |