summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp7
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp11
2 files changed, 12 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 70d3990ea3..fb1afe94b4 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -672,9 +672,10 @@ void CFFL_InteractiveFormFiller::OnCalculate(CPDFSDK_Annot::ObservedPtr* pAnnot,
return;
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
- ASSERT(pWidget);
- CPDFSDK_InterForm* pInterForm = pPageView->GetFormFillEnv()->GetInterForm();
- pInterForm->OnCalculate(pWidget->GetFormField());
+ if (pWidget) {
+ CPDFSDK_InterForm* pInterForm = pPageView->GetFormFillEnv()->GetInterForm();
+ pInterForm->OnCalculate(pWidget->GetFormField());
+ }
m_bNotifying = false;
}
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index 76434a5216..4174ae4179 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -139,10 +139,15 @@ void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView) {
WideString sOldValue = m_pWidget->GetValue();
WideString sNewValue = pWnd->GetText();
+ CPDFSDK_Widget::ObservedPtr observed_widget(m_pWidget.Get());
+ CFFL_TextField::ObservedPtr observed_this(this);
m_pWidget->SetValue(sNewValue, false);
- m_pWidget->ResetFieldAppearance(true);
- m_pWidget->UpdateField();
- SetChangeMark();
+ if (observed_widget)
+ m_pWidget->ResetFieldAppearance(true);
+ if (observed_widget)
+ m_pWidget->UpdateField();
+ if (observed_this)
+ SetChangeMark();
}
void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView,