Chromium Code Reviews| Index: core/src/fpdfdoc/doc_formcontrol.cpp |
| diff --git a/core/src/fpdfdoc/doc_formcontrol.cpp b/core/src/fpdfdoc/doc_formcontrol.cpp |
| index 169e9d73b71276afff9f2d3000c8446ce4826e59..d77c47770327236b6cd867faf8f69b5a7b15591a 100644 |
| --- a/core/src/fpdfdoc/doc_formcontrol.cpp |
| +++ b/core/src/fpdfdoc/doc_formcontrol.cpp |
| @@ -246,27 +246,30 @@ CPDF_Action CPDF_FormControl::GetAction() { |
| } |
| return CPDF_Action(pObj->GetDict()); |
| } |
| + |
| CPDF_AAction CPDF_FormControl::GetAdditionalAction() { |
| - if (!m_pWidgetDict) { |
| - return nullptr; |
| + CPDF_Dictionary* dict = nullptr; |
| + if (m_pWidgetDict) { |
|
Tom Sepez
2016/03/01 17:53:35
Same thing here with no-arg ctor.
Wei Li
2016/03/01 21:46:53
Done.
|
| + if (m_pWidgetDict->KeyExist("AA")) |
| + dict = m_pWidgetDict->GetDictBy("AA"); |
| + else |
| + dict = m_pField->GetAdditionalAction(); |
| } |
| - if (m_pWidgetDict->KeyExist("AA")) { |
| - return m_pWidgetDict->GetDictBy("AA"); |
| - } |
| - return m_pField->GetAdditionalAction(); |
| + return CPDF_AAction(dict); |
| } |
| + |
| CPDF_DefaultAppearance CPDF_FormControl::GetDefaultAppearance() { |
| - if (!m_pWidgetDict) { |
| - return CFX_ByteString(); |
| - } |
| - if (m_pWidgetDict->KeyExist("DA")) { |
| - return m_pWidgetDict->GetStringBy("DA"); |
| - } |
| - CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "DA"); |
| - if (!pObj) { |
| - return m_pField->m_pForm->GetDefaultAppearance(); |
| + CFX_ByteString str; |
| + if (m_pWidgetDict) { |
| + if (m_pWidgetDict->KeyExist("DA")) { |
| + str = m_pWidgetDict->GetStringBy("DA"); |
| + } else { |
| + CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "DA"); |
| + str = |
| + pObj ? pObj->GetString() : m_pField->m_pForm->GetDefaultAppearance(); |
| + } |
| } |
| - return pObj->GetString(); |
| + return CPDF_DefaultAppearance(str); |
| } |
| CPDF_Font* CPDF_FormControl::GetDefaultControlFont() { |
| @@ -421,7 +424,7 @@ CPDF_Stream* CPDF_ApSettings::GetIcon(const CFX_ByteStringC& csEntry) const { |
| } |
| CPDF_IconFit CPDF_ApSettings::GetIconFit() const { |
| - return m_pDict ? m_pDict->GetDictBy("IF") : nullptr; |
| + return CPDF_IconFit(m_pDict ? m_pDict->GetDictBy("IF") : nullptr); |
| } |
| int CPDF_ApSettings::GetTextPosition() const { |