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

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

Issue 1890563003: Simplify XFA event handling. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: address comments 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
« no previous file with comments | « xfa/fxfa/parser/xfa_document_imp.cpp ('k') | xfa/fxfa/parser/xfa_layout_itemlayout.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_appadapter.h" 7 #include "xfa/fxfa/parser/xfa_layout_appadapter.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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) { 44 void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) {
45 CXFA_LayoutItem* pNode = pLayoutItem->m_pFirstChild; 45 CXFA_LayoutItem* pNode = pLayoutItem->m_pFirstChild;
46 CXFA_FFNotify* pNotify = 46 CXFA_FFNotify* pNotify =
47 pLayoutItem->m_pFormNode->GetDocument()->GetParser()->GetNotify(); 47 pLayoutItem->m_pFormNode->GetDocument()->GetParser()->GetNotify();
48 CXFA_LayoutProcessor* pDocLayout = 48 CXFA_LayoutProcessor* pDocLayout =
49 pLayoutItem->m_pFormNode->GetDocument()->GetDocLayout(); 49 pLayoutItem->m_pFormNode->GetDocument()->GetDocLayout();
50 while (pNode) { 50 while (pNode) {
51 CXFA_LayoutItem* pNext = pNode->m_pNextSibling; 51 CXFA_LayoutItem* pNext = pNode->m_pNextSibling;
52 pNode->m_pParent = nullptr; 52 pNode->m_pParent = nullptr;
53 pNotify->OnLayoutEvent(pDocLayout, static_cast<CXFA_LayoutItem*>(pNode), 53 pNotify->OnLayoutItemRemoving(pDocLayout,
54 XFA_LAYOUTEVENT_ItemRemoving); 54 static_cast<CXFA_LayoutItem*>(pNode));
55 XFA_ReleaseLayoutItem(pNode); 55 XFA_ReleaseLayoutItem(pNode);
56 pNode = pNext; 56 pNode = pNext;
57 } 57 }
58 pNotify->OnLayoutEvent(pDocLayout, pLayoutItem, XFA_LAYOUTEVENT_ItemRemoving); 58 pNotify->OnLayoutItemRemoving(pDocLayout, pLayoutItem);
59 if (pLayoutItem->m_pFormNode->GetClassID() == XFA_ELEMENT_PageArea) { 59 if (pLayoutItem->m_pFormNode->GetClassID() == XFA_ELEMENT_PageArea) {
60 pNotify->OnPageEvent(static_cast<CXFA_ContainerLayoutItem*>(pLayoutItem), 60 pNotify->OnPageEvent(static_cast<CXFA_ContainerLayoutItem*>(pLayoutItem),
61 XFA_PAGEEVENT_PageRemoved); 61 XFA_PAGEVIEWEVENT_PostRemoved);
62 } 62 }
63 delete pLayoutItem; 63 delete pLayoutItem;
64 } 64 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_document_imp.cpp ('k') | xfa/fxfa/parser/xfa_layout_itemlayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698