summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_textfield.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-10-05 14:11:31 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-05 18:31:36 +0000
commit1a45ce380ec6776ac100017c68a4b8643983d2db (patch)
tree6d20b6b6ce639abaa1842fd4ef5f468e1889e802 /fpdfsdk/formfiller/cffl_textfield.cpp
parentb5787481f77fc0a002a10c8047aad591a805f723 (diff)
downloadpdfium-1a45ce380ec6776ac100017c68a4b8643983d2db.tar.xz
Add ObservedPtrs to catch issues in SaveData
BUG=chromium:756427 Change-Id: I90c7065ec5a467cb954cdf3e1d6954a0b0655d4e Reviewed-on: https://pdfium-review.googlesource.com/15630 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_textfield.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp11
1 files changed, 8 insertions, 3 deletions
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,