From 1c62054a42cf0759148501a36c541de5d5769d32 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 12 Sep 2016 09:47:52 -0700 Subject: Make CFX_Obeservable::Observer into a pointer-ish type; This may be a better design because it avoids having a level of indirection that the Observer required. Review-Url: https://codereview.chromium.org/2326763002 --- fpdfsdk/javascript/Field.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/javascript/Field.cpp') 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(pAnnot)->OnFormat(bFormatted); - if (pAnnot) { - static_cast(pAnnot)->ResetAppearance( - bFormatted ? &sValue : nullptr, FALSE); + static_cast(pObserved.Get())->OnFormat(bFormatted); + if (pObserved) { + static_cast(pObserved.Get()) + ->ResetAppearance(bFormatted ? &sValue : nullptr, FALSE); } } } else { -- cgit v1.2.3