diff options
Diffstat (limited to 'fpdfsdk/javascript/Field.cpp')
-rw-r--r-- | fpdfsdk/javascript/Field.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp index 9ecdec6936..85a43d6cb6 100644 --- a/fpdfsdk/javascript/Field.cpp +++ b/fpdfsdk/javascript/Field.cpp @@ -270,12 +270,12 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD) { for (CPDFSDK_Annot* pAnnot : widgets) { FX_BOOL bFormatted = FALSE; - CPDFSDK_Annot::Observer observer(&pAnnot); + CPDFSDK_Annot::ObservedPtr pObserved(pAnnot); CFX_WideString sValue = - static_cast<CPDFSDK_Widget*>(pAnnot)->OnFormat(bFormatted); - if (pAnnot) { - static_cast<CPDFSDK_Widget*>(pAnnot)->ResetAppearance( - bFormatted ? &sValue : nullptr, FALSE); + static_cast<CPDFSDK_Widget*>(pObserved.Get())->OnFormat(bFormatted); + if (pObserved) { + static_cast<CPDFSDK_Widget*>(pObserved.Get()) + ->ResetAppearance(bFormatted ? &sValue : nullptr, FALSE); } } } else { |