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

Unified Diff: core/fpdfdoc/cpdf_interform.cpp

Issue 2554223002: Fix the way to check terminal field in interactive form (Closed)
Patch Set: add test Created 4 years 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 | « DEPS ('k') | testing/SUPPRESSIONS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_interform.cpp
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index c32398660389af63e526850eacc0c7fc0f798ec2..e574e28fe5a67e5129ac8cfa2866e32a0418eaba 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);
« no previous file with comments | « DEPS ('k') | testing/SUPPRESSIONS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698