From ab5a20d9de8c801b8376bfe2d6f7cf9ac7d26028 Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 7 Dec 2016 11:32:52 -0800 Subject: Fix the way to check terminal field in interactive form Originally the key "T" was checked which was not correct since that key is optional. Now change to check "FT" as well as its parent's key since this key is also inheritable. BUG=chromium:440132 Review-Url: https://codereview.chromium.org/2554223002 --- core/fpdfdoc/cpdf_interform.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index c323986603..e574e28fe5 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -1079,8 +1079,12 @@ void CPDF_InterForm::FixPageFields(const CPDF_Page* pPage) { } CPDF_FormField* CPDF_InterForm::AddTerminalField(CPDF_Dictionary* pFieldDict) { - if (!pFieldDict->KeyExist("T")) - return nullptr; + if (!pFieldDict->KeyExist("FT")) { + // Key "FT" is required for terminal fields, it is also inheritable. + CPDF_Dictionary* pParentDict = pFieldDict->GetDictFor("Parent"); + if (!pParentDict || !pParentDict->KeyExist("FT")) + return nullptr; + } CPDF_Dictionary* pDict = pFieldDict; CFX_WideString csWName = FPDF_GetFullName(pFieldDict); -- cgit v1.2.3