summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_widgetdata.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/cxfa_widgetdata.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/cxfa_widgetdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index e75eef8916..a702527347 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -927,9 +927,8 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel,
if (!bNotify)
return;
- m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(
- this, XFA_WIDGETEVENT_ListItemAdded, (void*)wsLabel.c_str(),
- (void*)wsValue.c_str(), (void*)(uintptr_t)nIndex);
+ m_pNode->GetDocument()->GetNotify()->OnWidgetListItemAdded(
+ this, wsLabel.c_str(), wsValue.c_str(), nIndex);
}
void CXFA_WidgetData::GetItemLabel(const CFX_WideStringC& wsValue,
@@ -1053,11 +1052,8 @@ FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex,
}
}
}
- if (!bNotify)
- return TRUE;
-
- m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(
- this, XFA_WIDGETEVENT_ListItemRemoved, (void*)(uintptr_t)nIndex);
+ if (bNotify)
+ m_pNode->GetDocument()->GetNotify()->OnWidgetListItemRemoved(this, nIndex);
return TRUE;
}