diff options
author | Lei Zhang <thestig@chromium.org> | 2018-01-11 14:26:01 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-11 14:26:01 +0000 |
commit | 7981d15a799e3bdfaf6bd3e04fc08a6a43d143ec (patch) | |
tree | e9afc04bbee08b17e32c2286c6e2ae1d9ea52d41 /core/fpdfdoc | |
parent | 8b68d30fdc8ae33a8a5c2d647bd7a67f1271ff90 (diff) | |
download | pdfium-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')
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.cpp | 11 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_nametree.cpp | 12 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_structtree.cpp | 5 |
3 files changed, 11 insertions, 17 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) { diff --git a/core/fpdfdoc/cpdf_nametree.cpp b/core/fpdfdoc/cpdf_nametree.cpp index 631571c9e4..3c5b08db21 100644 --- a/core/fpdfdoc/cpdf_nametree.cpp +++ b/core/fpdfdoc/cpdf_nametree.cpp @@ -17,7 +17,7 @@ namespace { -const int nMaxRecursion = 32; +constexpr int kNameTreeMaxRecursion = 32; std::pair<WideString, WideString> GetNodeLimitsMaybeSwap(CPDF_Array* pLimits) { ASSERT(pLimits); @@ -40,7 +40,7 @@ bool GetNodeAncestorsLimits(const CPDF_Dictionary* pNode, const CPDF_Array* pFind, int nLevel, std::vector<CPDF_Array*>* pLimits) { - if (nLevel > nMaxRecursion) + if (nLevel > kNameTreeMaxRecursion) return false; if (pNode->GetArrayFor("Names") == pFind) { @@ -72,7 +72,7 @@ bool UpdateNodesAndLimitsUponDeletion(CPDF_Dictionary* pNode, const CPDF_Array* pFind, const WideString& csName, int nLevel) { - if (nLevel > nMaxRecursion) + if (nLevel > kNameTreeMaxRecursion) return false; CPDF_Array* pLimits = pNode->GetArrayFor("Limits"); @@ -159,7 +159,7 @@ CPDF_Object* SearchNameNodeByName(const CPDF_Dictionary* pNode, size_t* nIndex, CPDF_Array** ppFind, int* pFindIndex) { - if (nLevel > nMaxRecursion) + if (nLevel > kNameTreeMaxRecursion) return nullptr; CPDF_Array* pLimits = pNode->GetArrayFor("Limits"); @@ -235,7 +235,7 @@ CPDF_Object* SearchNameNodeByIndex(const CPDF_Dictionary* pNode, WideString* csName, CPDF_Array** ppFind, int* pFindIndex) { - if (nLevel > nMaxRecursion) + if (nLevel > kNameTreeMaxRecursion) return nullptr; CPDF_Array* pNames = pNode->GetArrayFor("Names"); @@ -272,7 +272,7 @@ CPDF_Object* SearchNameNodeByIndex(const CPDF_Dictionary* pNode, // Get the total number of key-value pairs in the tree with root |pNode|. size_t CountNamesInternal(CPDF_Dictionary* pNode, int nLevel) { - if (nLevel > nMaxRecursion) + if (nLevel > kNameTreeMaxRecursion) return 0; CPDF_Array* pNames = pNode->GetArrayFor("Names"); diff --git a/core/fpdfdoc/cpdf_structtree.cpp b/core/fpdfdoc/cpdf_structtree.cpp index 48b83f555c..97db691425 100644 --- a/core/fpdfdoc/cpdf_structtree.cpp +++ b/core/fpdfdoc/cpdf_structtree.cpp @@ -15,8 +15,6 @@ namespace { -const int nMaxRecursion = 32; - bool IsTagged(const CPDF_Document* pDoc) { const CPDF_Dictionary* pCatalog = pDoc->GetRoot(); const CPDF_Dictionary* pMarkInfo = pCatalog->GetDictFor("MarkInfo"); @@ -87,7 +85,8 @@ RetainPtr<CPDF_StructElement> CPDF_StructTree::AddPageNode( CPDF_Dictionary* pDict, std::map<CPDF_Dictionary*, RetainPtr<CPDF_StructElement>>* map, int nLevel) { - if (nLevel > nMaxRecursion) + static constexpr int kStructTreeMaxRecursion = 32; + if (nLevel > kStructTreeMaxRecursion) return nullptr; auto it = map->find(pDict); |