| 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 "../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../third_party/base/nonstd_unique_ptr.h" |
| 8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
| 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_util.h" | 10 #include "../include/fpdfxfa/fpdfxfa_util.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 | 559 |
| 560 CFX_ByteString CPDFSDK_Widget::GetSubType() const { | 560 CFX_ByteString CPDFSDK_Widget::GetSubType() const { |
| 561 int nType = GetFieldType(); | 561 int nType = GetFieldType(); |
| 562 | 562 |
| 563 if (nType == FIELDTYPE_SIGNATURE) | 563 if (nType == FIELDTYPE_SIGNATURE) |
| 564 return BFFT_SIGNATURE; | 564 return BFFT_SIGNATURE; |
| 565 return CPDFSDK_Annot::GetSubType(); | 565 return CPDFSDK_Annot::GetSubType(); |
| 566 } | 566 } |
| 567 | 567 |
| 568 CPDF_FormField* CPDFSDK_Widget::GetFormField() const { | 568 CPDF_FormField* CPDFSDK_Widget::GetFormField() const { |
| 569 ASSERT(m_pInterForm != NULL); | 569 return GetFormControl()->GetField(); |
| 570 | |
| 571 CPDF_FormControl* pCtrl = GetFormControl(); | |
| 572 ASSERT(pCtrl != NULL); | |
| 573 | |
| 574 return pCtrl->GetField(); | |
| 575 } | 570 } |
| 576 | 571 |
| 577 CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const { | 572 CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const { |
| 578 ASSERT(m_pInterForm != NULL); | |
| 579 | |
| 580 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); | 573 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); |
| 581 ASSERT(pPDFInterForm != NULL); | |
| 582 | |
| 583 return pPDFInterForm->GetControlByDict(GetAnnotDict()); | 574 return pPDFInterForm->GetControlByDict(GetAnnotDict()); |
| 584 } | 575 } |
| 585 | 576 |
| 586 CPDF_FormControl* CPDFSDK_Widget::GetFormControl(CPDF_InterForm* pInterForm, | 577 CPDF_FormControl* CPDFSDK_Widget::GetFormControl( |
| 587 CPDF_Dictionary* pAnnotDict) { | 578 CPDF_InterForm* pInterForm, |
| 588 ASSERT(pInterForm != NULL); | 579 const CPDF_Dictionary* pAnnotDict) { |
| 589 ASSERT(pAnnotDict != NULL); | 580 ASSERT(pAnnotDict != NULL); |
| 590 | 581 return pInterForm->GetControlByDict(pAnnotDict); |
| 591 CPDF_FormControl* pControl = pInterForm->GetControlByDict(pAnnotDict); | |
| 592 | |
| 593 return pControl; | |
| 594 } | 582 } |
| 595 | 583 |
| 596 int CPDFSDK_Widget::GetRotate() const { | 584 int CPDFSDK_Widget::GetRotate() const { |
| 597 CPDF_FormControl* pCtrl = GetFormControl(); | 585 CPDF_FormControl* pCtrl = GetFormControl(); |
| 598 ASSERT(pCtrl != NULL); | |
| 599 | |
| 600 return pCtrl->GetRotation() % 360; | 586 return pCtrl->GetRotation() % 360; |
| 601 } | 587 } |
| 602 | 588 |
| 603 CFX_WideString CPDFSDK_Widget::GetName() const { | 589 CFX_WideString CPDFSDK_Widget::GetName() const { |
| 604 CPDF_FormField* pFormField = GetFormField(); | 590 CPDF_FormField* pFormField = GetFormField(); |
| 605 return pFormField->GetFullName(); | 591 return pFormField->GetFullName(); |
| 606 } | 592 } |
| 607 | 593 |
| 608 FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const { | 594 FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const { |
| 609 CPDF_FormControl* pFormCtrl = GetFormControl(); | 595 CPDF_FormControl* pFormCtrl = GetFormControl(); |
| (...skipping 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3248 break; | 3234 break; |
| 3249 } | 3235 } |
| 3250 } | 3236 } |
| 3251 } | 3237 } |
| 3252 | 3238 |
| 3253 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { | 3239 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { |
| 3254 CPDF_Rect rcAnnot; | 3240 CPDF_Rect rcAnnot; |
| 3255 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); | 3241 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); |
| 3256 return rcAnnot; | 3242 return rcAnnot; |
| 3257 } | 3243 } |
| OLD | NEW |