summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-12 09:47:52 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-12 09:47:52 -0700
commit1c62054a42cf0759148501a36c541de5d5769d32 (patch)
treeed2e53f26474dff1149ce83d3f175c3c36b31631 /fpdfsdk/javascript/Field.cpp
parent75f84a56fed36111ece82d0ac96e87289622b093 (diff)
downloadpdfium-1c62054a42cf0759148501a36c541de5d5769d32.tar.xz
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
Diffstat (limited to 'fpdfsdk/javascript/Field.cpp')
-rw-r--r--fpdfsdk/javascript/Field.cpp10
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 {