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.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index c8f4b65a16..7b4cf2651a 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -6,6 +6,7 @@
#include "xfa/fxfa/parser/cxfa_layoutpagemgr.h"
+#include "third_party/base/stl_util.h"
#include "xfa/fxfa/app/xfa_ffnotify.h"
#include "xfa/fxfa/parser/cxfa_containerlayoutitem.h"
#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h"
@@ -172,8 +173,8 @@ CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot,
XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties |
XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Siblings |
XFA_RESOLVENODE_Parent);
- if (iCount > 0 && rs.nodes[0]->IsNode())
- return rs.nodes[0]->AsNode();
+ if (iCount > 0 && rs.objects.front()->IsNode())
+ return rs.objects.front()->AsNode();
}
iSplitIndex = iSplitNextIndex;
}
@@ -1661,22 +1662,19 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
CXFA_FFNotify* pNotify = pDocument->GetNotify();
CXFA_LayoutProcessor* pDocLayout = pDocument->GetDocLayout();
CXFA_ContainerLayoutItem* pRootLayout = GetRootLayoutItem();
- {
- for (int32_t iIndex = 0; iIndex < pDocument->m_pPendingPageSet.GetSize();
- iIndex++) {
- CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode>
- sIterator(pDocument->m_pPendingPageSet.GetAt(iIndex));
- for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode;
- pNode = sIterator.MoveToNext()) {
- if (pNode->IsContainerNode()) {
- CXFA_Node* pBindNode = pNode->GetBindData();
- if (pBindNode) {
- pBindNode->RemoveBindItem(pNode);
- pNode->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr);
- }
+ for (CXFA_Node* pPageNode : pDocument->m_pPendingPageSet) {
+ CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode>
+ sIterator(pPageNode);
+ for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode;
+ pNode = sIterator.MoveToNext()) {
+ if (pNode->IsContainerNode()) {
+ CXFA_Node* pBindNode = pNode->GetBindData();
+ if (pBindNode) {
+ pBindNode->RemoveBindItem(pNode);
+ pNode->SetObject(XFA_ATTRIBUTE_BindingNode, nullptr);
}
- pNode->SetFlag(XFA_NodeFlag_UnusedNode, true);
}
+ pNode->SetFlag(XFA_NodeFlag_UnusedNode, true);
}
}
@@ -1691,8 +1689,9 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
CXFA_ContainerLayoutItem* pRootPageSetContainerItem = iterator.GetCurrent();
ASSERT(pRootPageSetContainerItem->m_pFormNode->GetElementType() ==
XFA_Element::PageSet);
- if (iIndex < pDocument->m_pPendingPageSet.GetSize()) {
- pPendingPageSet = pDocument->m_pPendingPageSet.GetAt(iIndex);
+ if (iIndex <
+ pdfium::CollectionSize<int32_t>(pDocument->m_pPendingPageSet)) {
+ pPendingPageSet = pDocument->m_pPendingPageSet[iIndex];
iIndex++;
}
if (!pPendingPageSet) {
@@ -1958,7 +1957,7 @@ void CXFA_LayoutPageMgr::PrepareLayout() {
if (pRootLayoutItem &&
pRootLayoutItem->m_pFormNode->GetPacketID() == XFA_XDPPACKET_Form) {
CXFA_Node* pPageSetFormNode = pRootLayoutItem->m_pFormNode;
- pRootLayoutItem->m_pFormNode->GetDocument()->m_pPendingPageSet.RemoveAll();
+ pRootLayoutItem->m_pFormNode->GetDocument()->m_pPendingPageSet.clear();
if (pPageSetFormNode->HasRemovedChildren()) {
XFA_ReleaseLayoutItem(pRootLayoutItem);
m_pPageSetLayoutItemRoot = nullptr;
@@ -1971,7 +1970,7 @@ void CXFA_LayoutPageMgr::PrepareLayout() {
pPageSetFormNode->GetNextSameClassSibling(XFA_Element::PageSet);
pPageSetFormNode->GetNodeItem(XFA_NODEITEM_Parent)
->RemoveChild(pPageSetFormNode, false);
- pRootLayoutItem->m_pFormNode->GetDocument()->m_pPendingPageSet.Add(
+ pRootLayoutItem->m_pFormNode->GetDocument()->m_pPendingPageSet.push_back(
pPageSetFormNode);
pPageSetFormNode = pNextPageSet;
}