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

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

Issue 984773002: Make conversion between CPDF_Action and its dictionary explicit (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Tabs Created 5 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_bookmark.cpp ('k') | core/src/fpdfdoc/doc_link.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 61cd98075451a93a385935b12caf258b05130d2d..1ab63234d6d71ed84a422651872554e2ef3df5d4 100644
--- a/core/src/fpdfdoc/doc_formcontrol.cpp
+++ b/core/src/fpdfdoc/doc_formcontrol.cpp
@@ -248,18 +248,17 @@ int CPDF_FormControl::GetTextPosition()
}
CPDF_Action CPDF_FormControl::GetAction()
{
- if (m_pWidgetDict == NULL) {
- return NULL;
+ if (!m_pWidgetDict) {
+ return CPDF_Action();
}
if (m_pWidgetDict->KeyExist("A")) {
- return m_pWidgetDict->GetDict("A");
- } else {
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "A");
- if (pObj == NULL) {
- return NULL;
- }
- return pObj->GetDict();
+ return CPDF_Action(m_pWidgetDict->GetDict("A"));
+ }
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "A");
+ if (!pObj) {
+ return CPDF_Action();
}
+ return CPDF_Action(pObj->GetDict());
}
CPDF_AAction CPDF_FormControl::GetAdditionalAction()
{
« no previous file with comments | « core/src/fpdfdoc/doc_bookmark.cpp ('k') | core/src/fpdfdoc/doc_link.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698