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/fsdk_mgr.h" | 9 #include "../include/fsdk_mgr.h" |
10 #include "../include/fsdk_baseannot.h" | 10 #include "../include/fsdk_baseannot.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 int nType = GetFieldType(); | 94 int nType = GetFieldType(); |
95 | 95 |
96 if (nType == FIELDTYPE_SIGNATURE) | 96 if (nType == FIELDTYPE_SIGNATURE) |
97 return BFFT_SIGNATURE; | 97 return BFFT_SIGNATURE; |
98 return CPDFSDK_Annot::GetSubType(); | 98 return CPDFSDK_Annot::GetSubType(); |
99 } | 99 } |
100 | 100 |
101 CPDF_FormField* CPDFSDK_Widget::GetFormField() const { | 101 CPDF_FormField* CPDFSDK_Widget::GetFormField() const { |
102 ASSERT(m_pInterForm != NULL); | 102 ASSERT(m_pInterForm != NULL); |
103 | 103 |
104 CPDF_FormControl* pCtrl = GetFormControl(); | 104 CPDF_FormControl* pCtrl = GetFormControl(); |
Tom Sepez
2015/10/30 20:26:07
I thought I'd collapsed a bunch of these into:
Lei Zhang
2015/10/30 22:17:50
Done.
| |
105 ASSERT(pCtrl != NULL); | |
106 | |
107 return pCtrl->GetField(); | 105 return pCtrl->GetField(); |
108 } | 106 } |
109 | 107 |
110 CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const { | 108 CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const { |
111 ASSERT(m_pInterForm != NULL); | |
112 | |
113 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); | 109 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); |
114 ASSERT(pPDFInterForm != NULL); | |
115 | |
116 return pPDFInterForm->GetControlByDict(GetAnnotDict()); | 110 return pPDFInterForm->GetControlByDict(GetAnnotDict()); |
117 } | 111 } |
118 | 112 |
119 CPDF_FormControl* CPDFSDK_Widget::GetFormControl(CPDF_InterForm* pInterForm, | 113 CPDF_FormControl* CPDFSDK_Widget::GetFormControl( |
120 CPDF_Dictionary* pAnnotDict) { | 114 CPDF_InterForm* pInterForm, |
121 ASSERT(pInterForm != NULL); | 115 const CPDF_Dictionary* pAnnotDict) { |
122 ASSERT(pAnnotDict != NULL); | 116 ASSERT(pAnnotDict != NULL); |
123 | 117 return pInterForm->GetControlByDict(pAnnotDict); |
124 CPDF_FormControl* pControl = pInterForm->GetControlByDict(pAnnotDict); | |
125 | |
126 return pControl; | |
127 } | 118 } |
128 | 119 |
129 int CPDFSDK_Widget::GetRotate() const { | 120 int CPDFSDK_Widget::GetRotate() const { |
130 CPDF_FormControl* pCtrl = GetFormControl(); | 121 CPDF_FormControl* pCtrl = GetFormControl(); |
131 ASSERT(pCtrl != NULL); | |
132 | |
133 return pCtrl->GetRotation() % 360; | 122 return pCtrl->GetRotation() % 360; |
134 } | 123 } |
135 | 124 |
136 FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const { | 125 FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const { |
137 CPDF_FormControl* pFormCtrl = GetFormControl(); | 126 CPDF_FormControl* pFormCtrl = GetFormControl(); |
138 ASSERT(pFormCtrl != NULL); | 127 ASSERT(pFormCtrl != NULL); |
139 | 128 |
140 int iColorType = 0; | 129 int iColorType = 0; |
141 color = FX_ARGBTOCOLORREF(pFormCtrl->GetBackgroundColor(iColorType)); | 130 color = FX_ARGBTOCOLORREF(pFormCtrl->GetBackgroundColor(iColorType)); |
142 | 131 |
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2559 break; | 2548 break; |
2560 } | 2549 } |
2561 } | 2550 } |
2562 } | 2551 } |
2563 | 2552 |
2564 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { | 2553 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { |
2565 CPDF_Rect rcAnnot; | 2554 CPDF_Rect rcAnnot; |
2566 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); | 2555 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); |
2567 return rcAnnot; | 2556 return rcAnnot; |
2568 } | 2557 } |
OLD | NEW |