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 CFX_ByteString DA; |
1081 if (DA.IsEmpty()) { | 1081 if (CPDF_Object* pObj_t = FPDF_GetFieldAttr(m_pDict, "DA")){ |
Nico
2014/07/21 16:48:12
nit: add the same space here
Bo Xu
2014/07/21 17:01:29
Done.
| |
1082 DA = m_pForm->m_pFormDict ? m_pForm->m_pFormDict->GetString("DA") : CFX_ ByteString(); | 1082 DA = pObj_t->GetString(); |
1083 } | |
1084 if (DA.IsEmpty() && m_pForm->m_pFormDict) { | |
1085 DA = m_pForm->m_pFormDict->GetString("DA");; | |
Nico
2014/07/21 16:48:12
nit: there's one ; too many here
Bo Xu
2014/07/21 17:01:30
Done.
| |
1083 } | 1086 } |
1084 if (DA.IsEmpty()) { | 1087 if (DA.IsEmpty()) { |
1085 return; | 1088 return; |
1086 } | 1089 } |
1087 CPDF_SimpleParser syntax(DA); | 1090 CPDF_SimpleParser syntax(DA); |
1088 syntax.FindTagParam("Tf", 2); | 1091 syntax.FindTagParam("Tf", 2); |
1089 CFX_ByteString font_name = syntax.GetWord(); | 1092 CFX_ByteString font_name = syntax.GetWord(); |
1090 CPDF_Dictionary* pFontDict = NULL; | 1093 CPDF_Dictionary* pFontDict = NULL; |
1091 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDict("DR") && | 1094 if (m_pForm->m_pFormDict && m_pForm->m_pFormDict->GetDict("DR") && |
1092 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font") ) | 1095 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font") ) |
1093 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(fo nt_name); | 1096 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(fo nt_name); |
1094 | 1097 |
1095 if (pFontDict == NULL) { | 1098 if (pFontDict == NULL) { |
1096 return; | 1099 return; |
1097 } | 1100 } |
1098 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); | 1101 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); |
1099 m_FontSize = FX_atof(syntax.GetWord()); | 1102 m_FontSize = FX_atof(syntax.GetWord()); |
1100 } | 1103 } |
OLD | NEW |