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 "../../include/formfiller/FormFiller.h" | 7 #include "../../include/formfiller/FormFiller.h" |
8 #include "../../include/formfiller/FFL_CBA_Fontmap.h" | 8 #include "../../include/formfiller/FFL_CBA_Fontmap.h" |
9 | 9 |
10 CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandle
r) : | 10 CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandle
r) : |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget"); | 233 FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget"); |
234 | 234 |
235 if (bWidget) | 235 if (bWidget) |
236 { | 236 { |
237 if (CPDF_Dictionary * pRootDict = m_pDocument->GetRoot()) | 237 if (CPDF_Dictionary * pRootDict = m_pDocument->GetRoot()) |
238 pAcroFormDict = pRootDict->GetDict("AcroForm"); | 238 pAcroFormDict = pRootDict->GetDict("AcroForm"); |
239 } | 239 } |
240 | 240 |
241 CFX_ByteString sDA; | 241 CFX_ByteString sDA; |
242 » | 242 » CPDF_Object* pObj; |
243 » sDA = FPDF_GetFieldAttr(m_pAnnotDict, "DA")->GetString(); | 243 » if ((pObj = FPDF_GetFieldAttr(m_pAnnotDict, "DA"))) |
| 244 » » sDA = pObj->GetString(); |
244 | 245 |
245 if (bWidget) | 246 if (bWidget) |
246 { | 247 { |
247 if (sDA.IsEmpty()) | 248 if (sDA.IsEmpty()) |
248 { | 249 { |
249 » » » sDA = FPDF_GetFieldAttr(pAcroFormDict, "DA")->GetString(
);» | 250 » » » pObj = FPDF_GetFieldAttr(pAcroFormDict, "DA"); |
| 251 » » » sDA = pObj ? pObj->GetString() : CFX_ByteString(); |
250 } | 252 } |
251 } | 253 } |
252 | 254 |
253 CPDF_Dictionary * pFontDict = NULL; | 255 CPDF_Dictionary * pFontDict = NULL; |
254 | 256 |
255 if (!sDA.IsEmpty()) | 257 if (!sDA.IsEmpty()) |
256 { | 258 { |
257 CPDF_SimpleParser syntax(sDA); | 259 CPDF_SimpleParser syntax(sDA); |
258 syntax.FindTagParam("Tf", 2); | 260 syntax.FindTagParam("Tf", 2); |
259 CFX_ByteString sFontName = syntax.GetWord(); | 261 CFX_ByteString sFontName = syntax.GetWord(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 293 } |
292 | 294 |
293 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) | 295 void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType) |
294 { | 296 { |
295 m_sAPType = sAPType; | 297 m_sAPType = sAPType; |
296 | 298 |
297 Reset(); | 299 Reset(); |
298 Initial(); | 300 Initial(); |
299 } | 301 } |
300 | 302 |
OLD | NEW |