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

Unified Diff: xfa/fxfa/app/xfa_ffwidgetacc.cpp

Issue 1890563003: Simplify XFA event handling. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Events / params ignored by CPDFXFA_Document::WidgetEvent(). 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 side-by-side diff with in-line comments
Download patch
Index: xfa/fxfa/app/xfa_ffwidgetacc.cpp
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index fba296cde7ac16f9c4e3ba800f7c816923933bbe..ecc981cc3b5d496fa5174a750adbb8a817c9e8e5 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -378,13 +378,8 @@ int32_t CXFA_WidgetAcc::ProcessCalculate() {
int32_t iRet = ExecuteScript(script, &EventParam);
if (iRet == XFA_EVENTERROR_Success) {
Tom Sepez 2016/04/14 22:08:55 nit: might prefer early return.
Lei Zhang 2016/04/15 01:16:40 Done.
if (GetRawValue() != EventParam.m_wsResult) {
- const bool bNotify = GetDoc()->GetDocType() == XFA_DOCTYPE_Static;
SetValue(EventParam.m_wsResult, XFA_VALUEPICTURE_Raw);
UpdateUIDisplay();
- if (bNotify) {
- NotifyEvent(XFA_WIDGETEVENT_PostContentChanged, NULL, NULL, NULL);
- }
- iRet = XFA_EVENTERROR_Success;
}
}
return iRet;
@@ -751,25 +746,7 @@ void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) {
pWidget->AddInvalidateRect();
}
}
-void CXFA_WidgetAcc::NotifyEvent(uint32_t dwEvent,
- CXFA_FFWidget* pWidget,
- void* pParam,
- void* pAdditional) {
- IXFA_DocProvider* pDocProvider = GetDoc()->GetDocProvider();
- if (pWidget) {
- pDocProvider->WidgetEvent(pWidget, this, dwEvent, pParam, pAdditional);
- } else {
- pWidget = GetNextWidget(pWidget);
- if (pWidget == NULL) {
- pDocProvider->WidgetEvent(NULL, this, dwEvent, pParam, pAdditional);
- return;
- }
- while (pWidget) {
- pDocProvider->WidgetEvent(pWidget, this, dwEvent, pParam, pAdditional);
- pWidget = GetNextWidget(pWidget);
- }
- }
-}
+
void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
CXFA_Caption caption = GetCaption();
if (!caption || caption.GetPresence() != XFA_ATTRIBUTEENUM_Visible) {

Powered by Google App Engine
This is Rietveld 408576698