Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: core/src/fpdfdoc/doc_formcontrol.cpp

Issue 1751753002: Remove implicit conversions and some cleanup (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfdoc/doc_form.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4cfd4527e28d8959fb35f90533ca4950e4d64b98 100644
--- a/core/src/fpdfdoc/doc_formcontrol.cpp
+++ b/core/src/fpdfdoc/doc_formcontrol.cpp
@@ -246,27 +246,27 @@ CPDF_Action CPDF_FormControl::GetAction() {
}
return CPDF_Action(pObj->GetDict());
}
+
CPDF_AAction CPDF_FormControl::GetAdditionalAction() {
- if (!m_pWidgetDict) {
- return nullptr;
- }
- if (m_pWidgetDict->KeyExist("AA")) {
- return m_pWidgetDict->GetDictBy("AA");
- }
+ if (!m_pWidgetDict)
+ return CPDF_AAction();
+
+ if (m_pWidgetDict->KeyExist("AA"))
+ return CPDF_AAction(m_pWidgetDict->GetDictBy("AA"));
return m_pField->GetAdditionalAction();
}
+
CPDF_DefaultAppearance CPDF_FormControl::GetDefaultAppearance() {
- if (!m_pWidgetDict) {
- return CFX_ByteString();
- }
- if (m_pWidgetDict->KeyExist("DA")) {
- return m_pWidgetDict->GetStringBy("DA");
- }
+ if (!m_pWidgetDict)
+ return CPDF_DefaultAppearance();
+
+ if (m_pWidgetDict->KeyExist("DA"))
+ return CPDF_DefaultAppearance(m_pWidgetDict->GetStringBy("DA"));
+
CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "DA");
- if (!pObj) {
- return m_pField->m_pForm->GetDefaultAppearance();
- }
- return pObj->GetString();
+ if (pObj)
+ return CPDF_DefaultAppearance(pObj->GetString());
+ return m_pField->m_pForm->GetDefaultAppearance();
}
CPDF_Font* CPDF_FormControl::GetDefaultControlFont() {
@@ -421,7 +421,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 {
« no previous file with comments | « core/src/fpdfdoc/doc_form.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698