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

Unified Diff: xfa/src/fxfa/src/app/xfa_ffnotify.cpp

Issue 1668813002: Fix an assertion failure in CXFA_DefFontMgr::GetDefaultFont() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 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/src/fxfa/src/app/xfa_ffnotify.cpp
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
index 9dd93f387a90343551b35f07ce7fa8fe9505aa2a..ebd9d06a6e6010b184169bf0b3276c02ced607f1 100644
--- a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
@@ -551,7 +551,7 @@ void CXFA_FFNotify::OnChildAdded(CXFA_Node* pSender,
}
FX_BOOL bLayoutReady =
!(pDocView->m_bInLayoutStatus) &&
- (pDocView->GetLayoutStatus() >= XFA_DOCVIEW_LAYOUTSTATUS_End);
+ (pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End);
if (bLayoutReady) {
m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc);
}
@@ -562,7 +562,7 @@ void CXFA_FFNotify::OnChildRemoved(CXFA_Node* pSender,
if (CXFA_FFDocView* pDocView = m_pDoc->GetDocView()) {
FX_BOOL bLayoutReady =
!(pDocView->m_bInLayoutStatus) &&
- (pDocView->GetLayoutStatus() >= XFA_DOCVIEW_LAYOUTSTATUS_End);
+ (pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End);
if (bLayoutReady) {
m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc);
}
@@ -580,33 +580,28 @@ void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView,
FX_DWORD dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable |
XFA_WIDGETSTATUS_Printable;
pWidget->ModifyStatus(dwStatus, dwFilter);
- if (pDocView->GetLayoutStatus() >= XFA_DOCVIEW_LAYOUTSTATUS_End) {
- IXFA_PageView* pPrePageView = pWidget->GetPageView();
- if (pPrePageView != pNewPageView ||
- (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) ==
- (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) {
- pWidget->SetPageView(pNewPageView);
- m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(),
- XFA_WIDGETEVENT_PostAdded,
- pNewPageView, pPrePageView);
- }
- if ((dwStatus & XFA_WIDGETSTATUS_Visible) == 0) {
- return;
- }
- if (pWidget->IsLoaded()) {
- CFX_RectF rtOld;
- pWidget->GetWidgetRect(rtOld);
- CFX_RectF rtNew = pWidget->ReCacheWidgetRect();
- if (rtOld != rtNew) {
- pWidget->PerformLayout();
- }
- } else {
- pWidget->LoadWidget();
- }
- pWidget->AddInvalidateRect(NULL);
- } else {
+ IXFA_PageView* pPrePageView = pWidget->GetPageView();
+ if (pPrePageView != pNewPageView ||
+ (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) ==
+ (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) {
pWidget->SetPageView(pNewPageView);
+ m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(),
+ XFA_WIDGETEVENT_PostAdded,
+ pNewPageView, pPrePageView);
}
+ if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End ||
+ !(dwStatus & XFA_WIDGETSTATUS_Visible)) {
+ return;
+ }
+ if (pWidget->IsLoaded()) {
+ CFX_RectF rtOld;
+ pWidget->GetWidgetRect(rtOld);
+ if (rtOld != pWidget->ReCacheWidgetRect())
+ pWidget->PerformLayout();
+ } else {
+ pWidget->LoadWidget();
+ }
+ pWidget->AddInvalidateRect(nullptr);
}
void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView,
IXFA_DocLayout* pLayout,
@@ -615,8 +610,6 @@ void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView,
void* pParam2) {
CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender);
pDocView->DeleteLayoutItem(pWidget);
- if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End)
- return;
m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(),
XFA_WIDGETEVENT_PreRemoved, nullptr,
pWidget->GetPageView());
« xfa/src/fxfa/src/app/xfa_ffdocview.h ('K') | « xfa/src/fxfa/src/app/xfa_ffdocview.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698