| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/include/cpdfsdk_widget.h" | 7 #include "fpdfsdk/include/cpdfsdk_widget.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 | 540 |
| 541 int CPDFSDK_Widget::GetFieldFlags() const { | 541 int CPDFSDK_Widget::GetFieldFlags() const { |
| 542 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); | 542 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); |
| 543 CPDF_FormControl* pFormControl = | 543 CPDF_FormControl* pFormControl = |
| 544 pPDFInterForm->GetControlByDict(m_pAnnot->GetAnnotDict()); | 544 pPDFInterForm->GetControlByDict(m_pAnnot->GetAnnotDict()); |
| 545 CPDF_FormField* pFormField = pFormControl->GetField(); | 545 CPDF_FormField* pFormField = pFormControl->GetField(); |
| 546 return pFormField->GetFieldFlags(); | 546 return pFormField->GetFieldFlags(); |
| 547 } | 547 } |
| 548 | 548 |
| 549 CFX_ByteString CPDFSDK_Widget::GetSubType() const { | 549 bool CPDFSDK_Widget::IsSignatureWidget() const { |
| 550 int nType = GetFieldType(); | 550 return GetFieldType() == FIELDTYPE_SIGNATURE; |
| 551 | |
| 552 if (nType == FIELDTYPE_SIGNATURE) | |
| 553 return BFFT_SIGNATURE; | |
| 554 return CPDFSDK_Annot::GetSubType(); | |
| 555 } | 551 } |
| 556 | 552 |
| 557 CPDF_FormField* CPDFSDK_Widget::GetFormField() const { | 553 CPDF_FormField* CPDFSDK_Widget::GetFormField() const { |
| 558 CPDF_FormControl* pControl = GetFormControl(); | 554 CPDF_FormControl* pControl = GetFormControl(); |
| 559 return pControl ? pControl->GetField() : nullptr; | 555 return pControl ? pControl->GetField() : nullptr; |
| 560 } | 556 } |
| 561 | 557 |
| 562 CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const { | 558 CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const { |
| 563 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); | 559 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); |
| 564 return pPDFInterForm->GetControlByDict(GetAnnotDict()); | 560 return pPDFInterForm->GetControlByDict(GetAnnotDict()); |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1980 return FALSE; | 1976 return FALSE; |
| 1981 | 1977 |
| 1982 if (!IsVisible()) | 1978 if (!IsVisible()) |
| 1983 return FALSE; | 1979 return FALSE; |
| 1984 | 1980 |
| 1985 if ((GetFieldFlags() & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) | 1981 if ((GetFieldFlags() & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) |
| 1986 return FALSE; | 1982 return FALSE; |
| 1987 | 1983 |
| 1988 return TRUE; | 1984 return TRUE; |
| 1989 } | 1985 } |
| OLD | NEW |