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

Side by Side Diff: xfa/fxfa/app/xfa_ffnotify.cpp

Issue 1986503002: XFA_WIDGETSTATUS, LAYOUTSTATUS and WIDGETFILTER cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_fffield.cpp ('k') | xfa/fxfa/app/xfa_ffpageview.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()->WidgetPostAdd(pWidget, pWidget->GetDataAcc()); 484 m_pDoc->GetDocProvider()->WidgetPostAdd(pWidget, pWidget->GetDataAcc());
485 } 485 }
486 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End || 486 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End ||
487 !(dwStatus & XFA_WIDGETSTATUS_Visible)) { 487 !(dwStatus & XFA_WidgetStatus_Visible)) {
488 return; 488 return;
489 } 489 }
490 if (pWidget->IsLoaded()) { 490 if (pWidget->IsLoaded()) {
491 CFX_RectF rtOld; 491 CFX_RectF rtOld;
492 pWidget->GetWidgetRect(rtOld); 492 pWidget->GetWidgetRect(rtOld);
493 if (rtOld != pWidget->ReCacheWidgetRect()) 493 if (rtOld != pWidget->ReCacheWidgetRect())
494 pWidget->PerformLayout(); 494 pWidget->PerformLayout();
495 } else { 495 } else {
496 pWidget->LoadWidget(); 496 pWidget->LoadWidget();
497 } 497 }
498 pWidget->AddInvalidateRect(nullptr); 498 pWidget->AddInvalidateRect(nullptr);
499 } 499 }
500 500
501 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout, 501 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout,
502 CXFA_LayoutItem* pSender) { 502 CXFA_LayoutItem* pSender) {
503 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); 503 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout);
504 if (!pDocView) 504 if (!pDocView)
505 return; 505 return;
506 506
507 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); 507 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender);
508 if (!pWidget) 508 if (!pWidget)
509 return; 509 return;
510 510
511 pDocView->DeleteLayoutItem(pWidget); 511 pDocView->DeleteLayoutItem(pWidget);
512 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); 512 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc());
513 pWidget->AddInvalidateRect(nullptr); 513 pWidget->AddInvalidateRect(nullptr);
514 } 514 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_fffield.cpp ('k') | xfa/fxfa/app/xfa_ffpageview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698