summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-04-14 18:29:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-14 18:29:56 -0700
commitb1a59597db4b8ce3ffc34dbfda2fb1ecb80c2397 (patch)
tree4bef693fc2b5722a86d75ee6110da8c9d5530f6d /xfa/fxfa/parser/xfa_layout_itemlayout.cpp
parentb1c80fb8b843a2a345b2cd6005e591dc731355f4 (diff)
downloadpdfium-b1a59597db4b8ce3ffc34dbfda2fb1ecb80c2397.tar.xz
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
Diffstat (limited to 'xfa/fxfa/parser/xfa_layout_itemlayout.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_layout_itemlayout.cpp8
1 files changed, 3 insertions, 5 deletions
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(