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

Side by Side Diff: xfa/src/fxfa/src/app/xfa_ffdocview.cpp

Issue 1669193002: Fix an assertion failure in CXFA_DefFontMgr::GetDefaultFont() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
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
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_ffdocview.h ('k') | xfa/src/fxfa/src/app/xfa_ffnotify.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/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 = reinterpret_cast<CXFA_Node*>(m_NewAddedNodes[i]); 173 CXFA_Node* pNode = reinterpret_cast<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_Node* pNode = resoveNodeRS.nodes[0]->AsNode(); 527 CXFA_Node* pNode = resoveNodeRS.nodes[0]->AsNode();
529 if (pNode) { 528 if (pNode) {
530 return (CXFA_WidgetAcc*)pNode->GetWidgetData(); 529 return (CXFA_WidgetAcc*)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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { 923 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() {
930 return NULL; 924 return NULL;
931 } 925 }
932 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { 926 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) {
933 return FALSE; 927 return FALSE;
934 } 928 }
935 void CXFA_WidgetAccIterator::SkipTree() { 929 void CXFA_WidgetAccIterator::SkipTree() {
936 m_ContentIterator.SkipChildrenAndMoveToNext(); 930 m_ContentIterator.SkipChildrenAndMoveToNext();
937 m_pCurWidgetAcc = NULL; 931 m_pCurWidgetAcc = NULL;
938 } 932 }
OLDNEW
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_ffdocview.h ('k') | xfa/src/fxfa/src/app/xfa_ffnotify.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698