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 "xfa/fxfa/parser/xfa_document_layout_imp.h" | 7 #include "xfa/fxfa/parser/xfa_document_layout_imp.h" |
8 | 8 |
9 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 9 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
10 #include "xfa/fxfa/parser/xfa_basic_imp.h" | 10 #include "xfa/fxfa/parser/xfa_basic_imp.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(NULL) {} | 173 : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(NULL) {} |
174 CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const { | 174 CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const { |
175 return m_pFormNode->GetDocument()->GetLayoutProcessor(); | 175 return m_pFormNode->GetDocument()->GetLayoutProcessor(); |
176 } | 176 } |
177 int32_t CXFA_ContainerLayoutItem::GetPageIndex() const { | 177 int32_t CXFA_ContainerLayoutItem::GetPageIndex() const { |
178 return m_pFormNode->GetDocument() | 178 return m_pFormNode->GetDocument() |
179 ->GetLayoutProcessor() | 179 ->GetLayoutProcessor() |
180 ->GetLayoutPageMgr() | 180 ->GetLayoutPageMgr() |
181 ->GetPageIndex(this); | 181 ->GetPageIndex(this); |
182 } | 182 } |
183 void CXFA_ContainerLayoutItem::GetPageSize(CFX_SizeF& size) { | 183 |
| 184 void CXFA_ContainerLayoutItem::GetPageSize(CFX_SizeF& size) const { |
184 size.clear(); | 185 size.clear(); |
185 CXFA_Node* pMedium = m_pFormNode->GetFirstChildByClass(XFA_ELEMENT_Medium); | 186 CXFA_Node* pMedium = m_pFormNode->GetFirstChildByClass(XFA_ELEMENT_Medium); |
186 if (!pMedium) | 187 if (!pMedium) |
187 return; | 188 return; |
188 | 189 |
189 size = CFX_SizeF(pMedium->GetMeasure(XFA_ATTRIBUTE_Short).ToUnit(XFA_UNIT_Pt), | 190 size = CFX_SizeF(pMedium->GetMeasure(XFA_ATTRIBUTE_Short).ToUnit(XFA_UNIT_Pt), |
190 pMedium->GetMeasure(XFA_ATTRIBUTE_Long).ToUnit(XFA_UNIT_Pt)); | 191 pMedium->GetMeasure(XFA_ATTRIBUTE_Long).ToUnit(XFA_UNIT_Pt)); |
191 if (pMedium->GetEnum(XFA_ATTRIBUTE_Orientation) == | 192 if (pMedium->GetEnum(XFA_ATTRIBUTE_Orientation) == |
192 XFA_ATTRIBUTEENUM_Landscape) { | 193 XFA_ATTRIBUTEENUM_Landscape) { |
193 size = CFX_SizeF(size.y, size.x); | 194 size = CFX_SizeF(size.y, size.x); |
194 } | 195 } |
195 } | 196 } |
| 197 |
196 CXFA_Node* CXFA_ContainerLayoutItem::GetMasterPage() const { | 198 CXFA_Node* CXFA_ContainerLayoutItem::GetMasterPage() const { |
197 return m_pFormNode; | 199 return m_pFormNode; |
198 } | 200 } |
199 CXFA_ContentLayoutItem::CXFA_ContentLayoutItem(CXFA_Node* pNode) | 201 CXFA_ContentLayoutItem::CXFA_ContentLayoutItem(CXFA_Node* pNode) |
200 : CXFA_LayoutItem(pNode, TRUE), | 202 : CXFA_LayoutItem(pNode, TRUE), |
201 m_pPrev(NULL), | 203 m_pPrev(NULL), |
202 m_pNext(NULL), | 204 m_pNext(NULL), |
203 m_dwStatus(0) {} | 205 m_dwStatus(0) {} |
204 CXFA_ContentLayoutItem::~CXFA_ContentLayoutItem() { | 206 CXFA_ContentLayoutItem::~CXFA_ContentLayoutItem() { |
205 if (m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY) == this) { | 207 if (m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY) == this) { |
206 m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, NULL); | 208 m_pFormNode->SetUserData(XFA_LAYOUTITEMKEY, NULL); |
207 } | 209 } |
208 } | 210 } |
OLD | NEW |