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 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict); | 8 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict); |
9 void SaveCheckedFieldStatus(CPDF_FormField* pField, C FX_ByteArray& statusArray); | 9 void SaveCheckedFieldStatus(CPDF_FormField* pField, C FX_ByteArray& statusArray); |
10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField) | 10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField) |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1070 } | 1070 } |
1071 if (GetType() == ComboBox) { | 1071 if (GetType() == ComboBox) { |
1072 m_pForm->m_pFormNotify->AfterValueChange(this); | 1072 m_pForm->m_pFormNotify->AfterValueChange(this); |
1073 } | 1073 } |
1074 } | 1074 } |
1075 m_pForm->m_bUpdated = TRUE; | 1075 m_pForm->m_bUpdated = TRUE; |
1076 return TRUE; | 1076 return TRUE; |
1077 } | 1077 } |
1078 void CPDF_FormField::LoadDA() | 1078 void CPDF_FormField::LoadDA() |
1079 { | 1079 { |
1080 CFX_ByteString DA = FPDF_GetFieldAttr(m_pDict, "DA") ? FPDF_GetFieldAttr(m_p Dict, "DA")->GetString() : CFX_ByteString(); | 1080 if (!m_pForm->m_pFormDict) { |
1081 if (DA.IsEmpty()) { | 1081 return; |
1082 DA = m_pForm->m_pFormDict ? m_pForm->m_pFormDict->GetString("DA") : CFX_ ByteString(); | 1082 } |
1083 CFX_ByteString DA; | |
1084 CPDF_Object* pObj_t = FPDF_GetFieldAttr(m_pDict, "DA"); | |
1085 if (pObj_t) { | |
Nico
2014/07/21 05:07:53
You can write
if (CPDF_Object* pObj_t = FPDF_Ge
| |
1086 DA = pObj_t->GetString(); | |
1083 } | 1087 } |
Nico
2014/07/21 05:07:53
This is different from the previous code as far as
Bo Xu
2014/07/21 16:40:44
Done.
| |
1084 if (DA.IsEmpty()) { | 1088 if (DA.IsEmpty()) { |
1085 return; | 1089 return; |
1086 } | 1090 } |
1087 CPDF_SimpleParser syntax(DA); | 1091 CPDF_SimpleParser syntax(DA); |
1088 syntax.FindTagParam("Tf", 2); | 1092 syntax.FindTagParam("Tf", 2); |
1089 CFX_ByteString font_name = syntax.GetWord(); | 1093 CFX_ByteString font_name = syntax.GetWord(); |
1090 CPDF_Dictionary* pFontDict = NULL; | 1094 CPDF_Dictionary* pFontDict = NULL; |
1091 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDict("DR") && | 1095 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDict("DR") && |
1092 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font") ) | 1096 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font") ) |
1093 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(fo nt_name); | 1097 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(fo nt_name); |
1094 | 1098 |
1095 if (pFontDict == NULL) { | 1099 if (pFontDict == NULL) { |
1096 return; | 1100 return; |
1097 } | 1101 } |
1098 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); | 1102 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); |
1099 m_FontSize = FX_atof(syntax.GetWord()); | 1103 m_FontSize = FX_atof(syntax.GetWord()); |
1100 } | 1104 } |
OLD | NEW |