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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 uint32_t dwStatus) { | 466 uint32_t dwStatus) { |
467 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); | 467 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); |
468 if (!pDocView) | 468 if (!pDocView) |
469 return; | 469 return; |
470 | 470 |
471 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); | 471 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
472 if (!pWidget) | 472 if (!pWidget) |
473 return; | 473 return; |
474 | 474 |
475 CXFA_FFPageView* pNewPageView = pDocView->GetPageView(iPageIdx); | 475 CXFA_FFPageView* pNewPageView = pDocView->GetPageView(iPageIdx); |
476 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | | 476 uint32_t dwFilter = XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable | |
477 XFA_WIDGETSTATUS_Printable; | 477 XFA_WidgetStatus_Printable; |
478 pWidget->ModifyStatus(dwStatus, dwFilter); | 478 pWidget->ModifyStatus(dwStatus, dwFilter); |
479 CXFA_FFPageView* pPrePageView = pWidget->GetPageView(); | 479 CXFA_FFPageView* pPrePageView = pWidget->GetPageView(); |
480 if (pPrePageView != pNewPageView || | 480 if (pPrePageView != pNewPageView || |
481 (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == | 481 (dwStatus & (XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable)) == |
482 (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) { | 482 (XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable)) { |
483 pWidget->SetPageView(pNewPageView); | 483 pWidget->SetPageView(pNewPageView); |
484 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), | 484 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), |
485 XFA_WIDGETEVENT_PostAdded); | 485 XFA_WIDGETEVENT_PostAdded); |
486 } | 486 } |
487 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End || | 487 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End || |
488 !(dwStatus & XFA_WIDGETSTATUS_Visible)) { | 488 !(dwStatus & XFA_WidgetStatus_Visible)) { |
489 return; | 489 return; |
490 } | 490 } |
491 if (pWidget->IsLoaded()) { | 491 if (pWidget->IsLoaded()) { |
492 CFX_RectF rtOld; | 492 CFX_RectF rtOld; |
493 pWidget->GetWidgetRect(rtOld); | 493 pWidget->GetWidgetRect(rtOld); |
494 if (rtOld != pWidget->ReCacheWidgetRect()) | 494 if (rtOld != pWidget->ReCacheWidgetRect()) |
495 pWidget->PerformLayout(); | 495 pWidget->PerformLayout(); |
496 } else { | 496 } else { |
497 pWidget->LoadWidget(); | 497 pWidget->LoadWidget(); |
498 } | 498 } |
499 pWidget->AddInvalidateRect(nullptr); | 499 pWidget->AddInvalidateRect(nullptr); |
500 } | 500 } |
501 | 501 |
502 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout, | 502 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout, |
503 CXFA_LayoutItem* pSender) { | 503 CXFA_LayoutItem* pSender) { |
504 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); | 504 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); |
505 if (!pDocView) | 505 if (!pDocView) |
506 return; | 506 return; |
507 | 507 |
508 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); | 508 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
509 if (!pWidget) | 509 if (!pWidget) |
510 return; | 510 return; |
511 | 511 |
512 pDocView->DeleteLayoutItem(pWidget); | 512 pDocView->DeleteLayoutItem(pWidget); |
513 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), | 513 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), |
514 XFA_WIDGETEVENT_PreRemoved); | 514 XFA_WIDGETEVENT_PreRemoved); |
515 pWidget->AddInvalidateRect(nullptr); | 515 pWidget->AddInvalidateRect(nullptr); |
516 } | 516 } |
OLD | NEW |