summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_layoutitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_layoutitem.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_layoutitem.cpp99
1 files changed, 0 insertions, 99 deletions
diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp
index 42294a508b..8b1c30e8cf 100644
--- a/xfa/fxfa/parser/cxfa_layoutitem.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp
@@ -57,105 +57,6 @@ CXFA_ContainerLayoutItem* CXFA_LayoutItem::GetPage() const {
}
return nullptr;
}
-
-CFX_RectF CXFA_LayoutItem::GetRect(bool bRelative) const {
- ASSERT(m_bIsContentLayoutItem);
-
- auto* pThis = static_cast<const CXFA_ContentLayoutItem*>(this);
- CFX_PointF sPos = pThis->m_sPos;
- CFX_SizeF sSize = pThis->m_sSize;
- if (bRelative)
- return CFX_RectF(sPos, sSize);
-
- for (CXFA_LayoutItem* pLayoutItem = pThis->m_pParent; pLayoutItem;
- pLayoutItem = pLayoutItem->m_pParent) {
- if (CXFA_ContentLayoutItem* pContent = pLayoutItem->AsContentLayoutItem()) {
- sPos += pContent->m_sPos;
- CXFA_Margin* pMarginNode =
- pLayoutItem->m_pFormNode->GetFirstChildByClass<CXFA_Margin>(
- XFA_Element::Margin);
- if (pMarginNode) {
- sPos += CFX_PointF(pMarginNode->JSObject()
- ->GetMeasure(XFA_Attribute::LeftInset)
- .ToUnit(XFA_Unit::Pt),
- pMarginNode->JSObject()
- ->GetMeasure(XFA_Attribute::TopInset)
- .ToUnit(XFA_Unit::Pt));
- }
- continue;
- }
-
- if (pLayoutItem->m_pFormNode->GetElementType() ==
- XFA_Element::ContentArea) {
- sPos += CFX_PointF(pLayoutItem->m_pFormNode->JSObject()
- ->GetMeasure(XFA_Attribute::X)
- .ToUnit(XFA_Unit::Pt),
- pLayoutItem->m_pFormNode->JSObject()
- ->GetMeasure(XFA_Attribute::Y)
- .ToUnit(XFA_Unit::Pt));
- break;
- }
- if (pLayoutItem->m_pFormNode->GetElementType() == XFA_Element::PageArea)
- break;
- }
- return CFX_RectF(sPos, sSize);
-}
-
-CXFA_LayoutItem* CXFA_LayoutItem::GetFirst() {
- ASSERT(m_bIsContentLayoutItem);
- CXFA_ContentLayoutItem* pCurNode = static_cast<CXFA_ContentLayoutItem*>(this);
- while (pCurNode->m_pPrev)
- pCurNode = pCurNode->m_pPrev;
-
- return pCurNode;
-}
-
-const CXFA_LayoutItem* CXFA_LayoutItem::GetLast() const {
- ASSERT(m_bIsContentLayoutItem);
- const CXFA_ContentLayoutItem* pCurNode =
- static_cast<const CXFA_ContentLayoutItem*>(this);
- while (pCurNode->m_pNext)
- pCurNode = pCurNode->m_pNext;
-
- return pCurNode;
-}
-
-CXFA_LayoutItem* CXFA_LayoutItem::GetPrev() const {
- ASSERT(m_bIsContentLayoutItem);
-
- return static_cast<const CXFA_ContentLayoutItem*>(this)->m_pPrev;
-}
-
-CXFA_LayoutItem* CXFA_LayoutItem::GetNext() const {
- ASSERT(m_bIsContentLayoutItem);
- return static_cast<const CXFA_ContentLayoutItem*>(this)->m_pNext;
-}
-
-int32_t CXFA_LayoutItem::GetIndex() const {
- ASSERT(m_bIsContentLayoutItem);
- int32_t iIndex = 0;
- const CXFA_ContentLayoutItem* pCurNode =
- static_cast<const CXFA_ContentLayoutItem*>(this);
- while (pCurNode->m_pPrev) {
- pCurNode = pCurNode->m_pPrev;
- ++iIndex;
- }
- return iIndex;
-}
-
-int32_t CXFA_LayoutItem::GetCount() const {
- ASSERT(m_bIsContentLayoutItem);
-
- int32_t iCount = GetIndex() + 1;
- const CXFA_ContentLayoutItem* pCurNode =
- static_cast<const CXFA_ContentLayoutItem*>(this);
- while (pCurNode->m_pNext) {
- pCurNode = pCurNode->m_pNext;
- iCount++;
- }
- return iCount;
-}
-
void CXFA_LayoutItem::AddChild(CXFA_LayoutItem* pChildItem) {
if (pChildItem->m_pParent)
pChildItem->m_pParent->RemoveChild(pChildItem);