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