summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_layout_itemlayout.h
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-02-04 11:12:46 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-06 16:52:23 +0000
commite5f4f22e4c67f40123bca91c2213223cc5a12ebd (patch)
tree6edca38b1c3aedeee265917c7b984f5256b3e6f2 /xfa/fxfa/parser/xfa_layout_itemlayout.h
parentaaf0bdc5bf420d08dfcbb049c4511c55eec0dd6c (diff)
downloadpdfium-e5f4f22e4c67f40123bca91c2213223cc5a12ebd.tar.xz
Cleanup xfa layout code
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 <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_layout_itemlayout.h')
-rw-r--r--xfa/fxfa/parser/xfa_layout_itemlayout.h41
1 files changed, 21 insertions, 20 deletions
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_