diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-20 20:28:23 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-20 20:28:23 +0000 |
commit | e74ae8c02f6b5efa37ba11bcad6b714046cfc7b0 (patch) | |
tree | 1c5353b26b58732e5bda616ba5d9fc8f414a7037 /xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp | |
parent | 68c77592f25f9173d2166fa01fb34b4155f4cfcb (diff) | |
download | pdfium-e74ae8c02f6b5efa37ba11bcad6b714046cfc7b0.tar.xz |
Convert calc data and layout item to store in CJX_Node
This CL moves the XFA_CalcData and XFA_LayoutItem out of the map'd data
for a CJX_Node and stores directly on the node. This makes the object a
bit bigger but makes the code a lot more understandable.
Change-Id: I8897a52d61d37595181960c23928984aa5d67efc
Reviewed-on: https://pdfium-review.googlesource.com/18590
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp index bf63a2a56c..ec610293ce 100644 --- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp @@ -612,8 +612,7 @@ void DeleteLayoutGeneratedNode(CXFA_Node* pGenerateNode) { for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; pNode = sIterator.MoveToNext()) { CXFA_ContentLayoutItem* pCurLayoutItem = - (CXFA_ContentLayoutItem*)pNode->JSNode()->GetUserData(XFA_LAYOUTITEMKEY, - false); + static_cast<CXFA_ContentLayoutItem*>(pNode->JSNode()->GetLayoutItem()); CXFA_ContentLayoutItem* pNextLayoutItem = nullptr; while (pCurLayoutItem) { pNextLayoutItem = pCurLayoutItem->m_pNext; @@ -1156,9 +1155,8 @@ CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode, m_bHasAvailHeight(true) { ASSERT(m_pFormNode && (m_pFormNode->IsContainerNode() || m_pFormNode->GetElementType() == XFA_Element::Form)); - m_pOldLayoutItem = - (CXFA_ContentLayoutItem*)m_pFormNode->JSNode()->GetUserData( - XFA_LAYOUTITEMKEY, false); + m_pOldLayoutItem = static_cast<CXFA_ContentLayoutItem*>( + m_pFormNode->JSNode()->GetLayoutItem()); } CXFA_ItemLayoutProcessor::~CXFA_ItemLayoutProcessor() {} @@ -1178,8 +1176,8 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem( ->GetNotify() ->OnCreateLayoutItem(pFormNode); CXFA_ContentLayoutItem* pPrevLayoutItem = - (CXFA_ContentLayoutItem*)pFormNode->JSNode()->GetUserData( - XFA_LAYOUTITEMKEY, false); + static_cast<CXFA_ContentLayoutItem*>( + pFormNode->JSNode()->GetLayoutItem()); if (pPrevLayoutItem) { while (pPrevLayoutItem->m_pNext) pPrevLayoutItem = pPrevLayoutItem->m_pNext; @@ -1187,7 +1185,7 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem( pPrevLayoutItem->m_pNext = pLayoutItem; pLayoutItem->m_pPrev = pPrevLayoutItem; } else { - pFormNode->JSNode()->SetUserData(XFA_LAYOUTITEMKEY, pLayoutItem, nullptr); + pFormNode->JSNode()->SetLayoutItem(pLayoutItem); } return pLayoutItem; } |