| 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 "fpdfsdk/pdfwindow/PWL_FontMap.h" | 7 #include "fpdfsdk/pdfwindow/PWL_FontMap.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| 10 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" | 10 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 Empty(); | 46 Empty(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void CPWL_FontMap::SetSystemHandler(IFX_SystemHandler* pSystemHandler) { | 49 void CPWL_FontMap::SetSystemHandler(IFX_SystemHandler* pSystemHandler) { |
| 50 m_pSystemHandler = pSystemHandler; | 50 m_pSystemHandler = pSystemHandler; |
| 51 } | 51 } |
| 52 | 52 |
| 53 CPDF_Document* CPWL_FontMap::GetDocument() { | 53 CPDF_Document* CPWL_FontMap::GetDocument() { |
| 54 if (!m_pPDFDoc) { | 54 if (!m_pPDFDoc) { |
| 55 if (CPDF_ModuleMgr::Get()) { | 55 if (CPDF_ModuleMgr::Get()) { |
| 56 m_pPDFDoc = new CPDF_Document; | 56 m_pPDFDoc = new CPDF_Document(nullptr); |
| 57 m_pPDFDoc->CreateNewDoc(); | 57 m_pPDFDoc->CreateNewDoc(); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 return m_pPDFDoc; | 61 return m_pPDFDoc; |
| 62 } | 62 } |
| 63 | 63 |
| 64 CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) { | 64 CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) { |
| 65 if (nFontIndex >= 0 && nFontIndex < m_aData.GetSize()) { | 65 if (nFontIndex >= 0 && nFontIndex < m_aData.GetSize()) { |
| 66 if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex)) { | 66 if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex)) { |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 493 |
| 494 CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, | 494 CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, |
| 495 CPDF_Document* pAttachedDoc) | 495 CPDF_Document* pAttachedDoc) |
| 496 : CPWL_FontMap(pSystemHandler), m_pAttachedDoc(pAttachedDoc) {} | 496 : CPWL_FontMap(pSystemHandler), m_pAttachedDoc(pAttachedDoc) {} |
| 497 | 497 |
| 498 CPWL_DocFontMap::~CPWL_DocFontMap() {} | 498 CPWL_DocFontMap::~CPWL_DocFontMap() {} |
| 499 | 499 |
| 500 CPDF_Document* CPWL_DocFontMap::GetDocument() { | 500 CPDF_Document* CPWL_DocFontMap::GetDocument() { |
| 501 return m_pAttachedDoc; | 501 return m_pAttachedDoc; |
| 502 } | 502 } |
| OLD | NEW |