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

Side by Side Diff: xfa/src/fxfa/src/app/xfa_ffdocview.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, 10 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
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/src/foxitlib.h" 7 #include "xfa/src/foxitlib.h"
8 #include "xfa/src/fxfa/src/common/xfa_common.h" 8 #include "xfa/src/fxfa/src/common/xfa_common.h"
9 #include "xfa_fwladapter.h" 9 #include "xfa_fwladapter.h"
10 #include "xfa_ffdocview.h" 10 #include "xfa_ffdocview.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 CXFA_Node* pNode = (CXFA_Node*)m_NewAddedNodes[i]; 173 CXFA_Node* pNode = (CXFA_Node*)m_NewAddedNodes[i];
174 InitCalculate(pNode); 174 InitCalculate(pNode);
175 InitValidate(pNode); 175 InitValidate(pNode);
176 ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Ready, TRUE); 176 ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Ready, TRUE);
177 } 177 }
178 m_NewAddedNodes.RemoveAll(); 178 m_NewAddedNodes.RemoveAll();
179 this->RunSubformIndexChange(); 179 this->RunSubformIndexChange();
180 this->RunCalculateWidgets(); 180 this->RunCalculateWidgets();
181 this->RunValidate(); 181 this->RunValidate();
182 ShowNullTestMsg(); 182 ShowNullTestMsg();
183 m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Next;
184 if (RunLayout() && m_bLayoutEvent) { 183 if (RunLayout() && m_bLayoutEvent) {
185 RunEventLayoutReady(); 184 RunEventLayoutReady();
186 } 185 }
187 m_bLayoutEvent = FALSE; 186 m_bLayoutEvent = FALSE;
188 m_CalculateAccs.RemoveAll(); 187 m_CalculateAccs.RemoveAll();
189 this->RunInvalidate(); 188 this->RunInvalidate();
190 UnlockUpdate(); 189 UnlockUpdate();
191 } 190 }
192 int32_t CXFA_FFDocView::CountPageViews() { 191 int32_t CXFA_FFDocView::CountPageViews() {
193 if (!m_pXFADocLayout) { 192 if (!m_pXFADocLayout) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 return TRUE; 388 return TRUE;
390 } 389 }
391 CXFA_WidgetAcc* CXFA_FFDocView::GetFocusWidgetAcc() { 390 CXFA_WidgetAcc* CXFA_FFDocView::GetFocusWidgetAcc() {
392 return m_pFocusAcc; 391 return m_pFocusAcc;
393 } 392 }
394 void CXFA_FFDocView::SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) { 393 void CXFA_FFDocView::SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) {
395 CXFA_FFWidget* pNewFocus = 394 CXFA_FFWidget* pNewFocus =
396 pWidgetAcc ? pWidgetAcc->GetNextWidget(NULL) : NULL; 395 pWidgetAcc ? pWidgetAcc->GetNextWidget(NULL) : NULL;
397 if (SetFocus(pNewFocus)) { 396 if (SetFocus(pNewFocus)) {
398 m_pFocusAcc = pWidgetAcc; 397 m_pFocusAcc = pWidgetAcc;
399 if (m_iStatus >= XFA_DOCVIEW_LAYOUTSTATUS_End) { 398 if (m_iStatus == XFA_DOCVIEW_LAYOUTSTATUS_End) {
400 m_pDoc->GetDocProvider()->SetFocusWidget(m_pDoc, m_pFocusWidget); 399 m_pDoc->GetDocProvider()->SetFocusWidget(m_pDoc, m_pFocusWidget);
401 } 400 }
402 } 401 }
403 } 402 }
404 void CXFA_FFDocView::DeleteLayoutItem(CXFA_FFWidget* pWidget) { 403 void CXFA_FFDocView::DeleteLayoutItem(CXFA_FFWidget* pWidget) {
405 if (m_pFocusAcc == pWidget->GetDataAcc()) { 404 if (m_pFocusAcc == pWidget->GetDataAcc()) {
406 m_pFocusAcc = NULL; 405 m_pFocusAcc = NULL;
407 m_pFocusWidget = NULL; 406 m_pFocusWidget = NULL;
408 m_pOldFocusWidget = NULL; 407 m_pOldFocusWidget = NULL;
409 } 408 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 CXFA_Object* pNode = resoveNodeRS.nodes[0]; 527 CXFA_Object* pNode = resoveNodeRS.nodes[0];
529 if (pNode->IsNode()) { 528 if (pNode->IsNode()) {
530 return (CXFA_WidgetAcc*)((CXFA_Node*)pNode)->GetWidgetData(); 529 return (CXFA_WidgetAcc*)((CXFA_Node*)pNode)->GetWidgetData();
531 } 530 }
532 } 531 }
533 return NULL; 532 return NULL;
534 } 533 }
535 void CXFA_FFDocView::OnPageEvent(IXFA_LayoutPage* pSender, 534 void CXFA_FFDocView::OnPageEvent(IXFA_LayoutPage* pSender,
536 XFA_PAGEEVENT eEvent, 535 XFA_PAGEEVENT eEvent,
537 int32_t iPageIndex) { 536 int32_t iPageIndex) {
538 FX_BOOL bNofify = m_iStatus >= XFA_DOCVIEW_LAYOUTSTATUS_End;
539 CXFA_FFPageView* pFFPageView = static_cast<CXFA_FFPageView*>(pSender); 537 CXFA_FFPageView* pFFPageView = static_cast<CXFA_FFPageView*>(pSender);
540 if (eEvent == XFA_PAGEEVENT_PageRemoved) { 538 if (eEvent == XFA_PAGEEVENT_PageRemoved) {
541 if (bNofify) {
542 m_pDoc->GetDocProvider()->PageViewEvent(pFFPageView, 539 m_pDoc->GetDocProvider()->PageViewEvent(pFFPageView,
543 XFA_PAGEVIEWEVENT_PostRemoved); 540 XFA_PAGEVIEWEVENT_PostRemoved);
544 } 541 return;
545 } else if (eEvent == XFA_PAGEEVENT_PageAdded) {
546 if (bNofify) {
547 m_pDoc->GetDocProvider()->PageViewEvent(pFFPageView,
548 XFA_PAGEVIEWEVENT_PostAdded);
549 pFFPageView->LoadPageView();
550 }
551 } 542 }
543 m_pDoc->GetDocProvider()->PageViewEvent(pFFPageView,
544 XFA_PAGEVIEWEVENT_PostAdded);
545 pFFPageView->LoadPageView();
552 } 546 }
553 void CXFA_FFDocView::LockUpdate() { 547 void CXFA_FFDocView::LockUpdate() {
554 m_iLock++; 548 m_iLock++;
555 } 549 }
556 void CXFA_FFDocView::UnlockUpdate() { 550 void CXFA_FFDocView::UnlockUpdate() {
557 m_iLock--; 551 m_iLock--;
558 } 552 }
559 FX_BOOL CXFA_FFDocView::IsUpdateLocked() { 553 FX_BOOL CXFA_FFDocView::IsUpdateLocked() {
560 return m_iLock; 554 return m_iLock;
561 } 555 }
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { 921 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() {
928 return NULL; 922 return NULL;
929 } 923 }
930 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { 924 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) {
931 return FALSE; 925 return FALSE;
932 } 926 }
933 void CXFA_WidgetAccIterator::SkipTree() { 927 void CXFA_WidgetAccIterator::SkipTree() {
934 m_ContentIterator.SkipChildrenAndMoveToNext(); 928 m_ContentIterator.SkipChildrenAndMoveToNext();
935 m_pCurWidgetAcc = NULL; 929 m_pCurWidgetAcc = NULL;
936 } 930 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698