| 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 "Field.h" | 7 #include "Field.h" |
| 8 | 8 |
| 9 #include "Document.h" | 9 #include "Document.h" |
| 10 #include "Icon.h" | 10 #include "Icon.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 pDoc->UpdateAllViews(NULL, pWidget); | 282 pDoc->UpdateAllViews(NULL, pWidget); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 if (bChangeMark) | 286 if (bChangeMark) |
| 287 pDocument->SetChangeMark(); | 287 pDocument->SetChangeMark(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, | 290 CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, |
| 291 CPDF_FormControl* pFormControl) { | 291 CPDF_FormControl* pFormControl) { |
| 292 ASSERT(pDocument != NULL); | 292 CPDFSDK_InterForm* pInterForm = |
| 293 ASSERT(pFormControl != NULL); | 293 static_cast<CPDFSDK_InterForm*>(pDocument->GetInterForm()); |
| 294 | 294 return pInterForm ? pInterForm->GetWidget(pFormControl) : nullptr; |
| 295 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); | |
| 296 ASSERT(pInterForm != NULL); | |
| 297 | |
| 298 return pInterForm->GetWidget(pFormControl); | |
| 299 } | 295 } |
| 300 | 296 |
| 301 FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, | 297 FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, |
| 302 CFX_WideString csOptLabel) { | 298 CFX_WideString csOptLabel) { |
| 303 ASSERT(pFormField != NULL); | 299 ASSERT(pFormField != NULL); |
| 304 | 300 |
| 305 for (int i = 0, sz = pFormField->CountOptions(); i < sz; i++) { | 301 for (int i = 0, sz = pFormField->CountOptions(); i < sz; i++) { |
| 306 if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0) | 302 if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0) |
| 307 return TRUE; | 303 return TRUE; |
| 308 } | 304 } |
| (...skipping 3429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3738 #define JS_FIELD_MINWIDTH 1 | 3734 #define JS_FIELD_MINWIDTH 1 |
| 3739 #define JS_FIELD_MINHEIGHT 1 | 3735 #define JS_FIELD_MINHEIGHT 1 |
| 3740 | 3736 |
| 3741 void Field::AddField(CPDFSDK_Document* pDocument, | 3737 void Field::AddField(CPDFSDK_Document* pDocument, |
| 3742 int nPageIndex, | 3738 int nPageIndex, |
| 3743 int nFieldType, | 3739 int nFieldType, |
| 3744 const CFX_WideString& sName, | 3740 const CFX_WideString& sName, |
| 3745 const CPDF_Rect& rcCoords) { | 3741 const CPDF_Rect& rcCoords) { |
| 3746 // Not supported. | 3742 // Not supported. |
| 3747 } | 3743 } |
| OLD | NEW |