summaryrefslogtreecommitdiff
path: root/chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_listbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_listbox.cpp')
-rw-r--r--chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_listbox.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_listbox.cpp b/chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_listbox.cpp
index 0cbc20a213c..c35f1485d51 100644
--- a/chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -110,7 +110,11 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) {
return;
int32_t nNewTopIndex = pListBox->GetTopVisibleIndex();
+ ObservedPtr<CPWL_ListBox> observed_box(pListBox);
m_pWidget->ClearSelection(NotificationOption::kDoNotNotify);
+ if (!observed_box) {
+ return;
+ }
if (m_pWidget->GetFieldFlags() & pdfium::form_flags::kChoiceMultiSelect) {
for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
if (pListBox->IsItemSelected(i)) {
@@ -125,17 +129,17 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) {
ObservedPtr<CPDFSDK_Widget> observed_widget(m_pWidget.Get());
ObservedPtr<CFFL_ListBox> observed_this(this);
m_pWidget->SetTopVisibleIndex(nNewTopIndex);
- if (!observed_widget)
+ if (!observed_widget) {
return;
-
+ }
m_pWidget->ResetFieldAppearance();
- if (!observed_widget)
+ if (!observed_widget) {
return;
-
+ }
m_pWidget->UpdateField();
- if (!observed_widget || !observed_this)
+ if (!observed_widget || !observed_this) {
return;
-
+ }
SetChangeMark();
}