| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fxfa/app/xfa_ffnotify.h" | 7 #include "xfa/fxfa/app/xfa_ffnotify.h" |
| 8 | 8 |
| 9 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 9 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
| 10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" | 10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 static void XFA_FFDeleteWidgetAcc(void* pData) { | 33 static void XFA_FFDeleteWidgetAcc(void* pData) { |
| 34 delete static_cast<CXFA_WidgetAcc*>(pData); | 34 delete static_cast<CXFA_WidgetAcc*>(pData); |
| 35 } | 35 } |
| 36 | 36 |
| 37 static XFA_MAPDATABLOCKCALLBACKINFO gs_XFADeleteWidgetAcc = { | 37 static XFA_MAPDATABLOCKCALLBACKINFO gs_XFADeleteWidgetAcc = { |
| 38 XFA_FFDeleteWidgetAcc, nullptr}; | 38 XFA_FFDeleteWidgetAcc, nullptr}; |
| 39 | 39 |
| 40 CXFA_FFNotify::CXFA_FFNotify(CXFA_FFDoc* pDoc) : m_pDoc(pDoc) {} | 40 CXFA_FFNotify::CXFA_FFNotify(CXFA_FFDoc* pDoc) : m_pDoc(pDoc) {} |
| 41 CXFA_FFNotify::~CXFA_FFNotify() {} | 41 CXFA_FFNotify::~CXFA_FFNotify() {} |
| 42 |
| 42 void CXFA_FFNotify::OnPageEvent(CXFA_ContainerLayoutItem* pSender, | 43 void CXFA_FFNotify::OnPageEvent(CXFA_ContainerLayoutItem* pSender, |
| 43 XFA_PAGEEVENT eEvent, | 44 uint32_t dwEvent) { |
| 44 void* pParam) { | |
| 45 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pSender->GetLayout()); | 45 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pSender->GetLayout()); |
| 46 if (!pDocView) { | 46 if (pDocView) |
| 47 return; | 47 pDocView->OnPageEvent(pSender, dwEvent); |
| 48 } | |
| 49 pDocView->OnPageEvent(pSender, eEvent, (int32_t)(uintptr_t)pParam); | |
| 50 } | 48 } |
| 49 |
| 51 void CXFA_FFNotify::OnNodeEvent(CXFA_Node* pSender, | 50 void CXFA_FFNotify::OnNodeEvent(CXFA_Node* pSender, |
| 52 XFA_NODEEVENT eEvent, | 51 XFA_NODEEVENT eEvent, |
| 53 void* pParam, | 52 void* pParam, |
| 54 void* pParam2, | 53 void* pParam2, |
| 55 void* pParam3, | 54 void* pParam3, |
| 56 void* pParam4) { | 55 void* pParam4) { |
| 57 switch (eEvent) { | 56 switch (eEvent) { |
| 58 case XFA_NODEEVENT_Ready: | 57 case XFA_NODEEVENT_Ready: |
| 59 OnNodeReady(pSender); | 58 OnNodeReady(pSender); |
| 60 break; | 59 break; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 81 switch (dwEvent) { | 80 switch (dwEvent) { |
| 82 case XFA_WIDGETEVENT_ListItemAdded: { | 81 case XFA_WIDGETEVENT_ListItemAdded: { |
| 83 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) { | 82 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) { |
| 84 return; | 83 return; |
| 85 } | 84 } |
| 86 FX_BOOL bStaticNotify = pWidgetAcc->GetDocView()->IsStaticNotify(); | 85 FX_BOOL bStaticNotify = pWidgetAcc->GetDocView()->IsStaticNotify(); |
| 87 CXFA_FFWidget* pWidget = pWidgetAcc->GetNextWidget(NULL); | 86 CXFA_FFWidget* pWidget = pWidgetAcc->GetNextWidget(NULL); |
| 88 if (!pWidget) { | 87 if (!pWidget) { |
| 89 if (bStaticNotify) { | 88 if (bStaticNotify) { |
| 90 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( | 89 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( |
| 91 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam, | 90 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded); |
| 92 pAdditional); | |
| 93 } | 91 } |
| 94 return; | 92 return; |
| 95 } | 93 } |
| 96 while (pWidget) { | 94 while (pWidget) { |
| 97 if (pWidget->IsLoaded()) { | 95 if (pWidget->IsLoaded()) { |
| 98 if (pWidgetAcc->IsListBox()) { | 96 if (pWidgetAcc->IsListBox()) { |
| 99 static_cast<CXFA_FFListBox*>(pWidget) | 97 static_cast<CXFA_FFListBox*>(pWidget) |
| 100 ->InsertItem((const CFX_WideStringC&)(const FX_WCHAR*)pParam, | 98 ->InsertItem((const CFX_WideStringC&)(const FX_WCHAR*)pParam, |
| 101 (int32_t)(uintptr_t)pAdditional2); | 99 (int32_t)(uintptr_t)pAdditional2); |
| 102 } else { | 100 } else { |
| 103 static_cast<CXFA_FFComboBox*>(pWidget) | 101 static_cast<CXFA_FFComboBox*>(pWidget) |
| 104 ->InsertItem((const CFX_WideStringC&)(const FX_WCHAR*)pParam, | 102 ->InsertItem((const CFX_WideStringC&)(const FX_WCHAR*)pParam, |
| 105 (int32_t)(uintptr_t)pAdditional2); | 103 (int32_t)(uintptr_t)pAdditional2); |
| 106 } | 104 } |
| 107 } | 105 } |
| 108 if (bStaticNotify) { | 106 if (bStaticNotify) { |
| 109 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( | 107 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( |
| 110 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded, pParam, | 108 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemAdded); |
| 111 pAdditional); | |
| 112 } | 109 } |
| 113 pWidget = pWidgetAcc->GetNextWidget(pWidget); | 110 pWidget = pWidgetAcc->GetNextWidget(pWidget); |
| 114 } | 111 } |
| 115 } break; | 112 } break; |
| 116 case XFA_WIDGETEVENT_ListItemRemoved: { | 113 case XFA_WIDGETEVENT_ListItemRemoved: { |
| 117 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) { | 114 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) { |
| 118 return; | 115 return; |
| 119 } | 116 } |
| 120 FX_BOOL bStaticNotify = pWidgetAcc->GetDocView()->IsStaticNotify(); | 117 FX_BOOL bStaticNotify = pWidgetAcc->GetDocView()->IsStaticNotify(); |
| 121 CXFA_FFWidget* pWidget = pWidgetAcc->GetNextWidget(NULL); | 118 CXFA_FFWidget* pWidget = pWidgetAcc->GetNextWidget(NULL); |
| 122 if (!pWidget) { | 119 if (!pWidget) { |
| 123 if (bStaticNotify) { | 120 if (bStaticNotify) { |
| 124 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( | 121 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( |
| 125 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, | 122 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved); |
| 126 pAdditional); | |
| 127 } | 123 } |
| 128 return; | 124 return; |
| 129 } | 125 } |
| 130 while (pWidget) { | 126 while (pWidget) { |
| 131 if (pWidget->IsLoaded()) { | 127 if (pWidget->IsLoaded()) { |
| 132 if (pWidgetAcc->IsListBox()) { | 128 if (pWidgetAcc->IsListBox()) { |
| 133 static_cast<CXFA_FFListBox*>(pWidget) | 129 static_cast<CXFA_FFListBox*>(pWidget) |
| 134 ->DeleteItem((int32_t)(uintptr_t)pParam); | 130 ->DeleteItem((int32_t)(uintptr_t)pParam); |
| 135 } else { | 131 } else { |
| 136 static_cast<CXFA_FFComboBox*>(pWidget) | 132 static_cast<CXFA_FFComboBox*>(pWidget) |
| 137 ->DeleteItem((int32_t)(uintptr_t)pParam); | 133 ->DeleteItem((int32_t)(uintptr_t)pParam); |
| 138 } | 134 } |
| 139 } | 135 } |
| 140 if (bStaticNotify) { | 136 if (bStaticNotify) { |
| 141 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( | 137 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( |
| 142 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, | 138 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved); |
| 143 pAdditional); | |
| 144 } | 139 } |
| 145 pWidget = pWidgetAcc->GetNextWidget(pWidget); | 140 pWidget = pWidgetAcc->GetNextWidget(pWidget); |
| 146 } | 141 } |
| 147 } break; | 142 } break; |
| 148 } | 143 } |
| 149 } | 144 } |
| 150 CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) { | 145 CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) { |
| 151 CXFA_LayoutProcessor* pLayout = m_pDoc->GetXFADoc()->GetDocLayout(); | 146 CXFA_LayoutProcessor* pLayout = m_pDoc->GetXFADoc()->GetDocLayout(); |
| 152 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); | 147 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); |
| 153 XFA_ELEMENT eType = pNode->GetClassID(); | 148 XFA_ELEMENT eType = pNode->GetClassID(); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 default: | 221 default: |
| 227 pWidget = NULL; | 222 pWidget = NULL; |
| 228 break; | 223 break; |
| 229 } | 224 } |
| 230 if (!pWidget) { | 225 if (!pWidget) { |
| 231 return NULL; | 226 return NULL; |
| 232 } | 227 } |
| 233 pWidget->SetDocView(pDocView); | 228 pWidget->SetDocView(pDocView); |
| 234 return pWidget; | 229 return pWidget; |
| 235 } | 230 } |
| 236 void CXFA_FFNotify::OnLayoutEvent(CXFA_LayoutProcessor* pLayout, | 231 |
| 237 CXFA_LayoutItem* pSender, | |
| 238 XFA_LAYOUTEVENT eEvent, | |
| 239 void* pParam, | |
| 240 void* pParam2) { | |
| 241 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); | |
| 242 if (!pDocView || !XFA_GetWidgetFromLayoutItem(pSender)) { | |
| 243 return; | |
| 244 } | |
| 245 switch (eEvent) { | |
| 246 case XFA_LAYOUTEVENT_ItemAdded: | |
| 247 OnLayoutItemAdd(pDocView, pLayout, pSender, pParam, pParam2); | |
| 248 break; | |
| 249 case XFA_LAYOUTEVENT_ItemRemoving: | |
| 250 OnLayoutItemRemoving(pDocView, pLayout, pSender, pParam, pParam2); | |
| 251 break; | |
| 252 case XFA_LAYOUTEVENT_RectChanged: | |
| 253 OnLayoutItemRectChanged(pDocView, pLayout, pSender, pParam, pParam2); | |
| 254 break; | |
| 255 case XFA_LAYOUTEVENT_StatusChanged: | |
| 256 OnLayoutItemStatustChanged(pDocView, pLayout, pSender, pParam, pParam2); | |
| 257 break; | |
| 258 } | |
| 259 } | |
| 260 void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem, | 232 void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem, |
| 261 FX_FLOAT& fCalcWidth, | 233 FX_FLOAT& fCalcWidth, |
| 262 FX_FLOAT& fCalcHeight) { | 234 FX_FLOAT& fCalcHeight) { |
| 263 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData()); | 235 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData()); |
| 264 if (!pAcc) { | 236 if (!pAcc) { |
| 265 return; | 237 return; |
| 266 } | 238 } |
| 267 pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight); | 239 pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight); |
| 268 } | 240 } |
| 269 FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, | 241 FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 bUpdateProperty = TRUE; | 459 bUpdateProperty = TRUE; |
| 488 break; | 460 break; |
| 489 case XFA_ELEMENT_Font: | 461 case XFA_ELEMENT_Font: |
| 490 case XFA_ELEMENT_Margin: | 462 case XFA_ELEMENT_Margin: |
| 491 case XFA_ELEMENT_Value: | 463 case XFA_ELEMENT_Value: |
| 492 case XFA_ELEMENT_Items: | 464 case XFA_ELEMENT_Items: |
| 493 break; | 465 break; |
| 494 default: | 466 default: |
| 495 break; | 467 break; |
| 496 } | 468 } |
| 497 if (bIsContainerNode && eAttr == XFA_ATTRIBUTE_Access) { | 469 if (bIsContainerNode && eAttr == XFA_ATTRIBUTE_Access) |
| 498 bUpdateProperty = TRUE; | 470 bUpdateProperty = TRUE; |
| 499 FX_BOOL bNotify = pDocView->IsStaticNotify(); | 471 |
| 500 if (bNotify) { | |
| 501 pWidgetAcc->NotifyEvent(XFA_WIDGETEVENT_AccessChanged, NULL, pParam2, | |
| 502 NULL); | |
| 503 } | |
| 504 } | |
| 505 if (eAttr == XFA_ATTRIBUTE_Value) { | 472 if (eAttr == XFA_ATTRIBUTE_Value) { |
| 506 pDocView->AddCalculateNodeNotify(pSender); | 473 pDocView->AddCalculateNodeNotify(pSender); |
| 507 if (ePType == XFA_ELEMENT_Value || bIsContainerNode) { | 474 if (ePType == XFA_ELEMENT_Value || bIsContainerNode) { |
| 508 FX_BOOL bNotify = pDocView->IsStaticNotify(); | |
| 509 if (bIsContainerNode) { | 475 if (bIsContainerNode) { |
| 510 pWidgetAcc->UpdateUIDisplay(); | 476 pWidgetAcc->UpdateUIDisplay(); |
| 511 pDocView->AddCalculateWidgetAcc(pWidgetAcc); | 477 pDocView->AddCalculateWidgetAcc(pWidgetAcc); |
| 512 pDocView->AddValidateWidget(pWidgetAcc); | 478 pDocView->AddValidateWidget(pWidgetAcc); |
| 513 } else if (pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent) | 479 } else if (pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent) |
| 514 ->GetClassID() == XFA_ELEMENT_ExclGroup) { | 480 ->GetClassID() == XFA_ELEMENT_ExclGroup) { |
| 515 pWidgetAcc->UpdateUIDisplay(); | 481 pWidgetAcc->UpdateUIDisplay(); |
| 516 } | 482 } |
| 517 if (bNotify) { | |
| 518 pWidgetAcc->NotifyEvent(XFA_WIDGETEVENT_PostContentChanged, NULL, | |
| 519 NULL, NULL); | |
| 520 } | |
| 521 return; | 483 return; |
| 522 } | 484 } |
| 523 } | 485 } |
| 524 CXFA_FFWidget* pWidget = NULL; | 486 CXFA_FFWidget* pWidget = NULL; |
| 525 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { | 487 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { |
| 526 if (!pWidget->IsLoaded()) { | 488 if (!pWidget->IsLoaded()) { |
| 527 continue; | 489 continue; |
| 528 } | 490 } |
| 529 if (bUpdateProperty) { | 491 if (bUpdateProperty) { |
| 530 pWidget->UpdateWidgetProperty(); | 492 pWidget->UpdateWidgetProperty(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 560 void* pParam2) { | 522 void* pParam2) { |
| 561 if (CXFA_FFDocView* pDocView = m_pDoc->GetDocView()) { | 523 if (CXFA_FFDocView* pDocView = m_pDoc->GetDocView()) { |
| 562 FX_BOOL bLayoutReady = | 524 FX_BOOL bLayoutReady = |
| 563 !(pDocView->m_bInLayoutStatus) && | 525 !(pDocView->m_bInLayoutStatus) && |
| 564 (pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End); | 526 (pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End); |
| 565 if (bLayoutReady) { | 527 if (bLayoutReady) { |
| 566 m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc); | 528 m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc); |
| 567 } | 529 } |
| 568 } | 530 } |
| 569 } | 531 } |
| 570 void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, | 532 void CXFA_FFNotify::OnLayoutItemAdd(CXFA_LayoutProcessor* pLayout, |
| 571 CXFA_LayoutProcessor* pLayout, | |
| 572 CXFA_LayoutItem* pSender, | 533 CXFA_LayoutItem* pSender, |
| 573 void* pParam, | 534 int32_t iPageIdx, |
| 574 void* pParam2) { | 535 uint32_t dwStatus) { |
| 575 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | 536 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); |
| 576 int32_t iPageIdx = (int32_t)(uintptr_t)pParam; | 537 if (!pDocView) |
| 538 return; |
| 539 |
| 540 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
| 541 if (!pWidget) |
| 542 return; |
| 543 |
| 577 CXFA_FFPageView* pNewPageView = pDocView->GetPageView(iPageIdx); | 544 CXFA_FFPageView* pNewPageView = pDocView->GetPageView(iPageIdx); |
| 578 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam2; | |
| 579 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | | 545 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | |
| 580 XFA_WIDGETSTATUS_Printable; | 546 XFA_WIDGETSTATUS_Printable; |
| 581 pWidget->ModifyStatus(dwStatus, dwFilter); | 547 pWidget->ModifyStatus(dwStatus, dwFilter); |
| 582 CXFA_FFPageView* pPrePageView = pWidget->GetPageView(); | 548 CXFA_FFPageView* pPrePageView = pWidget->GetPageView(); |
| 583 if (pPrePageView != pNewPageView || | 549 if (pPrePageView != pNewPageView || |
| 584 (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == | 550 (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == |
| 585 (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) { | 551 (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) { |
| 586 pWidget->SetPageView(pNewPageView); | 552 pWidget->SetPageView(pNewPageView); |
| 587 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), | 553 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), |
| 588 XFA_WIDGETEVENT_PostAdded, | 554 XFA_WIDGETEVENT_PostAdded); |
| 589 pNewPageView, pPrePageView); | |
| 590 } | 555 } |
| 591 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End || | 556 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End || |
| 592 !(dwStatus & XFA_WIDGETSTATUS_Visible)) { | 557 !(dwStatus & XFA_WIDGETSTATUS_Visible)) { |
| 593 return; | 558 return; |
| 594 } | 559 } |
| 595 if (pWidget->IsLoaded()) { | 560 if (pWidget->IsLoaded()) { |
| 596 CFX_RectF rtOld; | 561 CFX_RectF rtOld; |
| 597 pWidget->GetWidgetRect(rtOld); | 562 pWidget->GetWidgetRect(rtOld); |
| 598 if (rtOld != pWidget->ReCacheWidgetRect()) | 563 if (rtOld != pWidget->ReCacheWidgetRect()) |
| 599 pWidget->PerformLayout(); | 564 pWidget->PerformLayout(); |
| 600 } else { | 565 } else { |
| 601 pWidget->LoadWidget(); | 566 pWidget->LoadWidget(); |
| 602 } | 567 } |
| 603 pWidget->AddInvalidateRect(nullptr); | 568 pWidget->AddInvalidateRect(nullptr); |
| 604 } | 569 } |
| 605 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView, | 570 |
| 606 CXFA_LayoutProcessor* pLayout, | 571 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout, |
| 607 CXFA_LayoutItem* pSender, | 572 CXFA_LayoutItem* pSender) { |
| 608 void* pParam, | 573 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); |
| 609 void* pParam2) { | 574 if (!pDocView) |
| 610 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | 575 return; |
| 576 |
| 577 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
| 578 if (!pWidget) |
| 579 return; |
| 580 |
| 611 pDocView->DeleteLayoutItem(pWidget); | 581 pDocView->DeleteLayoutItem(pWidget); |
| 612 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), | 582 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), |
| 613 XFA_WIDGETEVENT_PreRemoved, nullptr, | 583 XFA_WIDGETEVENT_PreRemoved); |
| 614 pWidget->GetPageView()); | |
| 615 pWidget->AddInvalidateRect(nullptr); | 584 pWidget->AddInvalidateRect(nullptr); |
| 616 } | 585 } |
| 617 void CXFA_FFNotify::OnLayoutItemRectChanged(CXFA_FFDocView* pDocView, | |
| 618 CXFA_LayoutProcessor* pLayout, | |
| 619 CXFA_LayoutItem* pSender, | |
| 620 void* pParam, | |
| 621 void* pParam2) {} | |
| 622 void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView, | |
| 623 CXFA_LayoutProcessor* pLayout, | |
| 624 CXFA_LayoutItem* pSender, | |
| 625 void* pParam, | |
| 626 void* pParam2) { | |
| 627 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | |
| 628 if (!pWidget) { | |
| 629 return; | |
| 630 } | |
| 631 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam; | |
| 632 if (dwStatus == 0) { | |
| 633 CXFA_LayoutItem* pPreItem = pSender->GetPrev(); | |
| 634 if (pPreItem) { | |
| 635 CXFA_FFWidget* pPreWidget = static_cast<CXFA_FFWidget*>(pPreItem); | |
| 636 if (pPreWidget) { | |
| 637 dwStatus = pPreWidget->GetStatus(); | |
| 638 } | |
| 639 } | |
| 640 } | |
| 641 uint32_t dwOldStatus = pWidget->GetStatus(); | |
| 642 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | | |
| 643 XFA_WIDGETSTATUS_Printable; | |
| 644 if ((dwOldStatus & dwFilter) == dwStatus) { | |
| 645 return; | |
| 646 } | |
| 647 pWidget->ModifyStatus(dwStatus, dwFilter); | |
| 648 } | |
| OLD | NEW |