| OLD | NEW |
| 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 Loading... |
| 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_PAGEEVENT_PageRemoved); |
| 62 } | 62 } |
| 63 delete pLayoutItem; | 63 delete pLayoutItem; |
| 64 } | 64 } |
| OLD | NEW |