summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formfield.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-11 14:26:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-11 14:26:01 +0000
commit7981d15a799e3bdfaf6bd3e04fc08a6a43d143ec (patch)
treee9afc04bbee08b17e32c2286c6e2ae1d9ea52d41 /core/fpdfdoc/cpdf_formfield.cpp
parent8b68d30fdc8ae33a8a5c2d647bd7a67f1271ff90 (diff)
downloadpdfium-7981d15a799e3bdfaf6bd3e04fc08a6a43d143ec.tar.xz
Add jumbo build support for fdrm, fpdfdoc and fxcrt.
BUG=pdfium:964 Change-Id: Ifde885861aeafac803948bd537de826e2a3fddca Reviewed-on: https://pdfium-review.googlesource.com/22732 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.cpp')
-rw-r--r--core/fpdfdoc/cpdf_formfield.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index 395b5c5713..2502fe6faa 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -25,8 +25,6 @@
namespace {
-const int kMaxRecursion = 32;
-
const int kFormListMultiSelect = 0x100;
const int kFormComboEdit = 0x100;
@@ -50,9 +48,8 @@ bool IsUnison(CPDF_FormField* pField) {
CPDF_Object* FPDF_GetFieldAttr(const CPDF_Dictionary* pFieldDict,
const char* name,
int nLevel) {
- if (nLevel > kMaxRecursion)
- return nullptr;
- if (!pFieldDict)
+ static constexpr int kGetFieldMaxRecursion = 32;
+ if (!pFieldDict || nLevel > kGetFieldMaxRecursion)
return nullptr;
CPDF_Object* pAttr = pFieldDict->GetDirectObjectFor(name);
@@ -60,9 +57,7 @@ CPDF_Object* FPDF_GetFieldAttr(const CPDF_Dictionary* pFieldDict,
return pAttr;
CPDF_Dictionary* pParent = pFieldDict->GetDictFor("Parent");
- if (!pParent)
- return nullptr;
- return FPDF_GetFieldAttr(pParent, name, nLevel + 1);
+ return pParent ? FPDF_GetFieldAttr(pParent, name, nLevel + 1) : nullptr;
}
WideString FPDF_GetFullName(CPDF_Dictionary* pFieldDict) {