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/formfiller/cba_fontmap.h" | 7 #include "fpdfsdk/formfiller/cba_fontmap.h" |
8 | 8 |
9 #include "core/fpdfapi/font/cpdf_font.h" | 9 #include "core/fpdfapi/font/cpdf_font.h" |
10 #include "core/fpdfapi/page/cpdf_page.h" | 10 #include "core/fpdfapi/page/cpdf_page.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return nullptr; | 112 return nullptr; |
113 | 113 |
114 CPDF_Dictionary* pFonts = pResDict->GetDictFor("Font"); | 114 CPDF_Dictionary* pFonts = pResDict->GetDictFor("Font"); |
115 if (!pFonts) | 115 if (!pFonts) |
116 return nullptr; | 116 return nullptr; |
117 | 117 |
118 CPDF_Document* pDocument = GetDocument(); | 118 CPDF_Document* pDocument = GetDocument(); |
119 CPDF_Font* pFind = nullptr; | 119 CPDF_Font* pFind = nullptr; |
120 for (const auto& it : *pFonts) { | 120 for (const auto& it : *pFonts) { |
121 const CFX_ByteString& csKey = it.first; | 121 const CFX_ByteString& csKey = it.first; |
122 CPDF_Object* pObj = it.second.get(); | 122 CPDF_Object* pObj = it.second; |
123 if (!pObj) | 123 if (!pObj) |
124 continue; | 124 continue; |
125 | 125 |
126 CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect()); | 126 CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect()); |
127 if (!pElement) | 127 if (!pElement) |
128 continue; | 128 continue; |
129 if (pElement->GetStringFor("Type") != "Font") | 129 if (pElement->GetStringFor("Type") != "Font") |
130 continue; | 130 continue; |
131 | 131 |
132 CPDF_Font* pFont = pDocument->LoadFont(pElement); | 132 CPDF_Font* pFont = pDocument->LoadFont(pElement); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; | 246 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; |
247 } | 247 } |
248 | 248 |
249 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { | 249 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { |
250 m_sAPType = sAPType; | 250 m_sAPType = sAPType; |
251 | 251 |
252 Reset(); | 252 Reset(); |
253 Initialize(); | 253 Initialize(); |
254 } | 254 } |
OLD | NEW |