From 11d33e18661c9492dda7ba9cf9fe33e38637858a Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 31 Jan 2018 20:23:37 +0000 Subject: Move initializers to header for CXFA_ItemLayoutProcess This CL moves the static construction values from the cpp to the h file. Change-Id: I04ff6513be2287582b90453390e5bd44c5b47d68 Reviewed-on: https://pdfium-review.googlesource.com/24870 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp | 20 +--------------- xfa/fxfa/parser/cxfa_itemlayoutprocessor.h | 36 +++++++++++++++------------- 2 files changed, 20 insertions(+), 36 deletions(-) (limited to 'xfa') diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp index b4bea75fb2..e01f6ee037 100644 --- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp @@ -622,25 +622,7 @@ CFX_PointF CalculatePositionedContainerPos(CXFA_Node* pNode, CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode, CXFA_LayoutPageMgr* pPageMgr) - : m_pFormNode(pNode), - m_pLayoutItem(nullptr), - m_pCurChildNode(XFA_LAYOUT_INVALIDNODE), - m_fUsedSize(0), - m_pPageMgr(pPageMgr), - m_bBreakPending(true), - m_fLastRowWidth(0), - m_fLastRowY(0), - m_bUseInheriated(false), - m_ePreProcessRs(XFA_ItemLayoutProcessorResult::Done), - m_bKeepBreakFinish(false), - m_bIsProcessKeep(false), - m_pKeepHeadNode(nullptr), - m_pKeepTailNode(nullptr), - m_pOldLayoutItem(nullptr), - m_pCurChildPreprocessor(nullptr), - m_nCurChildNodeStage(XFA_ItemLayoutProcessorStages::None), - m_fWidthLimite(0), - m_bHasAvailHeight(true) { + : m_pFormNode(pNode), m_pPageMgr(pPageMgr) { ASSERT(m_pFormNode && (m_pFormNode->IsContainerNode() || m_pFormNode->GetElementType() == XFA_Element::Form)); m_pOldLayoutItem = static_cast( diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h index fdca14285f..12709bad01 100644 --- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h +++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.h @@ -164,28 +164,30 @@ class CXFA_ItemLayoutProcessor { bool bNewRow); CXFA_Node* m_pFormNode; - CXFA_ContentLayoutItem* m_pLayoutItem; - CXFA_Node* m_pCurChildNode; - float m_fUsedSize; + CXFA_ContentLayoutItem* m_pLayoutItem = nullptr; + CXFA_Node* m_pCurChildNode = XFA_LAYOUT_INVALIDNODE; + float m_fUsedSize = 0; CXFA_LayoutPageMgr* m_pPageMgr; std::list m_PendingNodes; - bool m_bBreakPending; + bool m_bBreakPending = true; std::vector m_rgSpecifiedColumnWidths; std::vector m_arrayKeepItems; - float m_fLastRowWidth; - float m_fLastRowY; - bool m_bUseInheriated; - XFA_ItemLayoutProcessorResult m_ePreProcessRs; - bool m_bKeepBreakFinish; - bool m_bIsProcessKeep; - CXFA_Node* m_pKeepHeadNode; - CXFA_Node* m_pKeepTailNode; - CXFA_ContentLayoutItem* m_pOldLayoutItem; - CXFA_ItemLayoutProcessor* m_pCurChildPreprocessor; - XFA_ItemLayoutProcessorStages m_nCurChildNodeStage; + float m_fLastRowWidth = 0; + float m_fLastRowY = 0; + bool m_bUseInheriated = false; + XFA_ItemLayoutProcessorResult m_ePreProcessRs = + XFA_ItemLayoutProcessorResult::Done; + bool m_bKeepBreakFinish = false; + bool m_bIsProcessKeep = false; + CXFA_Node* m_pKeepHeadNode = nullptr; + CXFA_Node* m_pKeepTailNode = nullptr; + CXFA_ContentLayoutItem* m_pOldLayoutItem = nullptr; + CXFA_ItemLayoutProcessor* m_pCurChildPreprocessor = nullptr; + XFA_ItemLayoutProcessorStages m_nCurChildNodeStage = + XFA_ItemLayoutProcessorStages::None; std::map m_PendingNodesCount; - float m_fWidthLimite; - bool m_bHasAvailHeight; + float m_fWidthLimite = 0; + bool m_bHasAvailHeight = true; }; #endif // XFA_FXFA_PARSER_CXFA_ITEMLAYOUTPROCESSOR_H_ -- cgit v1.2.3