Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1370)

Unified Diff: fpdfsdk/javascript/Field.cpp

Issue 2306663002: Add observer for BAAnnots from Javascript (Closed)
Patch Set: Review updates Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« fpdfsdk/javascript/Annot.h ('K') | « fpdfsdk/javascript/Annot.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/Field.cpp
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 5c279d6b53a9839a077efca1d18e66f045f9b531..3f5e5e1b0f57ae9aabb2675b4a0705d8e1bee752 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);
}
« fpdfsdk/javascript/Annot.h ('K') | « fpdfsdk/javascript/Annot.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698