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

Side by Side Diff: xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp

Issue 1890563003: Simplify XFA event handling. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: fix typo from PS1 Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h" 7 #include "xfa/fxfa/parser/xfa_layout_pagemgr_new.h"
8 8
9 #include "xfa/fxfa/app/xfa_ffnotify.h" 9 #include "xfa/fxfa/app/xfa_ffnotify.h"
10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 pContainerItem->m_pFormNode = pNewPageArea; 408 pContainerItem->m_pFormNode = pNewPageArea;
409 m_nAvailPages++; 409 m_nAvailPages++;
410 pNewPageAreaLayoutItem = pContainerItem; 410 pNewPageAreaLayoutItem = pContainerItem;
411 } else { 411 } else {
412 CXFA_FFNotify* pNotify = 412 CXFA_FFNotify* pNotify =
413 pNewPageArea->GetDocument()->GetParser()->GetNotify(); 413 pNewPageArea->GetDocument()->GetParser()->GetNotify();
414 CXFA_ContainerLayoutItem* pContainerItem = 414 CXFA_ContainerLayoutItem* pContainerItem =
415 (CXFA_ContainerLayoutItem*)pNotify->OnCreateLayoutItem(pNewPageArea); 415 (CXFA_ContainerLayoutItem*)pNotify->OnCreateLayoutItem(pNewPageArea);
416 m_PageArray.Add(pContainerItem); 416 m_PageArray.Add(pContainerItem);
417 m_nAvailPages++; 417 m_nAvailPages++;
418 pNotify->OnPageEvent(pContainerItem, XFA_PAGEEVENT_PageAdded, 418 pNotify->OnPageEvent(pContainerItem, XFA_PAGEVIEWEVENT_PostRemoved);
419 (void*)(uintptr_t)m_nAvailPages);
420 pNewPageAreaLayoutItem = pContainerItem; 419 pNewPageAreaLayoutItem = pContainerItem;
421 } 420 }
422 pNewRecord->pCurPageSet->AddChild(pNewPageAreaLayoutItem); 421 pNewRecord->pCurPageSet->AddChild(pNewPageAreaLayoutItem);
423 pNewRecord->pCurPageArea = pNewPageAreaLayoutItem; 422 pNewRecord->pCurPageArea = pNewPageAreaLayoutItem;
424 pNewRecord->pCurContentArea = NULL; 423 pNewRecord->pCurContentArea = NULL;
425 } 424 }
426 void CXFA_LayoutPageMgr::AddContentAreaLayoutItem( 425 void CXFA_LayoutPageMgr::AddContentAreaLayoutItem(
427 CXFA_ContainerRecord* pNewRecord, 426 CXFA_ContainerRecord* pNewRecord,
428 CXFA_Node* pContentArea) { 427 CXFA_Node* pContentArea) {
429 if (pContentArea == NULL) { 428 if (pContentArea == NULL) {
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 static void XFA_SyncRemoveLayoutItem(CXFA_LayoutItem* pParentLayoutItem, 1499 static void XFA_SyncRemoveLayoutItem(CXFA_LayoutItem* pParentLayoutItem,
1501 CXFA_FFNotify* pNotify, 1500 CXFA_FFNotify* pNotify,
1502 CXFA_LayoutProcessor* pDocLayout) { 1501 CXFA_LayoutProcessor* pDocLayout) {
1503 CXFA_LayoutItem* pNextLayoutItem; 1502 CXFA_LayoutItem* pNextLayoutItem;
1504 CXFA_LayoutItem* pCurLayoutItem = pParentLayoutItem->m_pFirstChild; 1503 CXFA_LayoutItem* pCurLayoutItem = pParentLayoutItem->m_pFirstChild;
1505 while (pCurLayoutItem) { 1504 while (pCurLayoutItem) {
1506 pNextLayoutItem = pCurLayoutItem->m_pNextSibling; 1505 pNextLayoutItem = pCurLayoutItem->m_pNextSibling;
1507 if (pCurLayoutItem->m_pFirstChild) { 1506 if (pCurLayoutItem->m_pFirstChild) {
1508 XFA_SyncRemoveLayoutItem(pCurLayoutItem, pNotify, pDocLayout); 1507 XFA_SyncRemoveLayoutItem(pCurLayoutItem, pNotify, pDocLayout);
1509 } 1508 }
1510 pNotify->OnLayoutEvent(pDocLayout, pCurLayoutItem, 1509 pNotify->OnLayoutItemRemoving(pDocLayout, pCurLayoutItem);
1511 XFA_LAYOUTEVENT_ItemRemoving);
1512 delete pCurLayoutItem; 1510 delete pCurLayoutItem;
1513 pCurLayoutItem = pNextLayoutItem; 1511 pCurLayoutItem = pNextLayoutItem;
1514 } 1512 }
1515 } 1513 }
1516 void CXFA_LayoutPageMgr::SaveLayoutItem(CXFA_LayoutItem* pParentLayoutItem) { 1514 void CXFA_LayoutPageMgr::SaveLayoutItem(CXFA_LayoutItem* pParentLayoutItem) {
1517 CXFA_LayoutItem* pNextLayoutItem; 1515 CXFA_LayoutItem* pNextLayoutItem;
1518 CXFA_LayoutItem* pCurLayoutItem = pParentLayoutItem->m_pFirstChild; 1516 CXFA_LayoutItem* pCurLayoutItem = pParentLayoutItem->m_pFirstChild;
1519 while (pCurLayoutItem) { 1517 while (pCurLayoutItem) {
1520 pNextLayoutItem = pCurLayoutItem->m_pNextSibling; 1518 pNextLayoutItem = pCurLayoutItem->m_pNextSibling;
1521 if (pCurLayoutItem->IsContentLayoutItem()) { 1519 if (pCurLayoutItem->IsContentLayoutItem()) {
1522 uint32_t dwFlag = pCurLayoutItem->m_pFormNode->GetFlag(); 1520 uint32_t dwFlag = pCurLayoutItem->m_pFormNode->GetFlag();
1523 if (dwFlag & (XFA_NODEFLAG_HasRemoved)) { 1521 if (dwFlag & (XFA_NODEFLAG_HasRemoved)) {
1524 CXFA_FFNotify* pNotify = 1522 CXFA_FFNotify* pNotify =
1525 m_pTemplatePageSetRoot->GetDocument()->GetParser()->GetNotify(); 1523 m_pTemplatePageSetRoot->GetDocument()->GetParser()->GetNotify();
1526 CXFA_LayoutProcessor* pDocLayout = 1524 CXFA_LayoutProcessor* pDocLayout =
1527 m_pTemplatePageSetRoot->GetDocument()->GetDocLayout(); 1525 m_pTemplatePageSetRoot->GetDocument()->GetDocLayout();
1528 if (pCurLayoutItem->m_pFirstChild) { 1526 if (pCurLayoutItem->m_pFirstChild) {
1529 XFA_SyncRemoveLayoutItem(pCurLayoutItem, pNotify, pDocLayout); 1527 XFA_SyncRemoveLayoutItem(pCurLayoutItem, pNotify, pDocLayout);
1530 } 1528 }
1531 pNotify->OnLayoutEvent(pDocLayout, pCurLayoutItem, 1529 pNotify->OnLayoutItemRemoving(pDocLayout, pCurLayoutItem);
1532 XFA_LAYOUTEVENT_ItemRemoving);
1533 delete pCurLayoutItem; 1530 delete pCurLayoutItem;
1534 pCurLayoutItem = pNextLayoutItem; 1531 pCurLayoutItem = pNextLayoutItem;
1535 continue; 1532 continue;
1536 } 1533 }
1537 if (dwFlag & XFA_NODEFLAG_LayoutGeneratedNode) { 1534 if (dwFlag & XFA_NODEFLAG_LayoutGeneratedNode) {
1538 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode> 1535 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode>
1539 sIterator(pCurLayoutItem->m_pFormNode); 1536 sIterator(pCurLayoutItem->m_pFormNode);
1540 for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; 1537 for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode;
1541 pNode = sIterator.MoveToNext()) { 1538 pNode = sIterator.MoveToNext()) {
1542 pNode->SetFlag(XFA_NODEFLAG_UnusedNode, TRUE, FALSE); 1539 pNode->SetFlag(XFA_NODEFLAG_UnusedNode, TRUE, FALSE);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 if (pBindNode) { 1593 if (pBindNode) {
1597 pBindNode->RemoveBindItem(pNode); 1594 pBindNode->RemoveBindItem(pNode);
1598 pNode->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); 1595 pNode->SetObject(XFA_ATTRIBUTE_BindingNode, NULL);
1599 } 1596 }
1600 } 1597 }
1601 pNode->SetFlag(XFA_NODEFLAG_UnusedNode); 1598 pNode->SetFlag(XFA_NODEFLAG_UnusedNode);
1602 } 1599 }
1603 } 1600 }
1604 } 1601 }
1605 int32_t iIndex = 0; 1602 int32_t iIndex = 0;
1606 CXFA_Node* pPendingPageSet = NULL;
1607 for (; pRootLayout; 1603 for (; pRootLayout;
1608 pRootLayout = (CXFA_ContainerLayoutItem*)pRootLayout->m_pNextSibling) { 1604 pRootLayout = (CXFA_ContainerLayoutItem*)pRootLayout->m_pNextSibling) {
1609 pPendingPageSet = NULL; 1605 CXFA_Node* pPendingPageSet = nullptr;
1610 CXFA_NodeIteratorTemplate< 1606 CXFA_NodeIteratorTemplate<
1611 CXFA_ContainerLayoutItem, 1607 CXFA_ContainerLayoutItem,
1612 CXFA_TraverseStrategy_ContentAreaContainerLayoutItem> 1608 CXFA_TraverseStrategy_ContentAreaContainerLayoutItem>
1613 iterator(pRootLayout); 1609 iterator(pRootLayout);
1614 CXFA_ContainerLayoutItem* pRootPageSetContainerItem = iterator.GetCurrent(); 1610 CXFA_ContainerLayoutItem* pRootPageSetContainerItem = iterator.GetCurrent();
1615 ASSERT(pRootPageSetContainerItem->m_pFormNode->GetClassID() == 1611 ASSERT(pRootPageSetContainerItem->m_pFormNode->GetClassID() ==
1616 XFA_ELEMENT_PageSet); 1612 XFA_ELEMENT_PageSet);
1617 if (iIndex < pDocument->m_pPendingPageSet.GetSize()) { 1613 if (iIndex < pDocument->m_pPendingPageSet.GetSize()) {
1618 pPendingPageSet = pDocument->m_pPendingPageSet.GetAt(iIndex); 1614 pPendingPageSet = pDocument->m_pPendingPageSet.GetAt(iIndex);
1619 iIndex++; 1615 iIndex++;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 CXFA_Node* pExistingNode = XFA_DataMerge_FindFormDOMInstance( 1668 CXFA_Node* pExistingNode = XFA_DataMerge_FindFormDOMInstance(
1673 pDocument, pContainerItem->m_pFormNode->GetClassID(), 1669 pDocument, pContainerItem->m_pFormNode->GetClassID(),
1674 pContainerItem->m_pFormNode->GetNameHash(), pParentNode); 1670 pContainerItem->m_pFormNode->GetNameHash(), pParentNode);
1675 CXFA_ContainerIterator sIterator(pExistingNode); 1671 CXFA_ContainerIterator sIterator(pExistingNode);
1676 for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode; 1672 for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode;
1677 pNode = sIterator.MoveToNext()) { 1673 pNode = sIterator.MoveToNext()) {
1678 if (pNode->GetClassID() != XFA_ELEMENT_ContentArea) { 1674 if (pNode->GetClassID() != XFA_ELEMENT_ContentArea) {
1679 CXFA_LayoutItem* pLayoutItem = static_cast<CXFA_LayoutItem*>( 1675 CXFA_LayoutItem* pLayoutItem = static_cast<CXFA_LayoutItem*>(
1680 pNode->GetUserData(XFA_LAYOUTITEMKEY)); 1676 pNode->GetUserData(XFA_LAYOUTITEMKEY));
1681 if (pLayoutItem) { 1677 if (pLayoutItem) {
1682 pNotify->OnLayoutEvent(pDocLayout, pLayoutItem, 1678 pNotify->OnLayoutItemRemoving(pDocLayout, pLayoutItem);
1683 XFA_LAYOUTEVENT_ItemRemoving);
1684 delete pLayoutItem; 1679 delete pLayoutItem;
1685 } 1680 }
1686 } 1681 }
1687 } 1682 }
1688 if (pExistingNode) { 1683 if (pExistingNode) {
1689 pParentNode->RemoveChild(pExistingNode); 1684 pParentNode->RemoveChild(pExistingNode);
1690 } 1685 }
1691 } 1686 }
1692 pContainerItem->m_pOldSubform = pNewSubform; 1687 pContainerItem->m_pOldSubform = pNewSubform;
1693 } 1688 }
(...skipping 21 matching lines...) Expand all
1715 if (!pPendingPageSet->GetNodeItem(XFA_NODEITEM_Parent)) { 1710 if (!pPendingPageSet->GetNodeItem(XFA_NODEITEM_Parent)) {
1716 CXFA_Node* pFormToplevelSubform = 1711 CXFA_Node* pFormToplevelSubform =
1717 pDocument->GetXFAObject(XFA_HASHCODE_Form) 1712 pDocument->GetXFAObject(XFA_HASHCODE_Form)
1718 ->AsNode() 1713 ->AsNode()
1719 ->GetFirstChildByClass(XFA_ELEMENT_Subform); 1714 ->GetFirstChildByClass(XFA_ELEMENT_Subform);
1720 pFormToplevelSubform->InsertChild(pPendingPageSet); 1715 pFormToplevelSubform->InsertChild(pPendingPageSet);
1721 } 1716 }
1722 pDocument->DataMerge_UpdateBindingRelations(pPendingPageSet); 1717 pDocument->DataMerge_UpdateBindingRelations(pPendingPageSet);
1723 pPendingPageSet->SetFlag(XFA_NODEFLAG_Initialized); 1718 pPendingPageSet->SetFlag(XFA_NODEFLAG_Initialized);
1724 } 1719 }
1725 pPendingPageSet = GetRootLayoutItem()->m_pFormNode; 1720 CXFA_Node* pPendingPageSet = GetRootLayoutItem()->m_pFormNode;
1726 while (pPendingPageSet) { 1721 while (pPendingPageSet) {
1727 CXFA_Node* pNextPendingPageSet = 1722 CXFA_Node* pNextPendingPageSet =
1728 pPendingPageSet->GetNextSameClassSibling(XFA_ELEMENT_PageSet); 1723 pPendingPageSet->GetNextSameClassSibling(XFA_ELEMENT_PageSet);
1729 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode> 1724 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode>
1730 sIterator(pPendingPageSet); 1725 sIterator(pPendingPageSet);
1731 CXFA_Node* pNode = sIterator.GetCurrent(); 1726 CXFA_Node* pNode = sIterator.GetCurrent();
1732 while (pNode) { 1727 while (pNode) {
1733 if (pNode->HasFlag(XFA_NODEFLAG_UnusedNode)) { 1728 if (pNode->HasFlag(XFA_NODEFLAG_UnusedNode)) {
1734 if (pNode->GetObjectType() == XFA_OBJECTTYPE_ContainerNode) { 1729 if (pNode->GetObjectType() == XFA_OBJECTTYPE_ContainerNode) {
1735 XFA_ELEMENT eCurId = pNode->GetClassID(); 1730 XFA_ELEMENT eCurId = pNode->GetClassID();
1736 if (eCurId == XFA_ELEMENT_PageArea || eCurId == XFA_ELEMENT_PageSet) { 1731 if (eCurId == XFA_ELEMENT_PageArea || eCurId == XFA_ELEMENT_PageSet) {
1737 CXFA_ContainerIterator iteChild(pNode); 1732 CXFA_ContainerIterator iteChild(pNode);
1738 CXFA_Node* pChildNode = iteChild.MoveToNext(); 1733 CXFA_Node* pChildNode = iteChild.MoveToNext();
1739 for (; pChildNode; pChildNode = iteChild.MoveToNext()) { 1734 for (; pChildNode; pChildNode = iteChild.MoveToNext()) {
1740 CXFA_LayoutItem* pLayoutItem = static_cast<CXFA_LayoutItem*>( 1735 CXFA_LayoutItem* pLayoutItem = static_cast<CXFA_LayoutItem*>(
1741 pChildNode->GetUserData(XFA_LAYOUTITEMKEY)); 1736 pChildNode->GetUserData(XFA_LAYOUTITEMKEY));
1742 if (pLayoutItem) { 1737 if (pLayoutItem) {
1743 pNotify->OnLayoutEvent(pDocLayout, pLayoutItem, 1738 pNotify->OnLayoutItemRemoving(pDocLayout, pLayoutItem);
1744 XFA_LAYOUTEVENT_ItemRemoving);
1745 delete pLayoutItem; 1739 delete pLayoutItem;
1746 } 1740 }
1747 } 1741 }
1748 } else if (eCurId != XFA_ELEMENT_ContentArea) { 1742 } else if (eCurId != XFA_ELEMENT_ContentArea) {
1749 CXFA_LayoutItem* pLayoutItem = static_cast<CXFA_LayoutItem*>( 1743 CXFA_LayoutItem* pLayoutItem = static_cast<CXFA_LayoutItem*>(
1750 pNode->GetUserData(XFA_LAYOUTITEMKEY)); 1744 pNode->GetUserData(XFA_LAYOUTITEMKEY));
1751 if (pLayoutItem) { 1745 if (pLayoutItem) {
1752 pNotify->OnLayoutEvent(pDocLayout, pLayoutItem, 1746 pNotify->OnLayoutItemRemoving(pDocLayout, pLayoutItem);
1753 XFA_LAYOUTEVENT_ItemRemoving);
1754 delete pLayoutItem; 1747 delete pLayoutItem;
1755 } 1748 }
1756 } 1749 }
1757 CXFA_Node* pNext = sIterator.SkipChildrenAndMoveToNext(); 1750 CXFA_Node* pNext = sIterator.SkipChildrenAndMoveToNext();
1758 pNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pNode); 1751 pNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pNode);
1759 pNode = pNext; 1752 pNode = pNext;
1760 } else { 1753 } else {
1761 pNode->SetFlag(XFA_NODEFLAG_UnusedNode, FALSE); 1754 pNode->SetFlag(XFA_NODEFLAG_UnusedNode, FALSE);
1762 pNode->SetFlag(XFA_NODEFLAG_Initialized); 1755 pNode->SetFlag(XFA_NODEFLAG_Initialized);
1763 pNode = sIterator.MoveToNext(); 1756 pNode = sIterator.MoveToNext();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 pContainerItem->m_pFormNode->GetEnum(XFA_ATTRIBUTE_Presence); 1800 pContainerItem->m_pFormNode->GetEnum(XFA_ATTRIBUTE_Presence);
1808 if (eAttributeValue == XFA_ATTRIBUTEENUM_Visible || 1801 if (eAttributeValue == XFA_ATTRIBUTEENUM_Visible ||
1809 eAttributeValue == XFA_ATTRIBUTEENUM_Unknown) { 1802 eAttributeValue == XFA_ATTRIBUTEENUM_Unknown) {
1810 bVisibleItem = TRUE; 1803 bVisibleItem = TRUE;
1811 } 1804 }
1812 dwRelevantContainer = 1805 dwRelevantContainer =
1813 XFA_GetRelevant(pContainerItem->m_pFormNode, dwRelevant); 1806 XFA_GetRelevant(pContainerItem->m_pFormNode, dwRelevant);
1814 dwStatus = 1807 dwStatus =
1815 (bVisibleItem ? XFA_LAYOUTSTATUS_Visible : 0) | dwRelevantContainer; 1808 (bVisibleItem ? XFA_LAYOUTSTATUS_Visible : 0) | dwRelevantContainer;
1816 } 1809 }
1817 pNotify->OnLayoutEvent(pDocLayout, pContainerItem, XFA_LAYOUTEVENT_ItemAdded, 1810 pNotify->OnLayoutItemAdd(pDocLayout, pContainerItem, nPageIndex, dwStatus);
1818 (void*)(uintptr_t)nPageIndex,
1819 (void*)(uintptr_t)dwStatus);
1820 for (CXFA_LayoutItem* pChild = pContainerItem->m_pFirstChild; pChild; 1811 for (CXFA_LayoutItem* pChild = pContainerItem->m_pFirstChild; pChild;
1821 pChild = pChild->m_pNextSibling) { 1812 pChild = pChild->m_pNextSibling) {
1822 if (pChild->IsContentLayoutItem()) { 1813 if (pChild->IsContentLayoutItem()) {
1823 XFA_SyncContainer(pNotify, pDocLayout, pChild, dwRelevantContainer, 1814 XFA_SyncContainer(pNotify, pDocLayout, pChild, dwRelevantContainer,
1824 bVisibleItem, nPageIndex); 1815 bVisibleItem, nPageIndex);
1825 } 1816 }
1826 } 1817 }
1827 } 1818 }
1828 void CXFA_LayoutPageMgr::SyncLayoutData() { 1819 void CXFA_LayoutPageMgr::SyncLayoutData() {
1829 MergePageSetContents(); 1820 MergePageSetContents();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 } break; 1860 } break;
1870 default: 1861 default:
1871 break; 1862 break;
1872 } 1863 }
1873 } 1864 }
1874 } 1865 }
1875 int32_t nPage = m_PageArray.GetSize(); 1866 int32_t nPage = m_PageArray.GetSize();
1876 for (int32_t i = nPage - 1; i >= m_nAvailPages; i--) { 1867 for (int32_t i = nPage - 1; i >= m_nAvailPages; i--) {
1877 CXFA_ContainerLayoutItem* pPage = m_PageArray[i]; 1868 CXFA_ContainerLayoutItem* pPage = m_PageArray[i];
1878 m_PageArray.RemoveAt(i); 1869 m_PageArray.RemoveAt(i);
1879 pNotify->OnPageEvent(pPage, XFA_PAGEEVENT_PageRemoved); 1870 pNotify->OnPageEvent(pPage, XFA_PAGEVIEWEVENT_PostRemoved);
1880 delete pPage; 1871 delete pPage;
1881 } 1872 }
1882 ClearRecordList(); 1873 ClearRecordList();
1883 } 1874 }
1884 void XFA_ReleaseLayoutItem_NoPageArea(CXFA_LayoutItem* pLayoutItem) { 1875 void XFA_ReleaseLayoutItem_NoPageArea(CXFA_LayoutItem* pLayoutItem) {
1885 CXFA_LayoutItem *pNext, *pNode = pLayoutItem->m_pFirstChild; 1876 CXFA_LayoutItem *pNext, *pNode = pLayoutItem->m_pFirstChild;
1886 while (pNode) { 1877 while (pNode) {
1887 pNext = pNode->m_pNextSibling; 1878 pNext = pNode->m_pNextSibling;
1888 pNode->m_pParent = NULL; 1879 pNode->m_pParent = NULL;
1889 XFA_ReleaseLayoutItem_NoPageArea(pNode); 1880 XFA_ReleaseLayoutItem_NoPageArea(pNode);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 } 1916 }
1926 pRootLayoutItem = m_pPageSetLayoutItemRoot; 1917 pRootLayoutItem = m_pPageSetLayoutItemRoot;
1927 CXFA_ContainerLayoutItem* pNextLayout = NULL; 1918 CXFA_ContainerLayoutItem* pNextLayout = NULL;
1928 for (; pRootLayoutItem; pRootLayoutItem = pNextLayout) { 1919 for (; pRootLayoutItem; pRootLayoutItem = pNextLayout) {
1929 pNextLayout = (CXFA_ContainerLayoutItem*)pRootLayoutItem->m_pNextSibling; 1920 pNextLayout = (CXFA_ContainerLayoutItem*)pRootLayoutItem->m_pNextSibling;
1930 SaveLayoutItem(pRootLayoutItem); 1921 SaveLayoutItem(pRootLayoutItem);
1931 delete pRootLayoutItem; 1922 delete pRootLayoutItem;
1932 } 1923 }
1933 m_pPageSetLayoutItemRoot = NULL; 1924 m_pPageSetLayoutItemRoot = NULL;
1934 } 1925 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698