diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-16 15:34:05 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-16 21:00:57 +0000 |
commit | 90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f (patch) | |
tree | 38ac9992765ed34727da873eefe4ece39c0c63e2 /core/fpdfdoc/cpdf_annotlist.cpp | |
parent | 9521036052646f60dc5c1ccd4821108eac4bca55 (diff) | |
download | pdfium-90fffb31e2ec6cf66fe1b85b466cd2f12ee9c87f.tar.xz |
Simplify CPVT_GenerateAP interface
This CL moves the annotation decision inside GenerateAnnotAP and hides
the individual annotation AP generation methods. The form methods are
hidden inside GenerateFormAP and a general GenerateEmptyAP has been
added.
Change-Id: I9e761cb10ceca70681df4e546631a7859f1bfc7c
Reviewed-on: https://pdfium-review.googlesource.com/16130
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_annotlist.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_annotlist.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp index c7da676b98..192649d4a4 100644 --- a/core/fpdfdoc/cpdf_annotlist.cpp +++ b/core/fpdfdoc/cpdf_annotlist.cpp @@ -85,15 +85,18 @@ void GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { ByteString field_type = pFieldTypeObj->GetString(); if (field_type == "Tx") { - CPVT_GenerateAP::GenerateTextFieldAP(pDoc, pAnnotDict); + CPVT_GenerateAP::GenerateFormAP(CPVT_GenerateAP::kTextField, pDoc, + pAnnotDict); return; } CPDF_Object* pFieldFlagsObj = FPDF_GetFieldAttr(pAnnotDict, "Ff"); uint32_t flags = pFieldFlagsObj ? pFieldFlagsObj->GetInteger() : 0; if (field_type == "Ch") { - (flags & (1 << 17)) ? CPVT_GenerateAP::GenerateComboBoxAP(pDoc, pAnnotDict) - : CPVT_GenerateAP::GenerateListBoxAP(pDoc, pAnnotDict); + CPVT_GenerateAP::GenerateFormAP((flags & (1 << 17)) + ? CPVT_GenerateAP::kComboBox + : CPVT_GenerateAP::kListBox, + pDoc, pAnnotDict); return; } |