summaryrefslogtreecommitdiff
path: root/xfa/src/fxfa
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-05-13 18:24:09 -0700
committerJUN FANG <jun_fang@foxitsoftware.com>2015-05-13 18:24:09 -0700
commitc9855ba82bc52b87cb0882e7b732a1bdceca34ed (patch)
treebe802271649414520fea406d8711bebb1d97d801 /xfa/src/fxfa
parent08e021c81a41c5394a045b8e71b08bf0fb62634c (diff)
downloadpdfium-c9855ba82bc52b87cb0882e7b732a1bdceca34ed.tar.xz
Code alignment in issue 471991
BUG=471991 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1126273004
Diffstat (limited to 'xfa/src/fxfa')
-rw-r--r--xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h184
1 files changed, 121 insertions, 63 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h
index eaa1a9b15c..68bd59910e 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h
+++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h
@@ -30,6 +30,7 @@ enum XFA_ItemLayoutProcessorStages {
XFA_ItemLayoutProcessorStages_BookendTrailer,
XFA_ItemLayoutProcessorStages_Done,
};
+
class CXFA_LayoutContext
{
public:
@@ -44,89 +45,146 @@ public:
{
m_pOverflowProcessor = NULL;
}
- CFX_ArrayTemplate<FX_FLOAT>* m_prgSpecifiedColumnWidths;
- FX_FLOAT m_fCurColumnWidth;
- FX_BOOL m_bCurColumnWidthAvaiable;
- CXFA_ItemLayoutProcessor* m_pOverflowProcessor;
- CXFA_Node* m_pOverflowNode;
+ CFX_ArrayTemplate<FX_FLOAT>* m_prgSpecifiedColumnWidths;
+ FX_FLOAT m_fCurColumnWidth;
+ FX_BOOL m_bCurColumnWidthAvaiable;
+ CXFA_ItemLayoutProcessor* m_pOverflowProcessor;
+ CXFA_Node* m_pOverflowNode;
};
+
class CXFA_ItemLayoutProcessor
{
public:
CXFA_ItemLayoutProcessor(CXFA_Node *pNode, CXFA_LayoutPageMgr* pPageMgr);
- XFA_ItemLayoutProcessorResult DoLayout(FX_BOOL bUseBreakControl, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight = XFA_LAYOUT_FLOAT_MAX, CXFA_LayoutContext* pContext = NULL);
- void GetCurrentComponentPos(FX_FLOAT& fAbsoluteX, FX_FLOAT& fAbsoluteY);
- void GetCurrentComponentSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight);
- void SetCurrentComponentPos(FX_FLOAT fAbsoluteX, FX_FLOAT fAbsoluteY);
- void SetCurrentComponentSize(FX_FLOAT fWidth, FX_FLOAT fHeight);
- inline CXFA_Node* GetFormNode()
+
+ XFA_ItemLayoutProcessorResult DoLayout(FX_BOOL bUseBreakControl,
+ FX_FLOAT fHeightLimit,
+ FX_FLOAT fRealHeight = XFA_LAYOUT_FLOAT_MAX,
+ CXFA_LayoutContext* pContext = NULL);
+
+ void GetCurrentComponentPos(FX_FLOAT& fAbsoluteX,
+ FX_FLOAT& fAbsoluteY);
+
+ void GetCurrentComponentSize(FX_FLOAT& fWidth,
+ FX_FLOAT& fHeight);
+
+ void SetCurrentComponentPos(FX_FLOAT fAbsoluteX,
+ FX_FLOAT fAbsoluteY);
+
+ void SetCurrentComponentSize(FX_FLOAT fWidth,
+ FX_FLOAT fHeight);
+ inline CXFA_Node* GetFormNode()
{
return m_pFormNode;
}
- inline FX_BOOL HasLayoutItem()
+ inline FX_BOOL HasLayoutItem()
{
return m_pLayoutItem != NULL;
}
- CXFA_ContentLayoutItemImpl* ExtractLayoutItem();
-
- static FX_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 FX_BOOL FindLayoutItemSplitPos(CXFA_ContentLayoutItemImpl* pLayoutItem, FX_FLOAT fCurVerticalOffset, FX_FLOAT& fProposedSplitPos, FX_BOOL& bAppChange, FX_BOOL bCalculateMargin = TRUE);
- FX_FLOAT FindSplitPos(FX_FLOAT fProposedSplitPos);
- void SplitLayoutItem(CXFA_ContentLayoutItemImpl* pLayoutItem, CXFA_ContentLayoutItemImpl* pSecondParent, FX_FLOAT fSplitPos);
- void SplitLayoutItem(FX_FLOAT fSplitPos);
- FX_BOOL JudgePutNextPage(CXFA_ContentLayoutItemImpl* pParentLayoutItem, FX_FLOAT fChildHeight, CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> &pKeepItems);
- FX_BOOL ProcessKeepForSplite(CXFA_ItemLayoutProcessor* pParentProcessor, CXFA_ItemLayoutProcessor* pChildProcessor, XFA_ItemLayoutProcessorResult eRetValue,
- CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*>& rgCurLineLayoutItem, FX_FLOAT& fContentCurRowAvailWidth,
- FX_FLOAT& fContentCurRowHeight, FX_FLOAT& fContentCurRowY, FX_BOOL& bAddedItemInRow, FX_BOOL& bForceEndPage, XFA_ItemLayoutProcessorResult& result);
- FX_FLOAT InsertKeepLayoutItems();
- void DoLayoutPageArea(CXFA_ContainerLayoutItemImpl* pPageAreaLayoutItem);
- FX_BOOL CalculateRowChildPosition(CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*>(&rgCurLineLayoutItems)[3], XFA_ATTRIBUTEENUM eFlowStrategy, FX_BOOL bContainerHeightAutoSize,
- FX_BOOL bContainerWidthAutoSize, FX_FLOAT& fContentCalculatedWidth, FX_FLOAT& fContentCalculatedHeight, FX_FLOAT& fContentCurRowY,
- FX_FLOAT fContentCurRowHeight, FX_FLOAT fContentWidthLimit, FX_BOOL bRootForceTb = FALSE);
- void ProcessUnUseOverFlow(CXFA_Node* pLeaderNode, CXFA_Node* pTrailerNode, CXFA_ContentLayoutItemImpl* pTrailerItem, CXFA_Node* pFormNode);
- void ProcessUnUseBinds(CXFA_Node* pFormNode);
- FX_BOOL IsAddNewRowForTrailer(CXFA_ContentLayoutItemImpl* pTrailerItem);
- FX_BOOL JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormNode);
+ CXFA_ContentLayoutItemImpl* ExtractLayoutItem();
+
+ static FX_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 FX_BOOL FindLayoutItemSplitPos(CXFA_ContentLayoutItemImpl* pLayoutItem,
+ FX_FLOAT fCurVerticalOffset, FX_FLOAT& fProposedSplitPos,
+ FX_BOOL& bAppChange, FX_BOOL bCalculateMargin = TRUE);
+ FX_FLOAT FindSplitPos(FX_FLOAT fProposedSplitPos);
+ void SplitLayoutItem(CXFA_ContentLayoutItemImpl* pLayoutItem,
+ CXFA_ContentLayoutItemImpl* pSecondParent,
+ FX_FLOAT fSplitPos);
+ void SplitLayoutItem(FX_FLOAT fSplitPos);
+ FX_BOOL JudgePutNextPage(CXFA_ContentLayoutItemImpl* pParentLayoutItem,
+ FX_FLOAT fChildHeight,
+ CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> &pKeepItems);
+ FX_BOOL ProcessKeepForSplite(CXFA_ItemLayoutProcessor* pParentProcessor,
+ CXFA_ItemLayoutProcessor* pChildProcessor,
+ XFA_ItemLayoutProcessorResult eRetValue,
+ CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*>& rgCurLineLayoutItem,
+ FX_FLOAT& fContentCurRowAvailWidth,
+ FX_FLOAT& fContentCurRowHeight,
+ FX_FLOAT& fContentCurRowY,
+ FX_BOOL& bAddedItemInRow,
+ FX_BOOL& bForceEndPage,
+ XFA_ItemLayoutProcessorResult& result);
+ FX_FLOAT InsertKeepLayoutItems();
+ void DoLayoutPageArea(CXFA_ContainerLayoutItemImpl* pPageAreaLayoutItem);
+ FX_BOOL CalculateRowChildPosition(CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*>(&rgCurLineLayoutItems)[3],
+ XFA_ATTRIBUTEENUM eFlowStrategy,
+ FX_BOOL bContainerHeightAutoSize,
+ FX_BOOL bContainerWidthAutoSize,
+ FX_FLOAT& fContentCalculatedWidth,
+ FX_FLOAT& fContentCalculatedHeight,
+ FX_FLOAT& fContentCurRowY,
+ FX_FLOAT fContentCurRowHeight,
+ FX_FLOAT fContentWidthLimit,
+ FX_BOOL bRootForceTb = FALSE);
+
+ void ProcessUnUseOverFlow(CXFA_Node* pLeaderNode,
+ CXFA_Node* pTrailerNode,
+ CXFA_ContentLayoutItemImpl* pTrailerItem,
+ CXFA_Node* pFormNode);
+ void ProcessUnUseBinds(CXFA_Node* pFormNode);
+ FX_BOOL IsAddNewRowForTrailer(CXFA_ContentLayoutItemImpl* pTrailerItem);
+ FX_BOOL JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormNode);
CXFA_ContentLayoutItemImpl* CreateContentLayoutItem(CXFA_Node* pFormNode);
protected:
- void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext = NULL);
+
+ void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext = NULL);
void DoLayoutTableContainer(CXFA_Node* pLayoutNode);
- XFA_ItemLayoutProcessorResult DoLayoutFlowedContainer(FX_BOOL bUseBreakControl, XFA_ATTRIBUTEENUM eFlowStrategy, FX_FLOAT fHeightLimit, FX_FLOAT fRealHeight, CXFA_LayoutContext* pContext = NULL, FX_BOOL bRootForceTb = FALSE);
+ XFA_ItemLayoutProcessorResult DoLayoutFlowedContainer(FX_BOOL bUseBreakControl,
+ XFA_ATTRIBUTEENUM eFlowStrategy,
+ FX_FLOAT fHeightLimit,
+ FX_FLOAT fRealHeight,
+ CXFA_LayoutContext* pContext = NULL,
+ FX_BOOL bRootForceTb = FALSE);
void DoLayoutField();
- void XFA_ItemLayoutProcessor_GotoNextContainerNode(CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node* pParentContainer, FX_BOOL bUsePageBreak);
- FX_BOOL ProcessKeepNodesForCheckNext(CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node*& pNextContainer, FX_BOOL& bLastKeepNode);
- FX_BOOL ProcessKeepNodesForBreakBefore(CXFA_Node*& pCurActionNode, XFA_ItemLayoutProcessorStages& nCurStage, CXFA_Node* pContainerNode);
- CXFA_Node* GetSubformSetParent(CXFA_Node* pSubformSet);
+ void XFA_ItemLayoutProcessor_GotoNextContainerNode(CXFA_Node*& pCurActionNode,
+ XFA_ItemLayoutProcessorStages& nCurStage,
+ CXFA_Node* pParentContainer,
+ FX_BOOL bUsePageBreak);
+
+ FX_BOOL ProcessKeepNodesForCheckNext(CXFA_Node*& pCurActionNode,
+ XFA_ItemLayoutProcessorStages& nCurStage,
+ CXFA_Node*& pNextContainer,
+ FX_BOOL& bLastKeepNode);
+
+ FX_BOOL ProcessKeepNodesForBreakBefore(CXFA_Node*& pCurActionNode,
+ XFA_ItemLayoutProcessorStages& nCurStage,
+ CXFA_Node* pContainerNode);
+
+ CXFA_Node* GetSubformSetParent(CXFA_Node* pSubformSet);
public:
- FX_BOOL m_bKeepBreakFinish;
- FX_BOOL m_bIsProcessKeep;
- CXFA_Node* m_pKeepHeadNode;
- CXFA_Node* m_pKeepTailNode;
- CXFA_Node* m_pFormNode;
- CXFA_ContentLayoutItemImpl* m_pLayoutItem;
+ FX_BOOL m_bKeepBreakFinish;
+ FX_BOOL m_bIsProcessKeep;
+ CXFA_Node* m_pKeepHeadNode;
+ CXFA_Node* m_pKeepTailNode;
+ CXFA_Node* m_pFormNode;
+ CXFA_ContentLayoutItemImpl* m_pLayoutItem;
#ifdef _XFA_LAYOUTITEM_ProcessCACHE_
- CXFA_ContentLayoutItemImpl* m_pOldLayoutItem;
+ CXFA_ContentLayoutItemImpl* m_pOldLayoutItem;
#else
- CXFA_LayoutPageMgr* m_pPageMgrCreateItem;
+ CXFA_LayoutPageMgr* m_pPageMgrCreateItem;
#endif
- CXFA_Node* m_pCurChildNode;
- CXFA_ItemLayoutProcessor* m_pCurChildPreprocessor;
- XFA_ItemLayoutProcessorStages m_nCurChildNodeStage;
- FX_FLOAT m_fUsedSize;
- CXFA_LayoutPageMgr* m_pPageMgr;
- CFX_PtrList m_rgPendingNodes;
- FX_BOOL m_bBreakPending;
- CFX_ArrayTemplate<FX_FLOAT> m_rgSpecifiedColumnWidths;
- CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> m_arrayKeepItems;
- CFX_MapPtrToPtr m_PendingNodesCount;
- FX_FLOAT m_fLastRowWidth;
- FX_FLOAT m_fLastRowY;
- FX_FLOAT m_fWidthLimite;
- FX_BOOL m_bUseInheriated;
- XFA_ItemLayoutProcessorResult m_ePreProcessRs;
- FX_BOOL m_bHasAvailHeight;
+ CXFA_Node* m_pCurChildNode;
+ CXFA_ItemLayoutProcessor* m_pCurChildPreprocessor;
+ XFA_ItemLayoutProcessorStages m_nCurChildNodeStage;
+ FX_FLOAT m_fUsedSize;
+ CXFA_LayoutPageMgr* m_pPageMgr;
+ CFX_PtrList m_rgPendingNodes;
+ FX_BOOL m_bBreakPending;
+ CFX_ArrayTemplate<FX_FLOAT> m_rgSpecifiedColumnWidths;
+ CFX_ArrayTemplate<CXFA_ContentLayoutItemImpl*> m_arrayKeepItems;
+ CFX_MapPtrToPtr m_PendingNodesCount;
+ FX_FLOAT m_fLastRowWidth;
+ FX_FLOAT m_fLastRowY;
+ FX_FLOAT m_fWidthLimite;
+ FX_BOOL m_bUseInheriated;
+ XFA_ItemLayoutProcessorResult m_ePreProcessRs;
+ FX_BOOL m_bHasAvailHeight;
};
FX_BOOL XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode);
#endif