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 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2119 | 2119 |
2120 return TRUE; | 2120 return TRUE; |
2121 } | 2121 } |
2122 return FALSE; | 2122 return FALSE; |
2123 } | 2123 } |
2124 | 2124 |
2125 // CPDFSDK_XFAWidget | 2125 // CPDFSDK_XFAWidget |
2126 CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, | 2126 CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, |
2127 CPDFSDK_PageView* pPageView, | 2127 CPDFSDK_PageView* pPageView, |
2128 CPDFSDK_InterForm* pInterForm) | 2128 CPDFSDK_InterForm* pInterForm) |
2129 : CPDFSDK_Annot(pPageView), | 2129 : CPDFSDK_Annot(pPageView), m_pInterForm(pInterForm), m_hXFAWidget(pAnnot) { |
2130 m_hXFAWidget(pAnnot), | 2130 } |
2131 m_pInterForm(pInterForm) {} | |
2132 | 2131 |
2133 FX_BOOL CPDFSDK_XFAWidget::IsXFAField() { | 2132 FX_BOOL CPDFSDK_XFAWidget::IsXFAField() { |
2134 return TRUE; | 2133 return TRUE; |
2135 } | 2134 } |
2136 | 2135 |
2137 CFX_ByteString CPDFSDK_XFAWidget::GetType() const { | 2136 CFX_ByteString CPDFSDK_XFAWidget::GetType() const { |
2138 return FSDK_XFAWIDGET_TYPENAME; | 2137 return FSDK_XFAWIDGET_TYPENAME; |
2139 } | 2138 } |
2140 | 2139 |
2141 CFX_FloatRect CPDFSDK_XFAWidget::GetRect() { | 2140 CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const { |
2142 CPDFSDK_PageView* pPageView = GetPageView(); | 2141 CPDFSDK_PageView* pPageView = GetPageView(); |
2143 ASSERT(pPageView != NULL); | |
2144 | |
2145 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); | 2142 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); |
2146 ASSERT(pDocument != NULL); | |
2147 | |
2148 CPDFXFA_Document* pDoc = pDocument->GetDocument(); | 2143 CPDFXFA_Document* pDoc = pDocument->GetDocument(); |
2149 ASSERT(pDoc != NULL); | |
2150 | |
2151 IXFA_DocView* pDocView = pDoc->GetXFADocView(); | 2144 IXFA_DocView* pDocView = pDoc->GetXFADocView(); |
2152 ASSERT(pDocView != NULL); | |
2153 | |
2154 IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler(); | 2145 IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler(); |
2155 ASSERT(pWidgetHandler != NULL); | |
2156 | 2146 |
2157 CFX_RectF rcBBox; | 2147 CFX_RectF rcBBox; |
2158 pWidgetHandler->GetRect(GetXFAWidget(), rcBBox); | 2148 pWidgetHandler->GetRect(GetXFAWidget(), rcBBox); |
2159 | 2149 |
2160 return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, | 2150 return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, |
2161 rcBBox.top + rcBBox.height); | 2151 rcBBox.top + rcBBox.height); |
2162 } | 2152 } |
2163 | 2153 |
2164 // CPDFSDK_InterForm | 2154 // CPDFSDK_InterForm |
2165 CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument) | 2155 CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument) |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3248 break; | 3238 break; |
3249 } | 3239 } |
3250 } | 3240 } |
3251 } | 3241 } |
3252 | 3242 |
3253 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { | 3243 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { |
3254 CPDF_Rect rcAnnot; | 3244 CPDF_Rect rcAnnot; |
3255 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); | 3245 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); |
3256 return rcAnnot; | 3246 return rcAnnot; |
3257 } | 3247 } |
OLD | NEW |