| Index: xfa/fxfa/app/xfa_ffnotify.cpp
|
| diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp
|
| index ac4cc27f8d4672465a1fde85bba61665091d2eef..77a9ce6e86b8aec0b2aa33594401753af80ab9cb 100644
|
| --- a/xfa/fxfa/app/xfa_ffnotify.cpp
|
| +++ b/xfa/fxfa/app/xfa_ffnotify.cpp
|
| @@ -88,8 +88,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender,
|
| if (!pWidget) {
|
| if (bStaticNotify) {
|
| pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(
|
| - pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam,
|
| - pAdditional);
|
| + pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded);
|
| }
|
| return;
|
| }
|
| @@ -107,8 +106,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender,
|
| }
|
| if (bStaticNotify) {
|
| pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(
|
| - pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam,
|
| - pAdditional);
|
| + pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded);
|
| }
|
| pWidget = pWidgetAcc->GetNextWidget(pWidget);
|
| }
|
| @@ -122,8 +120,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender,
|
| if (!pWidget) {
|
| if (bStaticNotify) {
|
| pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(
|
| - pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam,
|
| - pAdditional);
|
| + pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved);
|
| }
|
| return;
|
| }
|
| @@ -139,8 +136,7 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender,
|
| }
|
| if (bStaticNotify) {
|
| pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent(
|
| - pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam,
|
| - pAdditional);
|
| + pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved);
|
| }
|
| pWidget = pWidgetAcc->GetNextWidget(pWidget);
|
| }
|
| @@ -233,30 +229,7 @@ CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) {
|
| pWidget->SetDocView(pDocView);
|
| return pWidget;
|
| }
|
| -void CXFA_FFNotify::OnLayoutEvent(CXFA_LayoutProcessor* pLayout,
|
| - CXFA_LayoutItem* pSender,
|
| - XFA_LAYOUTEVENT eEvent,
|
| - void* pParam,
|
| - void* pParam2) {
|
| - CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout);
|
| - if (!pDocView || !XFA_GetWidgetFromLayoutItem(pSender)) {
|
| - return;
|
| - }
|
| - switch (eEvent) {
|
| - case XFA_LAYOUTEVENT_ItemAdded:
|
| - OnLayoutItemAdd(pDocView, pLayout, pSender, pParam, pParam2);
|
| - break;
|
| - case XFA_LAYOUTEVENT_ItemRemoving:
|
| - OnLayoutItemRemoving(pDocView, pLayout, pSender, pParam, pParam2);
|
| - break;
|
| - case XFA_LAYOUTEVENT_RectChanged:
|
| - OnLayoutItemRectChanged(pDocView, pLayout, pSender, pParam, pParam2);
|
| - break;
|
| - case XFA_LAYOUTEVENT_StatusChanged:
|
| - OnLayoutItemStatustChanged(pDocView, pLayout, pSender, pParam, pParam2);
|
| - break;
|
| - }
|
| -}
|
| +
|
| void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem,
|
| FX_FLOAT& fCalcWidth,
|
| FX_FLOAT& fCalcHeight) {
|
| @@ -494,18 +467,12 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender,
|
| default:
|
| break;
|
| }
|
| - if (bIsContainerNode && eAttr == XFA_ATTRIBUTE_Access) {
|
| + if (bIsContainerNode && eAttr == XFA_ATTRIBUTE_Access)
|
| bUpdateProperty = TRUE;
|
| - FX_BOOL bNotify = pDocView->IsStaticNotify();
|
| - if (bNotify) {
|
| - pWidgetAcc->NotifyEvent(XFA_WIDGETEVENT_AccessChanged, NULL, pParam2,
|
| - NULL);
|
| - }
|
| - }
|
| +
|
| if (eAttr == XFA_ATTRIBUTE_Value) {
|
| pDocView->AddCalculateNodeNotify(pSender);
|
| if (ePType == XFA_ELEMENT_Value || bIsContainerNode) {
|
| - FX_BOOL bNotify = pDocView->IsStaticNotify();
|
| if (bIsContainerNode) {
|
| pWidgetAcc->UpdateUIDisplay();
|
| pDocView->AddCalculateWidgetAcc(pWidgetAcc);
|
| @@ -514,10 +481,6 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender,
|
| ->GetClassID() == XFA_ELEMENT_ExclGroup) {
|
| pWidgetAcc->UpdateUIDisplay();
|
| }
|
| - if (bNotify) {
|
| - pWidgetAcc->NotifyEvent(XFA_WIDGETEVENT_PostContentChanged, NULL,
|
| - NULL, NULL);
|
| - }
|
| return;
|
| }
|
| }
|
| @@ -567,15 +530,19 @@ void CXFA_FFNotify::OnChildRemoved(CXFA_Node* pSender,
|
| }
|
| }
|
| }
|
| -void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView,
|
| - CXFA_LayoutProcessor* pLayout,
|
| +void CXFA_FFNotify::OnLayoutItemAdd(CXFA_LayoutProcessor* pLayout,
|
| CXFA_LayoutItem* pSender,
|
| - void* pParam,
|
| - void* pParam2) {
|
| - CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender);
|
| - int32_t iPageIdx = (int32_t)(uintptr_t)pParam;
|
| + int32_t iPageIdx,
|
| + uint32_t dwStatus) {
|
| + CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout);
|
| + if (!pDocView)
|
| + return;
|
| +
|
| + CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender);
|
| + if (!pWidget)
|
| + return;
|
| +
|
| CXFA_FFPageView* pNewPageView = pDocView->GetPageView(iPageIdx);
|
| - uint32_t dwStatus = (uint32_t)(uintptr_t)pParam2;
|
| uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable |
|
| XFA_WIDGETSTATUS_Printable;
|
| pWidget->ModifyStatus(dwStatus, dwFilter);
|
| @@ -585,8 +552,7 @@ void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView,
|
| (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) {
|
| pWidget->SetPageView(pNewPageView);
|
| m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(),
|
| - XFA_WIDGETEVENT_PostAdded,
|
| - pNewPageView, pPrePageView);
|
| + XFA_WIDGETEVENT_PostAdded);
|
| }
|
| if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End ||
|
| !(dwStatus & XFA_WIDGETSTATUS_Visible)) {
|
| @@ -602,47 +568,19 @@ void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView,
|
| }
|
| pWidget->AddInvalidateRect(nullptr);
|
| }
|
| -void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView,
|
| - CXFA_LayoutProcessor* pLayout,
|
| - CXFA_LayoutItem* pSender,
|
| - void* pParam,
|
| - void* pParam2) {
|
| - CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender);
|
| +
|
| +void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout,
|
| + CXFA_LayoutItem* pSender) {
|
| + CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout);
|
| + if (!pDocView)
|
| + return;
|
| +
|
| + CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender);
|
| + if (!pWidget)
|
| + return;
|
| +
|
| pDocView->DeleteLayoutItem(pWidget);
|
| m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(),
|
| - XFA_WIDGETEVENT_PreRemoved, nullptr,
|
| - pWidget->GetPageView());
|
| + XFA_WIDGETEVENT_PreRemoved);
|
| pWidget->AddInvalidateRect(nullptr);
|
| }
|
| -void CXFA_FFNotify::OnLayoutItemRectChanged(CXFA_FFDocView* pDocView,
|
| - CXFA_LayoutProcessor* pLayout,
|
| - CXFA_LayoutItem* pSender,
|
| - void* pParam,
|
| - void* pParam2) {}
|
| -void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView,
|
| - CXFA_LayoutProcessor* pLayout,
|
| - CXFA_LayoutItem* pSender,
|
| - void* pParam,
|
| - void* pParam2) {
|
| - CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender);
|
| - if (!pWidget) {
|
| - return;
|
| - }
|
| - uint32_t dwStatus = (uint32_t)(uintptr_t)pParam;
|
| - if (dwStatus == 0) {
|
| - CXFA_LayoutItem* pPreItem = pSender->GetPrev();
|
| - if (pPreItem) {
|
| - CXFA_FFWidget* pPreWidget = static_cast<CXFA_FFWidget*>(pPreItem);
|
| - if (pPreWidget) {
|
| - dwStatus = pPreWidget->GetStatus();
|
| - }
|
| - }
|
| - }
|
| - uint32_t dwOldStatus = pWidget->GetStatus();
|
| - uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable |
|
| - XFA_WIDGETSTATUS_Printable;
|
| - if ((dwOldStatus & dwFilter) == dwStatus) {
|
| - return;
|
| - }
|
| - pWidget->ModifyStatus(dwStatus, dwFilter);
|
| -}
|
|
|