diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-07 09:04:28 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-07 14:33:17 +0000 |
commit | c222907f453e8a0e6376a86f89354eedb8285854 (patch) | |
tree | 8ac6942b7fe65f7eb6dbc951a6a1f77aa9e18afc /xfa/fxfa/parser/xfa_layout_itemlayout.h | |
parent | 76da8841aef9a60c1c65c646a9f943c25861bc33 (diff) | |
download | pdfium-c222907f453e8a0e6376a86f89354eedb8285854.tar.xz |
Cleanup out params in XFA layout code.
This CL converts some of the out parameters in the XFA layout code to pointers
instead of references.
Change-Id: I6246b91b975e7bc08f8cfb040de9dfdc3c3bedee
Reviewed-on: https://pdfium-review.googlesource.com/2531
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_layout_itemlayout.h')
-rw-r--r-- | xfa/fxfa/parser/xfa_layout_itemlayout.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.h b/xfa/fxfa/parser/xfa_layout_itemlayout.h index b7b35122df..d411bf0e9f 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.h +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.h @@ -11,8 +11,11 @@ #include <list> #include <map> +#include <tuple> +#include <vector> #include "core/fxcrt/fx_basic.h" +#include "core/fxcrt/fx_coordinates.h" #include "xfa/fxfa/fxfa_basic.h" #define XFA_LAYOUT_INVALIDNODE ((CXFA_Node*)(intptr_t)-1) @@ -77,26 +80,25 @@ class CXFA_ItemLayoutProcessor { CXFA_LayoutContext* pContext); void DoLayoutPageArea(CXFA_ContainerLayoutItem* pPageAreaLayoutItem); - void GetCurrentComponentSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight); - + CFX_SizeF GetCurrentComponentSize(); CXFA_Node* GetFormNode() { return m_pFormNode; } - bool HasLayoutItem() { return !!m_pLayoutItem; } + bool HasLayoutItem() const { return !!m_pLayoutItem; } CXFA_ContentLayoutItem* ExtractLayoutItem(); void SplitLayoutItem(FX_FLOAT fSplitPos); FX_FLOAT FindSplitPos(FX_FLOAT fProposedSplitPos); - bool ProcessKeepForSplite( + bool ProcessKeepForSplit( CXFA_ItemLayoutProcessor* pParentProcessor, CXFA_ItemLayoutProcessor* pChildProcessor, XFA_ItemLayoutProcessorResult eRetValue, - CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& rgCurLineLayoutItem, - FX_FLOAT& fContentCurRowAvailWidth, - FX_FLOAT& fContentCurRowHeight, - FX_FLOAT& fContentCurRowY, - bool& bAddedItemInRow, - bool& bForceEndPage, - XFA_ItemLayoutProcessorResult& result); + CFX_ArrayTemplate<CXFA_ContentLayoutItem*>* rgCurLineLayoutItem, + FX_FLOAT* fContentCurRowAvailWidth, + FX_FLOAT* fContentCurRowHeight, + FX_FLOAT* fContentCurRowY, + bool* bAddedItemInRow, + bool* bForceEndPage, + XFA_ItemLayoutProcessorResult* result); void ProcessUnUseOverFlow(CXFA_Node* pLeaderNode, CXFA_Node* pTrailerNode, CXFA_ContentLayoutItem* pTrailerItem, @@ -114,15 +116,15 @@ class CXFA_ItemLayoutProcessor { std::list<CXFA_Node*> m_PendingNodes; bool m_bBreakPending; CFX_ArrayTemplate<FX_FLOAT> m_rgSpecifiedColumnWidths; - CFX_ArrayTemplate<CXFA_ContentLayoutItem*> m_arrayKeepItems; + std::vector<CXFA_ContentLayoutItem*> m_arrayKeepItems; FX_FLOAT m_fLastRowWidth; FX_FLOAT m_fLastRowY; bool m_bUseInheriated; XFA_ItemLayoutProcessorResult m_ePreProcessRs; private: - void SetCurrentComponentPos(FX_FLOAT fAbsoluteX, FX_FLOAT fAbsoluteY); - void SetCurrentComponentSize(FX_FLOAT fWidth, FX_FLOAT fHeight); + void SetCurrentComponentPos(const CFX_PointF& pos); + void SetCurrentComponentSize(const CFX_SizeF& size); void SplitLayoutItem(CXFA_ContentLayoutItem* pLayoutItem, CXFA_ContentLayoutItem* pSecondParent, @@ -133,16 +135,16 @@ class CXFA_ItemLayoutProcessor { XFA_ATTRIBUTEENUM eFlowStrategy, bool bContainerHeightAutoSize, bool bContainerWidthAutoSize, - FX_FLOAT& fContentCalculatedWidth, - FX_FLOAT& fContentCalculatedHeight, - FX_FLOAT& fContentCurRowY, + FX_FLOAT* fContentCalculatedWidth, + FX_FLOAT* fContentCalculatedHeight, + FX_FLOAT* fContentCurRowY, FX_FLOAT fContentCurRowHeight, FX_FLOAT fContentWidthLimit, bool bRootForceTb); void ProcessUnUseBinds(CXFA_Node* pFormNode); bool JudgePutNextPage(CXFA_ContentLayoutItem* pParentLayoutItem, FX_FLOAT fChildHeight, - CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems); + std::vector<CXFA_ContentLayoutItem*>* pKeepItems); void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext); void DoLayoutTableContainer(CXFA_Node* pLayoutNode); |