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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 177 } |
178 | 178 |
179 if (pStreamDict) { | 179 if (pStreamDict) { |
180 CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources"); | 180 CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources"); |
181 if (!pStreamResList) { | 181 if (!pStreamResList) { |
182 pStreamResList = new CPDF_Dictionary(m_pDocument->GetByteStringPool()); | 182 pStreamResList = new CPDF_Dictionary(m_pDocument->GetByteStringPool()); |
183 pStreamDict->SetFor("Resources", pStreamResList); | 183 pStreamDict->SetFor("Resources", pStreamResList); |
184 } | 184 } |
185 CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDictFor("Font"); | 185 CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDictFor("Font"); |
186 if (!pStreamResFontList) { | 186 if (!pStreamResFontList) { |
187 pStreamResFontList = m_pDocument->NewIndirect<CPDF_Dictionary>( | 187 pStreamResFontList = m_pDocument->NewIndirect<CPDF_Dictionary>(); |
188 m_pDocument->GetByteStringPool()); | |
189 pStreamResList->SetReferenceFor("Font", m_pDocument, pStreamResFontList); | 188 pStreamResList->SetReferenceFor("Font", m_pDocument, pStreamResFontList); |
190 } | 189 } |
191 if (!pStreamResFontList->KeyExist(sAlias)) { | 190 if (!pStreamResFontList->KeyExist(sAlias)) { |
192 pStreamResFontList->SetReferenceFor(sAlias, m_pDocument, | 191 pStreamResFontList->SetReferenceFor(sAlias, m_pDocument, |
193 pFont->GetFontDict()->GetObjNum()); | 192 pFont->GetFontDict()->GetObjNum()); |
194 } | 193 } |
195 } | 194 } |
196 } | 195 } |
197 | 196 |
198 CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) { | 197 CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 241 |
243 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; | 242 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; |
244 } | 243 } |
245 | 244 |
246 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { | 245 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { |
247 m_sAPType = sAPType; | 246 m_sAPType = sAPType; |
248 | 247 |
249 Reset(); | 248 Reset(); |
250 Initialize(); | 249 Initialize(); |
251 } | 250 } |
OLD | NEW |