summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/Field.cpp')
-rw-r--r--fpdfsdk/javascript/Field.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 5c279d6b53..3f5e5e1b0f 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -267,11 +267,12 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument,
if (bResetAP) {
int nFieldType = pFormField->GetFieldType();
if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD) {
- for (CPDFSDK_Widget* pWidget : widgets) {
+ for (CPDFSDK_Annot* pAnnot : widgets) {
FX_BOOL bFormatted = FALSE;
- CPDFSDK_Widget::Observer observer(&pWidget);
+ CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
+ CPDFSDK_Widget::Observer observer(&pAnnot);
CFX_WideString sValue = pWidget->OnFormat(bFormatted);
- if (pWidget) {
+ if (pAnnot) {
pWidget->ResetAppearance(bFormatted ? sValue.c_str() : nullptr,
FALSE);
}