| 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/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
| 8 #include "doc_utils.h" | 8 #include "doc_utils.h" |
| 9 | 9 |
| 10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField) | 10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField) |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 m_pForm->m_bUpdated = TRUE; | 1077 m_pForm->m_bUpdated = TRUE; |
| 1078 return TRUE; | 1078 return TRUE; |
| 1079 } | 1079 } |
| 1080 void CPDF_FormField::LoadDA() | 1080 void CPDF_FormField::LoadDA() |
| 1081 { | 1081 { |
| 1082 CFX_ByteString DA; | 1082 CFX_ByteString DA; |
| 1083 if (CPDF_Object* pObj_t = FPDF_GetFieldAttr(m_pDict, "DA")) { | 1083 if (CPDF_Object* pObj_t = FPDF_GetFieldAttr(m_pDict, "DA")) { |
| 1084 DA = pObj_t->GetString(); | 1084 DA = pObj_t->GetString(); |
| 1085 } | 1085 } |
| 1086 if (DA.IsEmpty() && m_pForm->m_pFormDict) { | 1086 if (DA.IsEmpty() && m_pForm->m_pFormDict) { |
| 1087 DA = m_pForm->m_pFormDict->GetString("DA"); | 1087 DA = m_pForm->m_pFormDict->GetStringAt("DA"); |
| 1088 } | 1088 } |
| 1089 if (DA.IsEmpty()) { | 1089 if (DA.IsEmpty()) { |
| 1090 return; | 1090 return; |
| 1091 } | 1091 } |
| 1092 CPDF_SimpleParser syntax(DA); | 1092 CPDF_SimpleParser syntax(DA); |
| 1093 syntax.FindTagParam("Tf", 2); | 1093 syntax.FindTagParam("Tf", 2); |
| 1094 CFX_ByteString font_name = syntax.GetWord(); | 1094 CFX_ByteString font_name = syntax.GetWord(); |
| 1095 CPDF_Dictionary* pFontDict = NULL; | 1095 CPDF_Dictionary* pFontDict = NULL; |
| 1096 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDict("DR") && | 1096 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDict("DR") && |
| 1097 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font") ) | 1097 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font") ) |
| 1098 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(fo
nt_name); | 1098 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(fo
nt_name); |
| 1099 | 1099 |
| 1100 if (pFontDict == NULL) { | 1100 if (pFontDict == NULL) { |
| 1101 return; | 1101 return; |
| 1102 } | 1102 } |
| 1103 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); | 1103 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); |
| 1104 m_FontSize = FX_atof(syntax.GetWord()); | 1104 m_FontSize = FX_atof(syntax.GetWord()); |
| 1105 } | 1105 } |
| OLD | NEW |