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/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return; | 152 return; |
153 | 153 |
154 CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictBy("AP"); | 154 CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictBy("AP"); |
155 | 155 |
156 if (!pAPDict) { | 156 if (!pAPDict) { |
157 pAPDict = new CPDF_Dictionary; | 157 pAPDict = new CPDF_Dictionary; |
158 m_pAnnotDict->SetAt("AP", pAPDict); | 158 m_pAnnotDict->SetAt("AP", pAPDict); |
159 } | 159 } |
160 | 160 |
161 // to avoid checkbox and radiobutton | 161 // to avoid checkbox and radiobutton |
162 CPDF_Object* pObject = pAPDict->GetElement(m_sAPType); | 162 CPDF_Object* pObject = pAPDict->GetObjectBy(m_sAPType); |
163 if (ToDictionary(pObject)) | 163 if (ToDictionary(pObject)) |
164 return; | 164 return; |
165 | 165 |
166 CPDF_Stream* pStream = pAPDict->GetStreamBy(m_sAPType); | 166 CPDF_Stream* pStream = pAPDict->GetStreamBy(m_sAPType); |
167 if (!pStream) { | 167 if (!pStream) { |
168 pStream = new CPDF_Stream(NULL, 0, NULL); | 168 pStream = new CPDF_Stream(NULL, 0, NULL); |
169 int32_t objnum = m_pDocument->AddIndirectObject(pStream); | 169 int32_t objnum = m_pDocument->AddIndirectObject(pStream); |
170 pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum); | 170 pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum); |
171 } | 171 } |
172 | 172 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; | 253 return pFontDict ? m_pDocument->LoadFont(pFontDict) : nullptr; |
254 } | 254 } |
255 | 255 |
256 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { | 256 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) { |
257 m_sAPType = sAPType; | 257 m_sAPType = sAPType; |
258 | 258 |
259 Reset(); | 259 Reset(); |
260 Initialize(); | 260 Initialize(); |
261 } | 261 } |
OLD | NEW |