Chromium Code Reviews| Index: fpdfsdk/javascript/Field.cpp |
| diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp |
| index 3f5e5e1b0f57ae9aabb2675b4a0705d8e1bee752..24b84f917b25e57448dcb1a9cf27f3596aefe38f 100644 |
| --- a/fpdfsdk/javascript/Field.cpp |
| +++ b/fpdfsdk/javascript/Field.cpp |
| @@ -269,12 +269,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) { |
|
Lei Zhang
2016/09/07 21:01:29
Isn't this always true?
Tom Sepez
2016/09/07 21:10:28
No, that's the whole point of the observer. If we
|
| - pWidget->ResetAppearance(bFormatted ? sValue.c_str() : nullptr, |
| - FALSE); |
| + static_cast<CPDFSDK_Widget*>(pAnnot)->ResetAppearance( |
| + bFormatted ? sValue.c_str() : nullptr, FALSE); |
| } |
| } |
| } else { |