 Chromium Code Reviews
 Chromium Code Reviews Issue 2306663002:
  Add observer for BAAnnots from Javascript  (Closed)
    
  
    Issue 2306663002:
  Add observer for BAAnnots from Javascript  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 
| 6 | 6 | 
| 7 #include "fpdfsdk/javascript/Field.h" | 7 #include "fpdfsdk/javascript/Field.h" | 
| 8 | 8 | 
| 9 #include <algorithm> | 9 #include <algorithm> | 
| 10 #include <memory> | 10 #include <memory> | 
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 FX_BOOL bChangeMark, | 260 FX_BOOL bChangeMark, | 
| 261 FX_BOOL bResetAP, | 261 FX_BOOL bResetAP, | 
| 262 FX_BOOL bRefresh) { | 262 FX_BOOL bRefresh) { | 
| 263 std::vector<CPDFSDK_Widget*> widgets; | 263 std::vector<CPDFSDK_Widget*> widgets; | 
| 264 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); | 264 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); | 
| 265 pInterForm->GetWidgets(pFormField, &widgets); | 265 pInterForm->GetWidgets(pFormField, &widgets); | 
| 266 | 266 | 
| 267 if (bResetAP) { | 267 if (bResetAP) { | 
| 268 int nFieldType = pFormField->GetFieldType(); | 268 int nFieldType = pFormField->GetFieldType(); | 
| 269 if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD) { | 269 if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD) { | 
| 270 for (CPDFSDK_Widget* pWidget : widgets) { | 270 for (CPDFSDK_Annot* pAnnot : widgets) { | 
| 271 FX_BOOL bFormatted = FALSE; | 271 FX_BOOL bFormatted = FALSE; | 
| 272 CPDFSDK_Widget::Observer observer(&pWidget); | 272 CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot); | 
| 273 CPDFSDK_Widget::Observer observer(&pAnnot); | |
| 273 CFX_WideString sValue = pWidget->OnFormat(bFormatted); | 274 CFX_WideString sValue = pWidget->OnFormat(bFormatted); | 
| 274 if (pWidget) { | 275 if (pWidget) { | 
| 
Tom Sepez
2016/09/01 20:06:23
Need to check pannot here, its the thing that gets
 
dsinclair
2016/09/06 15:44:49
Done.
Not sure what you're referring to about the
 | |
| 275 pWidget->ResetAppearance(bFormatted ? sValue.c_str() : nullptr, | 276 pWidget->ResetAppearance(bFormatted ? sValue.c_str() : nullptr, | 
| 276 FALSE); | 277 FALSE); | 
| 277 } | 278 } | 
| 278 } | 279 } | 
| 279 } else { | 280 } else { | 
| 280 for (CPDFSDK_Widget* pWidget : widgets) { | 281 for (CPDFSDK_Widget* pWidget : widgets) { | 
| 281 pWidget->ResetAppearance(nullptr, FALSE); | 282 pWidget->ResetAppearance(nullptr, FALSE); | 
| 282 } | 283 } | 
| 283 } | 284 } | 
| 284 } | 285 } | 
| (...skipping 3185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3470 } | 3471 } | 
| 3471 } | 3472 } | 
| 3472 | 3473 | 
| 3473 void Field::AddField(CPDFSDK_Document* pDocument, | 3474 void Field::AddField(CPDFSDK_Document* pDocument, | 
| 3474 int nPageIndex, | 3475 int nPageIndex, | 
| 3475 int nFieldType, | 3476 int nFieldType, | 
| 3476 const CFX_WideString& sName, | 3477 const CFX_WideString& sName, | 
| 3477 const CFX_FloatRect& rcCoords) { | 3478 const CFX_FloatRect& rcCoords) { | 
| 3478 // Not supported. | 3479 // Not supported. | 
| 3479 } | 3480 } | 
| OLD | NEW |