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

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

Issue 2207033002: Split xfa_layout_appadapter (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix build Created 4 years, 4 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/cxfa_layoutitem.h ('k') | xfa/fxfa/parser/cxfa_layoutprocessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/cxfa_layoutitem.cpp
diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp
index a9ba3490d8f1497628c1c7883e3654a58180aaca..ebe33b650f8231f627b94749c19ff71952a3ece8 100644
--- a/xfa/fxfa/parser/cxfa_layoutitem.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp
@@ -6,9 +6,32 @@
#include "xfa/fxfa/parser/cxfa_layoutitem.h"
+#include "xfa/fxfa/app/xfa_ffnotify.h"
#include "xfa/fxfa/parser/cxfa_containerlayoutitem.h"
#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h"
+void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) {
+ CXFA_LayoutItem* pNode = pLayoutItem->m_pFirstChild;
+ CXFA_FFNotify* pNotify = pLayoutItem->m_pFormNode->GetDocument()->GetNotify();
+ CXFA_LayoutProcessor* pDocLayout =
+ pLayoutItem->m_pFormNode->GetDocument()->GetDocLayout();
+ while (pNode) {
+ CXFA_LayoutItem* pNext = pNode->m_pNextSibling;
+ pNode->m_pParent = nullptr;
+ pNotify->OnLayoutItemRemoving(pDocLayout,
+ static_cast<CXFA_LayoutItem*>(pNode));
+ XFA_ReleaseLayoutItem(pNode);
+ pNode = pNext;
+ }
+
+ pNotify->OnLayoutItemRemoving(pDocLayout, pLayoutItem);
+ if (pLayoutItem->m_pFormNode->GetElementType() == XFA_Element::PageArea) {
+ pNotify->OnPageEvent(static_cast<CXFA_ContainerLayoutItem*>(pLayoutItem),
+ XFA_PAGEVIEWEVENT_PostRemoved);
+ }
+ delete pLayoutItem;
+}
+
CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem)
: m_pFormNode(pNode),
m_pParent(nullptr),
« no previous file with comments | « xfa/fxfa/parser/cxfa_layoutitem.h ('k') | xfa/fxfa/parser/cxfa_layoutprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698