From b1a59597db4b8ce3ffc34dbfda2fb1ecb80c2397 Mon Sep 17 00:00:00 2001 From: thestig Date: Thu, 14 Apr 2016 18:29:56 -0700 Subject: Simplify XFA event handling. - Avoid casting to void* - Don't bother firing events that no one listens for Review URL: https://codereview.chromium.org/1890563003 --- xfa/fxfa/parser/xfa_layout_itemlayout.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/xfa_layout_itemlayout.cpp') diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index 6553dc07cc..17f97da779 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -561,8 +561,7 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::ExtractLayoutItem() { CXFA_ContentLayoutItem* pOldLayoutItem = m_pOldLayoutItem; while (pOldLayoutItem) { CXFA_ContentLayoutItem* pNextOldLayoutItem = pOldLayoutItem->m_pNext; - pNotify->OnLayoutEvent(pDocLayout, pOldLayoutItem, - XFA_LAYOUTEVENT_ItemRemoving); + pNotify->OnLayoutItemRemoving(pDocLayout, pOldLayoutItem); delete pOldLayoutItem; pOldLayoutItem = pNextOldLayoutItem; } @@ -630,8 +629,7 @@ static void XFA_DeleteLayoutGeneratedNode(CXFA_Node* pGenerateNode) { CXFA_ContentLayoutItem* pNextLayoutItem = NULL; while (pCurLayoutItem) { pNextLayoutItem = pCurLayoutItem->m_pNext; - pNotify->OnLayoutEvent(pDocLayout, pCurLayoutItem, - XFA_LAYOUTEVENT_ItemRemoving); + pNotify->OnLayoutItemRemoving(pDocLayout, pCurLayoutItem); delete pCurLayoutItem; pCurLayoutItem = pNextLayoutItem; } @@ -1868,7 +1866,7 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseBinds(CXFA_Node* pFormNode) { pNode->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); } } - pNode->SetFlag(XFA_NODEFLAG_UnusedNode); + pNode->SetFlag(XFA_NODEFLAG_UnusedNode, true); } } void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow( -- cgit v1.2.3