summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-17 04:12:44 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-17 04:12:44 +0000
commit190645c34266d7e8ed2a3026d11a7fd5a03de86a (patch)
tree3929bf86505594190209d2968a9944d3eaee1afc /core
parente9b1cfbe85ce378d335f3b95f0b1dfb3040954cd (diff)
downloadpdfium-190645c34266d7e8ed2a3026d11a7fd5a03de86a.tar.xz
Fix assert failure in CPDF_InteractiveForm::GetControlsForField().
|CPDF_InteractiveForm::m_ControlLists| replaced |CPDF_FormField::m_ControlList| for all CPDF_FormFields. So when any CPDF_FormFields wants to know about its control list, it has to ask CPDF_InteractiveForm. Every CPDF_FormField started out with an empty control list, so CPDF_InteractiveForm should keep that behavior. BUG=chromium:895983 TBR=tsepez@chromium.org Change-Id: Ibae5f6f54a21b9576b253e230c346bfd6705ca5d Reviewed-on: https://pdfium-review.googlesource.com/c/44150 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfdoc/cpdf_interactiveform.cpp6
-rw-r--r--core/fpdfdoc/cpdf_interactiveform.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp
index 754737c454..403344c0ff 100644
--- a/core/fpdfdoc/cpdf_interactiveform.cpp
+++ b/core/fpdfdoc/cpdf_interactiveform.cpp
@@ -827,10 +827,8 @@ void CPDF_InteractiveForm::ResetForm(NotificationOption notify) {
}
const std::vector<UnownedPtr<CPDF_FormControl>>&
-CPDF_InteractiveForm::GetControlsForField(const CPDF_FormField* pField) const {
- const auto& it = m_ControlLists.find(pField);
- ASSERT(it != m_ControlLists.end());
- return it->second;
+CPDF_InteractiveForm::GetControlsForField(const CPDF_FormField* pField) {
+ return m_ControlLists[pField];
}
void CPDF_InteractiveForm::LoadField(CPDF_Dictionary* pFieldDict, int nLevel) {
diff --git a/core/fpdfdoc/cpdf_interactiveform.h b/core/fpdfdoc/cpdf_interactiveform.h
index 7a89320692..49335e99c0 100644
--- a/core/fpdfdoc/cpdf_interactiveform.h
+++ b/core/fpdfdoc/cpdf_interactiveform.h
@@ -92,7 +92,7 @@ class CPDF_InteractiveForm {
CPDF_Dictionary* GetFormDict() const { return m_pFormDict.Get(); }
const std::vector<UnownedPtr<CPDF_FormControl>>& GetControlsForField(
- const CPDF_FormField* pField) const;
+ const CPDF_FormField* pField);
private:
void LoadField(CPDF_Dictionary* pFieldDict, int nLevel);