summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-07 14:11:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-07 14:11:27 -0700
commit7b68f616e49235267eeac8db51aadade6d60e243 (patch)
treee49619edf4ff8f7b10adec869bb30dcc4a1b88f9 /fpdfsdk/javascript/Field.cpp
parentf56d93f8ea1c2145401e99e61cefdbfcb7341229 (diff)
downloadpdfium-7b68f616e49235267eeac8db51aadade6d60e243.tar.xz
Make Observers into a templated class
Review-Url: https://codereview.chromium.org/2311343003
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 64c7735dcf..1f49482375 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_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
- CPDFSDK_Widget::Observer observer(&pAnnot);
- CFX_WideString sValue = pWidget->OnFormat(bFormatted);
+ CPDFSDK_Annot::Observer observer(&pAnnot);
+ CFX_WideString sValue =
+ static_cast<CPDFSDK_Widget*>(pAnnot)->OnFormat(bFormatted);
if (pAnnot) {
- pWidget->ResetAppearance(bFormatted ? sValue.c_str() : nullptr,
- FALSE);
+ static_cast<CPDFSDK_Widget*>(pAnnot)->ResetAppearance(
+ bFormatted ? sValue.c_str() : nullptr, FALSE);
}
}
} else {