From e5f4f22e4c67f40123bca91c2213223cc5a12ebd Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Sat, 4 Feb 2017 11:12:46 -0500 Subject: Cleanup xfa layout code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Split XFA layout code into correct files, move static methods into anonymous namespace blocks. Cleanup formatting where possible. Change-Id: Ia342d7db42f947db02a52aa86bfa69e4fda916fd Reviewed-on: https://pdfium-review.googlesource.com/2512 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fxfa/parser/xfa_layout_itemlayout.h | 41 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'xfa/fxfa/parser/xfa_layout_itemlayout.h') diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.h b/xfa/fxfa/parser/xfa_layout_itemlayout.h index 0d114a4d5c..b18706b521 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.h +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.h @@ -60,8 +60,24 @@ class CXFA_LayoutContext { CXFA_Node* m_pOverflowNode; }; +bool XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode); + class CXFA_ItemLayoutProcessor { public: + static bool IncrementRelayoutNode(CXFA_LayoutProcessor* pLayoutProcessor, + CXFA_Node* pNode, + CXFA_Node* pParentNode); + static void CalculatePositionedContainerPos(CXFA_Node* pNode, + FX_FLOAT fWidth, + FX_FLOAT fHeight, + FX_FLOAT& fAbsoluteX, + FX_FLOAT& fAbsoluteY); + static bool FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem, + FX_FLOAT fCurVerticalOffset, + FX_FLOAT& fProposedSplitPos, + bool& bAppChange, + bool bCalculateMargin); + CXFA_ItemLayoutProcessor(CXFA_Node* pNode, CXFA_LayoutPageMgr* pPageMgr); ~CXFA_ItemLayoutProcessor(); @@ -82,19 +98,6 @@ class CXFA_ItemLayoutProcessor { bool HasLayoutItem() { return !!m_pLayoutItem; } CXFA_ContentLayoutItem* ExtractLayoutItem(); - static bool IncrementRelayoutNode(CXFA_LayoutProcessor* pLayoutProcessor, - CXFA_Node* pNode, - CXFA_Node* pParentNode); - static void CalculatePositionedContainerPos(CXFA_Node* pNode, - FX_FLOAT fWidth, - FX_FLOAT fHeight, - FX_FLOAT& fAbsoluteX, - FX_FLOAT& fAbsoluteY); - static bool FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem, - FX_FLOAT fCurVerticalOffset, - FX_FLOAT& fProposedSplitPos, - bool& bAppChange, - bool bCalculateMargin = true); FX_FLOAT FindSplitPos(FX_FLOAT fProposedSplitPos); void SplitLayoutItem(CXFA_ContentLayoutItem* pLayoutItem, CXFA_ContentLayoutItem* pSecondParent, @@ -137,7 +140,7 @@ class CXFA_ItemLayoutProcessor { bool JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormNode); CXFA_ContentLayoutItem* CreateContentLayoutItem(CXFA_Node* pFormNode); - protected: + private: void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext = nullptr); void DoLayoutTableContainer(CXFA_Node* pLayoutNode); XFA_ItemLayoutProcessorResult DoLayoutFlowedContainer( @@ -148,11 +151,10 @@ class CXFA_ItemLayoutProcessor { CXFA_LayoutContext* pContext = nullptr, bool bRootForceTb = false); void DoLayoutField(); - void XFA_ItemLayoutProcessor_GotoNextContainerNode( - CXFA_Node*& pCurActionNode, - XFA_ItemLayoutProcessorStages& nCurStage, - CXFA_Node* pParentContainer, - bool bUsePageBreak); + void GotoNextContainerNode(CXFA_Node*& pCurActionNode, + XFA_ItemLayoutProcessorStages& nCurStage, + CXFA_Node* pParentContainer, + bool bUsePageBreak); bool ProcessKeepNodesForCheckNext(CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, @@ -190,6 +192,5 @@ class CXFA_ItemLayoutProcessor { XFA_ItemLayoutProcessorResult m_ePreProcessRs; bool m_bHasAvailHeight; }; -bool XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode); #endif // XFA_FXFA_PARSER_XFA_LAYOUT_ITEMLAYOUT_H_ -- cgit v1.2.3