summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_layoutpagemgr.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.cpp47
1 files changed, 27 insertions, 20 deletions
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index cf3d61e644..e603d91002 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -424,7 +424,7 @@ bool CXFA_LayoutPageMgr::AppendNewPage(bool bFirstTemPage) {
if (m_CurrentContainerRecordIter != GetTailPosition())
return true;
- CXFA_Node* pPageNode = GetNextAvailPageArea(nullptr);
+ CXFA_Node* pPageNode = GetNextAvailPageArea(nullptr, nullptr, false, false);
if (!pPageNode)
return false;
@@ -484,7 +484,7 @@ void CXFA_LayoutPageMgr::SubmitContentItem(
if (eStatus != XFA_ItemLayoutProcessorResult::Done) {
if (eStatus == XFA_ItemLayoutProcessorResult::PageFullBreak &&
m_CurrentContainerRecordIter == GetTailPosition()) {
- AppendNewPage();
+ AppendNewPage(false);
}
m_CurrentContainerRecordIter = GetTailPosition();
m_pCurPageArea = GetCurrentContainerRecord()->pCurPageArea->GetFormNode();
@@ -665,7 +665,8 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
if (eLastChoice == XFA_AttributeEnum::First &&
(ePageRelation == XFA_AttributeEnum::SimplexPaginated ||
eOddOrEven != XFA_AttributeEnum::Odd)) {
- CXFA_ContainerRecord* pRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pRecord =
+ CreateContainerRecord(nullptr, false);
AddPageAreaLayoutItem(pRecord, pNode);
break;
}
@@ -733,7 +734,8 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
}
} else if (pNode->JSObject()->GetEnum(XFA_Attribute::PagePosition) ==
XFA_AttributeEnum::Last) {
- CXFA_ContainerRecord* pRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pRecord =
+ CreateContainerRecord(nullptr, false);
AddPageAreaLayoutItem(pRecord, pNode);
}
} break;
@@ -776,7 +778,7 @@ bool CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType,
if (pTarget)
pPageArea = pTarget->GetParent();
- pPageArea = GetNextAvailPageArea(pPageArea, pTarget);
+ pPageArea = GetNextAvailPageArea(pPageArea, pTarget, false, false);
bRet = !!pPageArea;
}
break;
@@ -787,7 +789,8 @@ bool CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType,
m_CurrentContainerRecordIter == m_ProposedContainerRecords.end() ||
pTarget != GetCurrentContainerRecord()->pCurPageArea->GetFormNode() ||
bStartNew) {
- CXFA_Node* pPageArea = GetNextAvailPageArea(pTarget, nullptr, true);
+ CXFA_Node* pPageArea =
+ GetNextAvailPageArea(pTarget, nullptr, true, false);
bRet = !!pPageArea;
}
break;
@@ -1154,7 +1157,7 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(
if (!pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
XFA_Element::ContentArea)) {
if (pTargetPageArea == pCurrentNode) {
- CreateMinPageRecord(pCurrentNode, true);
+ CreateMinPageRecord(pCurrentNode, true, false);
pTargetPageArea = nullptr;
}
continue;
@@ -1176,7 +1179,7 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(
break;
}
if (!bQuery)
- CreateMinPageRecord(pCurrentNode, false);
+ CreateMinPageRecord(pCurrentNode, false, false);
} else if (pCurrentNode->GetElementType() == XFA_Element::PageSet) {
if (FindPageAreaFromPageSet_Ordered(pCurrentNode, nullptr,
pTargetPageArea, pTargetContentArea,
@@ -1226,7 +1229,8 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
pPreferredPageArea = pCurrentNode;
break;
}
- CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pNewRecord =
+ CreateContainerRecord(nullptr, false);
AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
AddContentAreaLayoutItem(
pNewRecord, pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
@@ -1249,7 +1253,8 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
if (!pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
XFA_Element::ContentArea)) {
if (pTargetPageArea == pCurrentNode) {
- CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pNewRecord =
+ CreateContainerRecord(nullptr, false);
AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
pTargetPageArea = nullptr;
}
@@ -1265,7 +1270,8 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
pFallbackPageArea = pCurrentNode;
}
} else if (pTargetPageArea && !MatchPageAreaOddOrEven(pTargetPageArea)) {
- CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pNewRecord =
+ CreateContainerRecord(nullptr, false);
AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
AddContentAreaLayoutItem(
pNewRecord, pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
@@ -1290,7 +1296,7 @@ bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
return false;
if (!bQuery) {
- CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(nullptr, false);
AddPageAreaLayoutItem(pNewRecord, pCurPageArea);
if (!pTargetContentArea) {
pTargetContentArea = pCurPageArea->GetFirstChildByClass<CXFA_ContentArea>(
@@ -1344,7 +1350,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(
if ((iMax < 0 || m_nCurPageCount < iMax)) {
if (!bQuery) {
CXFA_ContainerRecord* pNewRecord =
- CreateContainerRecord(m_pCurPageArea);
+ CreateContainerRecord(m_pCurPageArea, false);
AddPageAreaLayoutItem(pNewRecord, m_pCurPageArea);
if (!pTargetContentArea) {
pTargetContentArea =
@@ -1374,7 +1380,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(
return m_pCurPageArea;
}
if (!bQuery && IsPageSetRootOrderedOccurrence())
- CreateMinPageSetRecord(pPageSet);
+ CreateMinPageSetRecord(pPageSet, false);
if (FindPageAreaFromPageSet(nullptr, pPageSet, pTargetPageArea,
pTargetContentArea, bNewPage, bQuery)) {
return m_pCurPageArea;
@@ -1406,7 +1412,8 @@ bool CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) {
}
if (pContentAreaLayout) {
if (pContentAreaLayout->GetFormNode() != pCurContentNode) {
- CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pNewRecord =
+ CreateContainerRecord(nullptr, false);
pNewRecord->pCurContentArea = pContentAreaLayout;
return true;
}
@@ -1414,7 +1421,7 @@ bool CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) {
}
}
- CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(nullptr, false);
AddContentAreaLayoutItem(pNewRecord, pContentArea);
return true;
}
@@ -1464,7 +1471,7 @@ int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea,
i = m_nCurPageCount;
for (; i < iMin; i++) {
- CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
+ CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(nullptr, false);
AddPageAreaLayoutItem(pNewRecord, pPageArea);
AddContentAreaLayoutItem(pNewRecord, pContentArea);
}
@@ -1498,7 +1505,7 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet,
for (CXFA_Node* node = pPageSet->GetFirstChild(); node;
node = node->GetNextSibling()) {
if (node->GetElementType() == XFA_Element::PageArea)
- CreateMinPageRecord(node, false);
+ CreateMinPageRecord(node, false, false);
else if (node->GetElementType() == XFA_Element::PageSet)
CreateMinPageSetRecord(node, true);
}
@@ -1513,7 +1520,7 @@ void CXFA_LayoutPageMgr::CreateNextMinRecord(CXFA_Node* pRecordNode) {
for (CXFA_Node* pCurrentNode = pRecordNode->GetNextSibling(); pCurrentNode;
pCurrentNode = pCurrentNode->GetNextSibling()) {
if (pCurrentNode->GetElementType() == XFA_Element::PageArea)
- CreateMinPageRecord(pCurrentNode, false);
+ CreateMinPageRecord(pCurrentNode, false, false);
else if (pCurrentNode->GetElementType() == XFA_Element::PageSet)
CreateMinPageSetRecord(pCurrentNode, true);
}
@@ -1524,7 +1531,7 @@ void CXFA_LayoutPageMgr::ProcessLastPageSet() {
CreateNextMinRecord(m_pCurPageArea);
CXFA_Node* pPageSet = m_pCurPageArea->GetParent();
while (true) {
- CreateMinPageSetRecord(pPageSet);
+ CreateMinPageSetRecord(pPageSet, false);
if (pPageSet == m_pTemplatePageSetRoot)
break;