Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Unified Diff: xfa/fxfa/parser/xfa_layout_itemlayout.cpp

Issue 2031873003: Get rid of NULLs in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_fpdfsdk
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/xfa_layout_itemlayout.h ('k') | xfa/fxfa/parser/xfa_layout_pagemgr_new.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_layout_itemlayout.cpp
diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
index 509bf630e94fb0498bc5d5a1fdfb65a509278189..e35e8c7c88fdaad2feca010bf7b1a7916fbc6a9a 100644
--- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
@@ -80,9 +80,9 @@ CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode,
CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem(
CXFA_Node* pFormNode) {
if (!pFormNode) {
- return NULL;
+ return nullptr;
}
- CXFA_ContentLayoutItem* pLayoutItem = NULL;
+ CXFA_ContentLayoutItem* pLayoutItem = nullptr;
if (m_pOldLayoutItem) {
pLayoutItem = m_pOldLayoutItem;
m_pOldLayoutItem = m_pOldLayoutItem->m_pNext;
@@ -204,18 +204,18 @@ static XFA_ATTRIBUTEENUM XFA_ItemLayoutProcessor_GetLayout(
return XFA_ATTRIBUTEENUM_Position;
}
static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) {
- if (pCurNode == NULL || !XFA_ItemLayoutProcessor_IsTakingSpace(pCurNode)) {
+ if (!pCurNode || !XFA_ItemLayoutProcessor_IsTakingSpace(pCurNode))
return FALSE;
- }
+
XFA_NODEITEM eItemType = XFA_NODEITEM_PrevSibling;
if (!bPreFind) {
eItemType = XFA_NODEITEM_NextSibling;
}
CXFA_Node* pPreContainer =
pCurNode->GetNodeItem(eItemType, XFA_OBJECTTYPE_ContainerNode);
- if (pPreContainer == NULL) {
+ if (!pPreContainer)
return FALSE;
- }
+
CXFA_Node* pKeep = pCurNode->GetFirstChildByClass(XFA_ELEMENT_Keep);
if (pKeep) {
XFA_ATTRIBUTEENUM ePrevious;
@@ -282,7 +282,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(
fCurBottomMargin =
pMarginNode->GetMeasure(XFA_ATTRIBUTE_BottomInset).ToUnit(XFA_UNIT_Pt);
}
- CXFA_ContentLayoutItem* pSecondLayoutItem = NULL;
+ CXFA_ContentLayoutItem* pSecondLayoutItem = nullptr;
if (m_pCurChildPreprocessor &&
m_pCurChildPreprocessor->m_pFormNode == pLayoutItem->m_pFormNode) {
pSecondLayoutItem = m_pCurChildPreprocessor->CreateContentLayoutItem(
@@ -316,14 +316,14 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(
}
CXFA_ContentLayoutItem* pChildren =
(CXFA_ContentLayoutItem*)pLayoutItem->m_pFirstChild;
- pLayoutItem->m_pFirstChild = NULL;
+ pLayoutItem->m_pFirstChild = nullptr;
FX_FLOAT lHeightForKeep = 0;
CFX_ArrayTemplate<CXFA_ContentLayoutItem*> keepLayoutItems;
FX_FLOAT fAddMarginHeight = 0;
- for (CXFA_ContentLayoutItem *pChildItem = pChildren, *pChildNext = NULL;
+ for (CXFA_ContentLayoutItem *pChildItem = pChildren, *pChildNext = nullptr;
pChildItem; pChildItem = pChildNext) {
pChildNext = (CXFA_ContentLayoutItem*)pChildItem->m_pNextSibling;
- pChildItem->m_pNextSibling = NULL;
+ pChildItem->m_pNextSibling = nullptr;
if (fSplitPos <= fCurTopMargin + pChildItem->m_sPos.y + fCurBottomMargin +
XFA_LAYOUT_FLOAT_PERCISION) {
if (!XFA_ExistContainerKeep(pChildItem->m_pFormNode, TRUE)) {
@@ -378,7 +378,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(
}
void CXFA_ItemLayoutProcessor::SplitLayoutItem(FX_FLOAT fSplitPos) {
ASSERT(m_pLayoutItem);
- SplitLayoutItem(m_pLayoutItem, NULL, fSplitPos);
+ SplitLayoutItem(m_pLayoutItem, nullptr, fSplitPos);
}
CXFA_ContainerLayoutItem* CXFA_LayoutItem::GetPage() const {
@@ -513,14 +513,14 @@ void CXFA_LayoutItem::AddChild(CXFA_LayoutItem* pChildItem) {
pChildItem->m_pParent->RemoveChild(pChildItem);
}
pChildItem->m_pParent = this;
- if (m_pFirstChild == NULL) {
- m_pFirstChild = pChildItem;
- } else {
+ if (m_pFirstChild) {
CXFA_LayoutItem* pExistingChildItem = m_pFirstChild;
while (pExistingChildItem->m_pNextSibling) {
pExistingChildItem = pExistingChildItem->m_pNextSibling;
}
pExistingChildItem->m_pNextSibling = pChildItem;
+ } else {
+ m_pFirstChild = pChildItem;
}
}
void CXFA_LayoutItem::AddHeadChild(CXFA_LayoutItem* pChildItem) {
@@ -528,12 +528,12 @@ void CXFA_LayoutItem::AddHeadChild(CXFA_LayoutItem* pChildItem) {
pChildItem->m_pParent->RemoveChild(pChildItem);
}
pChildItem->m_pParent = this;
- if (m_pFirstChild == NULL) {
- m_pFirstChild = pChildItem;
- } else {
+ if (m_pFirstChild) {
CXFA_LayoutItem* pExistingChildItem = m_pFirstChild;
m_pFirstChild = pChildItem;
m_pFirstChild->m_pNextSibling = pExistingChildItem;
+ } else {
+ m_pFirstChild = pChildItem;
}
}
void CXFA_LayoutItem::InsertChild(CXFA_LayoutItem* pBeforeItem,
@@ -542,7 +542,7 @@ void CXFA_LayoutItem::InsertChild(CXFA_LayoutItem* pBeforeItem,
return;
}
if (pChildItem->m_pParent) {
- pChildItem->m_pParent = NULL;
+ pChildItem->m_pParent = nullptr;
}
pChildItem->m_pParent = this;
CXFA_LayoutItem* pExistingChildItem = pBeforeItem->m_pNextSibling;
@@ -565,8 +565,8 @@ void CXFA_LayoutItem::RemoveChild(CXFA_LayoutItem* pChildItem) {
pExistingChildItem->m_pNextSibling = pChildItem->m_pNextSibling;
}
}
- pChildItem->m_pNextSibling = NULL;
- pChildItem->m_pParent = NULL;
+ pChildItem->m_pNextSibling = nullptr;
+ pChildItem->m_pParent = nullptr;
}
CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::ExtractLayoutItem() {
CXFA_ContentLayoutItem* pLayoutItem = m_pLayoutItem;
@@ -653,7 +653,7 @@ static void XFA_DeleteLayoutGeneratedNode(CXFA_Node* pGenerateNode) {
pNode = sIterator.MoveToNext()) {
CXFA_ContentLayoutItem* pCurLayoutItem =
(CXFA_ContentLayoutItem*)pNode->GetUserData(XFA_LAYOUTITEMKEY);
- CXFA_ContentLayoutItem* pNextLayoutItem = NULL;
+ CXFA_ContentLayoutItem* pNextLayoutItem = nullptr;
while (pCurLayoutItem) {
pNextLayoutItem = pCurLayoutItem->m_pNext;
pNotify->OnLayoutItemRemoving(pDocLayout, pCurLayoutItem);
@@ -819,7 +819,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
}
}
default:
- pCurActionNode = NULL;
+ pCurActionNode = nullptr;
nCurStage = XFA_ItemLayoutProcessorStages_Done;
}
}
@@ -849,8 +849,8 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext(
} else {
pNextContainer = m_pKeepHeadNode;
m_bKeepBreakFinish = TRUE;
- m_pKeepHeadNode = NULL;
- m_pKeepTailNode = NULL;
+ m_pKeepHeadNode = nullptr;
+ m_pKeepTailNode = nullptr;
m_bIsProcessKeep = FALSE;
}
} else {
@@ -869,8 +869,8 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForBreakBefore(
if (m_pKeepTailNode == pContainerNode) {
pCurActionNode = m_pKeepHeadNode;
m_bKeepBreakFinish = TRUE;
- m_pKeepHeadNode = NULL;
- m_pKeepTailNode = NULL;
+ m_pKeepHeadNode = nullptr;
+ m_pKeepTailNode = nullptr;
m_bIsProcessKeep = FALSE;
nCurStage = XFA_ItemLayoutProcessorStages_Container;
return TRUE;
@@ -1047,7 +1047,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
CXFA_Node* pCurChildNode = XFA_LAYOUT_INVALIDNODE;
XFA_ItemLayoutProcessorStages nCurChildNodeStage =
XFA_ItemLayoutProcessorStages_None;
- CXFA_LayoutItem* pBeforeItem = NULL;
+ CXFA_LayoutItem* pBeforeItem = nullptr;
for (XFA_ItemLayoutProcessor_GotoNextContainerNode(
pCurChildNode, nCurChildNodeStage, pFormNode, FALSE);
pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode(
@@ -1059,7 +1059,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
continue;
}
CXFA_ItemLayoutProcessor* pProcessor =
- new CXFA_ItemLayoutProcessor(pCurChildNode, NULL);
+ new CXFA_ItemLayoutProcessor(pCurChildNode, nullptr);
pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX);
if (!pProcessor->HasLayoutItem()) {
delete pProcessor;
@@ -1072,15 +1072,14 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
fAbsoluteY);
pProcessor->SetCurrentComponentPos(fAbsoluteX, fAbsoluteY);
CXFA_LayoutItem* pProcessItem = pProcessor->ExtractLayoutItem();
- if (pBeforeItem == NULL) {
- pPageAreaLayoutItem->AddHeadChild(pProcessItem);
- } else {
+ if (pBeforeItem)
pPageAreaLayoutItem->InsertChild(pBeforeItem, pProcessItem);
- }
+ else
+ pPageAreaLayoutItem->AddHeadChild(pProcessItem);
pBeforeItem = pProcessItem;
delete pProcessor;
}
- pBeforeItem = NULL;
+ pBeforeItem = nullptr;
CXFA_LayoutItem* pLayoutItem = pPageAreaLayoutItem->m_pFirstChild;
while (pLayoutItem) {
if (!pLayoutItem->IsContentLayoutItem() ||
@@ -1091,11 +1090,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
if (pLayoutItem->m_pFormNode->GetClassID() == XFA_ELEMENT_Draw) {
CXFA_LayoutItem* pNextLayoutItem = pLayoutItem->m_pNextSibling;
pPageAreaLayoutItem->RemoveChild(pLayoutItem);
- if (pBeforeItem == NULL) {
- pPageAreaLayoutItem->AddHeadChild(pLayoutItem);
- } else {
+ if (pBeforeItem)
pPageAreaLayoutItem->InsertChild(pBeforeItem, pLayoutItem);
- }
+ else
+ pPageAreaLayoutItem->AddHeadChild(pLayoutItem);
pBeforeItem = pLayoutItem;
pLayoutItem = pNextLayoutItem;
}
@@ -1379,9 +1377,9 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
if (m_pLayoutItem)
return;
- if (pLayoutNode == NULL) {
+ if (!pLayoutNode)
pLayoutNode = m_pFormNode;
- }
+
ASSERT(m_pCurChildNode == XFA_LAYOUT_INVALIDNODE);
m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
FX_FLOAT fContainerWidth = 0, fContainerHeight = 0;
@@ -1424,7 +1422,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
CXFA_LayoutContext layoutContext;
layoutContext.m_prgSpecifiedColumnWidths = &m_rgSpecifiedColumnWidths;
CXFA_LayoutContext* pLayoutContext =
- iSpecifiedColumnCount > 0 ? &layoutContext : NULL;
+ iSpecifiedColumnCount > 0 ? &layoutContext : nullptr;
if (m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) {
XFA_ItemLayoutProcessor_GotoNextContainerNode(
m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE);
@@ -1491,7 +1489,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
(CXFA_ContentLayoutItem*)rgRowItems[i]->m_pNextSibling;
if (rgRowItemsSpan[i] < 0 && XFA_ItemLayoutProcessor_IsTakingSpace(
rgRowItems[i]->m_pFormNode)) {
- pNewCell = NULL;
+ pNewCell = nullptr;
}
rgRowItems[i] = pNewCell;
rgRowItemsSpan[i] =
@@ -1815,9 +1813,9 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite(
FX_BOOL& bAddedItemInRow,
FX_BOOL& bForceEndPage,
XFA_ItemLayoutProcessorResult& result) {
- if (pParentProcessor == NULL || pChildProcessor == NULL) {
+ if (!pParentProcessor || !pChildProcessor)
return FALSE;
- }
+
if (pParentProcessor->m_pCurChildNode->GetIntact() !=
XFA_ATTRIBUTEENUM_None ||
!pChildProcessor->m_bHasAvailHeight) {
@@ -1855,9 +1853,9 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage(
CXFA_ContentLayoutItem* pParentLayoutItem,
FX_FLOAT fChildHeight,
CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems) {
- if (pParentLayoutItem == NULL) {
+ if (!pParentLayoutItem)
return FALSE;
- }
+
FX_FLOAT fItemsHeight = 0;
for (CXFA_ContentLayoutItem* pChildLayoutItem =
(CXFA_ContentLayoutItem*)pParentLayoutItem->m_pFirstChild;
@@ -1890,7 +1888,7 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseBinds(CXFA_Node* pFormNode) {
CXFA_Node* pBindNode = pNode->GetBindData();
if (pBindNode) {
pBindNode->RemoveBindItem(pNode);
- pNode->SetObject(XFA_ATTRIBUTE_BindingNode, NULL);
+ pNode->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr);
}
}
pNode->SetFlag(XFA_NODEFLAG_UnusedNode, true);
@@ -1903,9 +1901,9 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow(
CXFA_Node* pFormNode) {
ProcessUnUseBinds(pLeaderNode);
ProcessUnUseBinds(pTrailerNode);
- if (pFormNode == NULL) {
+ if (!pFormNode)
return;
- }
+
if (pFormNode->GetClassID() == XFA_ELEMENT_Overflow ||
pFormNode->GetClassID() == XFA_ELEMENT_Break) {
pFormNode = pFormNode->GetNodeItem(XFA_NODEITEM_Parent);
@@ -1938,7 +1936,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
FX_FLOAT& fContentCurRowHeight,
FX_BOOL& bAddedItemInRow,
FX_BOOL& bForceEndPage,
- CXFA_LayoutContext* pLayoutContext = NULL,
+ CXFA_LayoutContext* pLayoutContext = nullptr,
FX_BOOL bNewRow = FALSE) {
FX_BOOL bTakeSpace =
XFA_ItemLayoutProcessor_IsTakingSpace(pProcessor->m_pFormNode);
@@ -2005,14 +2003,14 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
(fChildWidth <= fContentCurRowAvailWidth + XFA_LAYOUT_FLOAT_PERCISION) ||
(fContentWidthLimit - fContentCurRowAvailWidth <=
XFA_LAYOUT_FLOAT_PERCISION)) {
- CXFA_Node *pOverflowLeaderNode = NULL, *pOverflowTrailerNode = NULL,
- *pFormNode = NULL;
- CXFA_ContentLayoutItem* pTrailerLayoutItem = NULL;
+ CXFA_Node *pOverflowLeaderNode = nullptr, *pOverflowTrailerNode = nullptr,
+ *pFormNode = nullptr;
+ CXFA_ContentLayoutItem* pTrailerLayoutItem = nullptr;
FX_BOOL bIsAddTrailerHeight = FALSE;
if (pThis->m_pPageMgr &&
pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) {
pFormNode = pThis->m_pPageMgr->QueryOverflow(pProcessor->m_pFormNode);
- if (pFormNode == NULL && pLayoutContext &&
+ if (!pFormNode && pLayoutContext &&
pLayoutContext->m_pOverflowProcessor) {
pFormNode = pLayoutContext->m_pOverflowNode;
bUseInherited = TRUE;
@@ -2023,12 +2021,12 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowTrailerNode)) {
if (pOverflowTrailerNode) {
CXFA_ItemLayoutProcessor* pOverflowLeaderProcessor =
- new CXFA_ItemLayoutProcessor(pOverflowTrailerNode, NULL);
+ new CXFA_ItemLayoutProcessor(pOverflowTrailerNode, nullptr);
pOverflowLeaderProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX);
pTrailerLayoutItem =
pOverflowLeaderProcessor->HasLayoutItem()
? pOverflowLeaderProcessor->ExtractLayoutItem()
- : NULL;
+ : nullptr;
delete pOverflowLeaderProcessor;
}
if (bUseInherited) {
@@ -2146,7 +2144,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
return XFA_ItemLayoutProcessorResult_PageFullBreak;
}
- CXFA_Node *pTempLeaderNode = NULL, *pTempTrailerNode = NULL;
+ CXFA_Node *pTempLeaderNode = nullptr, *pTempTrailerNode = nullptr;
if (pThis->m_pPageMgr && !pProcessor->m_bUseInheriated &&
eRetValue != XFA_ItemLayoutProcessorResult_PageFullBreak) {
pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode,
@@ -2166,7 +2164,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
} else {
if (pProcessor->m_pLayoutItem->m_pFirstChild &&
pProcessor->m_pLayoutItem->m_pFirstChild->m_pNextSibling ==
- NULL &&
+ nullptr &&
pProcessor->m_pLayoutItem->m_pFirstChild->m_pFormNode->HasFlag(
XFA_NODEFLAG_LayoutGeneratedNode)) {
pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode,
@@ -2194,9 +2192,9 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
} else if (fContentCurRowY <= XFA_LAYOUT_FLOAT_PERCISION) {
pProcessor->GetCurrentComponentSize(fChildWidth, fChildHeight);
if (pProcessor->m_pPageMgr->GetNextAvailContentHeight(fChildHeight)) {
- CXFA_Node *pTempLeaderNode = NULL, *pTempTrailerNode = NULL;
+ CXFA_Node *pTempLeaderNode = nullptr, *pTempTrailerNode = nullptr;
if (pThis->m_pPageMgr) {
- if (pFormNode == NULL && pLayoutContext) {
+ if (!pFormNode && pLayoutContext) {
pFormNode = pLayoutContext->m_pOverflowProcessor->m_pFormNode;
}
pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode,
@@ -2242,7 +2240,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
} else {
if (eRetValue == XFA_ItemLayoutProcessorResult_Done) {
- if (pFormNode == NULL && pLayoutContext) {
+ if (!pFormNode && pLayoutContext) {
pFormNode = pLayoutContext->m_pOverflowProcessor->m_pFormNode;
}
if (pThis->m_pPageMgr) {
@@ -2333,7 +2331,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
fRealHeight = fRealHeight - fTopInset - fBottomInset;
FX_FLOAT fContentCurRowY = 0;
- CXFA_ContentLayoutItem* pLayoutChild = NULL;
+ CXFA_ContentLayoutItem* pLayoutChild = nullptr;
if (m_pLayoutItem) {
if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Done &&
eFlowStrategy != XFA_ATTRIBUTEENUM_Tb) {
@@ -2395,7 +2393,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
if (pLayoutChild) {
for (CXFA_ContentLayoutItem* pLayoutNext = pLayoutChild; pLayoutNext;
pLayoutNext = (CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling) {
- if (pLayoutNext->m_pNextSibling == NULL && m_pCurChildPreprocessor &&
+ if (!pLayoutNext->m_pNextSibling && m_pCurChildPreprocessor &&
m_pCurChildPreprocessor->m_pFormNode == pLayoutNext->m_pFormNode) {
pLayoutNext->m_pNext = m_pCurChildPreprocessor->m_pLayoutItem;
m_pCurChildPreprocessor->m_pLayoutItem = pLayoutNext;
@@ -2420,7 +2418,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
if ((CXFA_ContentLayoutItem*)m_pLayoutItem->m_pFirstChild ==
pLayoutChild) {
- m_pLayoutItem->m_pFirstChild = NULL;
+ m_pLayoutItem->m_pFirstChild = nullptr;
} else {
CXFA_ContentLayoutItem* pLayoutNext =
(CXFA_ContentLayoutItem*)m_pLayoutItem->m_pFirstChild;
@@ -2429,7 +2427,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
(CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling) {
if ((CXFA_ContentLayoutItem*)pLayoutNext->m_pNextSibling ==
pLayoutChild) {
- pLayoutNext->m_pNextSibling = NULL;
+ pLayoutNext->m_pNextSibling = nullptr;
break;
}
}
@@ -2437,13 +2435,13 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
CXFA_ContentLayoutItem* pLayoutNextTemp =
(CXFA_ContentLayoutItem*)pLayoutChild;
while (pLayoutNextTemp) {
- pLayoutNextTemp->m_pParent = NULL;
+ pLayoutNextTemp->m_pParent = nullptr;
CXFA_ContentLayoutItem* pSaveLayoutNext =
(CXFA_ContentLayoutItem*)pLayoutNextTemp->m_pNextSibling;
- pLayoutNextTemp->m_pNextSibling = NULL;
+ pLayoutNextTemp->m_pNextSibling = nullptr;
pLayoutNextTemp = pSaveLayoutNext;
}
- pLayoutChild = NULL;
+ pLayoutChild = nullptr;
}
while (m_pCurChildNode) {
CXFA_ItemLayoutProcessor* pProcessor = nullptr;
@@ -2461,7 +2459,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
m_pLayoutItem->RemoveChild(pItem);
fContentCalculatedHeight -= pItem->m_sSize.y;
}
- CXFA_Node *pLeaderNode = NULL, *pTrailerNode = NULL;
+ CXFA_Node *pLeaderNode = nullptr, *pTrailerNode = nullptr;
FX_BOOL bCreatePage = FALSE;
if (bUseBreakControl && m_pPageMgr &&
m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, TRUE,
@@ -2474,7 +2472,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
if (JudgeLeaderOrTrailerForOccur(pTrailerNode)) {
if (m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent)->GetClassID() ==
XFA_ELEMENT_Form &&
- m_pLayoutItem == NULL) {
+ !m_pLayoutItem) {
XFA_ItemLayoutProcessor_AddPendingNode(this, pTrailerNode,
TRUE);
} else {
@@ -2498,7 +2496,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
} break;
case XFA_ItemLayoutProcessorStages_BreakAfter: {
- CXFA_Node *pLeaderNode = NULL, *pTrailerNode = NULL;
+ CXFA_Node *pLeaderNode = nullptr, *pTrailerNode = nullptr;
FX_BOOL bCreatePage = FALSE;
if (bUseBreakControl && m_pPageMgr &&
m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, FALSE,
@@ -2554,10 +2552,10 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
} break;
case XFA_ItemLayoutProcessorStages_BookendLeader: {
- CXFA_Node* pLeaderNode = NULL;
+ CXFA_Node* pLeaderNode = nullptr;
if (m_pCurChildPreprocessor) {
pProcessor = m_pCurChildPreprocessor;
- m_pCurChildPreprocessor = NULL;
+ m_pCurChildPreprocessor = nullptr;
} else if (m_pPageMgr &&
m_pPageMgr->ProcessBookendLeaderOrTrailer(
m_pCurChildNode, TRUE, pLeaderNode)) {
@@ -2575,15 +2573,15 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
goto SuspendAndCreateNewRow;
} else {
delete pProcessor;
- pProcessor = NULL;
+ pProcessor = nullptr;
}
}
} break;
case XFA_ItemLayoutProcessorStages_BookendTrailer: {
- CXFA_Node* pTrailerNode = NULL;
+ CXFA_Node* pTrailerNode = nullptr;
if (m_pCurChildPreprocessor) {
pProcessor = m_pCurChildPreprocessor;
- m_pCurChildPreprocessor = NULL;
+ m_pCurChildPreprocessor = nullptr;
} else if (m_pPageMgr &&
m_pPageMgr->ProcessBookendLeaderOrTrailer(
m_pCurChildNode, FALSE, pTrailerNode)) {
@@ -2601,7 +2599,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
goto SuspendAndCreateNewRow;
} else {
delete pProcessor;
- pProcessor = NULL;
+ pProcessor = nullptr;
}
}
} break;
@@ -2619,7 +2617,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
FX_BOOL bNewRow = FALSE;
if (m_pCurChildPreprocessor) {
pProcessor = m_pCurChildPreprocessor;
- m_pCurChildPreprocessor = NULL;
+ m_pCurChildPreprocessor = nullptr;
bNewRow = TRUE;
} else {
pProcessor =
@@ -2648,7 +2646,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
fContentCurRowY += XFA_ItemLayoutProcessor_InsertPendingItems(
pProcessor, m_pCurChildNode);
delete pProcessor;
- pProcessor = NULL;
+ pProcessor = nullptr;
}
}
break;
@@ -2692,9 +2690,8 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
fContainerHeight);
if (fContainerHeight >= XFA_LAYOUT_FLOAT_PERCISION || m_pLayoutItem ||
bRetValue) {
- if (m_pLayoutItem == NULL) {
+ if (!m_pLayoutItem)
m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
- }
if (fContainerHeight < 0) {
fContainerHeight = 0;
}
@@ -2744,9 +2741,9 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
}
return FALSE;
}
- if (m_pLayoutItem == NULL) {
+ if (!m_pLayoutItem)
m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
- }
+
if (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb) {
FX_FLOAT fCurPos;
fCurPos = 0;
« no previous file with comments | « xfa/fxfa/parser/xfa_layout_itemlayout.h ('k') | xfa/fxfa/parser/xfa_layout_pagemgr_new.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698