| 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/include/xfa_ffdocview.h" | 7 #include "xfa/fxfa/include/xfa_ffdocview.h" |
| 8 | 8 |
| 9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
| 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 if (!pFormRoot) { | 323 if (!pFormRoot) { |
| 324 return NULL; | 324 return NULL; |
| 325 } | 325 } |
| 326 return new CXFA_WidgetAccIterator(this, pFormRoot); | 326 return new CXFA_WidgetAccIterator(this, pFormRoot); |
| 327 } | 327 } |
| 328 CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() { | 328 CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() { |
| 329 return m_pFocusWidget; | 329 return m_pFocusWidget; |
| 330 } | 330 } |
| 331 void CXFA_FFDocView::KillFocus() { | 331 void CXFA_FFDocView::KillFocus() { |
| 332 if (m_pFocusWidget && | 332 if (m_pFocusWidget && |
| 333 (m_pFocusWidget->GetStatus() & XFA_WIDGETSTATUS_Focused)) { | 333 (m_pFocusWidget->GetStatus() & XFA_WidgetStatus_Focused)) { |
| 334 (m_pFocusWidget)->OnKillFocus(NULL); | 334 (m_pFocusWidget)->OnKillFocus(NULL); |
| 335 } | 335 } |
| 336 m_pFocusAcc = NULL; | 336 m_pFocusAcc = NULL; |
| 337 m_pFocusWidget = NULL; | 337 m_pFocusWidget = NULL; |
| 338 m_pOldFocusWidget = NULL; | 338 m_pOldFocusWidget = NULL; |
| 339 } | 339 } |
| 340 FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { | 340 FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { |
| 341 CXFA_FFWidget* pNewFocus = hWidget; | 341 CXFA_FFWidget* pNewFocus = hWidget; |
| 342 if (m_pOldFocusWidget == pNewFocus) { | 342 if (m_pOldFocusWidget == pNewFocus) { |
| 343 return FALSE; | 343 return FALSE; |
| 344 } | 344 } |
| 345 CXFA_FFWidget* pOldFocus = m_pOldFocusWidget; | 345 CXFA_FFWidget* pOldFocus = m_pOldFocusWidget; |
| 346 m_pOldFocusWidget = pNewFocus; | 346 m_pOldFocusWidget = pNewFocus; |
| 347 if (pOldFocus) { | 347 if (pOldFocus) { |
| 348 if (m_pFocusWidget != m_pOldFocusWidget && | 348 if (m_pFocusWidget != m_pOldFocusWidget && |
| 349 (pOldFocus->GetStatus() & XFA_WIDGETSTATUS_Focused)) { | 349 (pOldFocus->GetStatus() & XFA_WidgetStatus_Focused)) { |
| 350 m_pFocusWidget = pOldFocus; | 350 m_pFocusWidget = pOldFocus; |
| 351 pOldFocus->OnKillFocus(pNewFocus); | 351 pOldFocus->OnKillFocus(pNewFocus); |
| 352 } else if ((pOldFocus->GetStatus() & XFA_WIDGETSTATUS_Visible)) { | 352 } else if ((pOldFocus->GetStatus() & XFA_WidgetStatus_Visible)) { |
| 353 if (!pOldFocus->IsLoaded()) { | 353 if (!pOldFocus->IsLoaded()) { |
| 354 pOldFocus->LoadWidget(); | 354 pOldFocus->LoadWidget(); |
| 355 } | 355 } |
| 356 pOldFocus->OnSetFocus(m_pFocusWidget); | 356 pOldFocus->OnSetFocus(m_pFocusWidget); |
| 357 m_pFocusWidget = pOldFocus; | 357 m_pFocusWidget = pOldFocus; |
| 358 pOldFocus->OnKillFocus(pNewFocus); | 358 pOldFocus->OnKillFocus(pNewFocus); |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 if (m_pFocusWidget == m_pOldFocusWidget) { | 361 if (m_pFocusWidget == m_pOldFocusWidget) { |
| 362 return FALSE; | 362 return FALSE; |
| 363 } | 363 } |
| 364 pNewFocus = m_pOldFocusWidget; | 364 pNewFocus = m_pOldFocusWidget; |
| 365 if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) { | 365 if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) { |
| 366 m_pFocusAcc = NULL; | 366 m_pFocusAcc = NULL; |
| 367 m_pFocusWidget = NULL; | 367 m_pFocusWidget = NULL; |
| 368 m_pListFocusWidget = NULL; | 368 m_pListFocusWidget = NULL; |
| 369 m_pOldFocusWidget = NULL; | 369 m_pOldFocusWidget = NULL; |
| 370 return FALSE; | 370 return FALSE; |
| 371 } | 371 } |
| 372 if (pNewFocus && (pNewFocus->GetStatus() & XFA_WIDGETSTATUS_Visible)) { | 372 if (pNewFocus && (pNewFocus->GetStatus() & XFA_WidgetStatus_Visible)) { |
| 373 if (!pNewFocus->IsLoaded()) { | 373 if (!pNewFocus->IsLoaded()) { |
| 374 pNewFocus->LoadWidget(); | 374 pNewFocus->LoadWidget(); |
| 375 } | 375 } |
| 376 pNewFocus->OnSetFocus(m_pFocusWidget); | 376 pNewFocus->OnSetFocus(m_pFocusWidget); |
| 377 } | 377 } |
| 378 m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : NULL; | 378 m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : NULL; |
| 379 m_pFocusWidget = pNewFocus; | 379 m_pFocusWidget = pNewFocus; |
| 380 m_pOldFocusWidget = m_pFocusWidget; | 380 m_pOldFocusWidget = m_pFocusWidget; |
| 381 return TRUE; | 381 return TRUE; |
| 382 } | 382 } |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToLast() { | 838 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToLast() { |
| 839 return NULL; | 839 return NULL; |
| 840 } | 840 } |
| 841 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToNext() { | 841 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToNext() { |
| 842 CXFA_Node* pItem = m_pCurWidget ? m_ContentIterator.MoveToNext() | 842 CXFA_Node* pItem = m_pCurWidget ? m_ContentIterator.MoveToNext() |
| 843 : m_ContentIterator.GetCurrent(); | 843 : m_ContentIterator.GetCurrent(); |
| 844 while (pItem) { | 844 while (pItem) { |
| 845 if (CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pItem->GetWidgetData()) { | 845 if (CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pItem->GetWidgetData()) { |
| 846 while ((m_pCurWidget = pAcc->GetNextWidget(NULL))) { | 846 while ((m_pCurWidget = pAcc->GetNextWidget(NULL))) { |
| 847 if (!m_pCurWidget->IsLoaded() && | 847 if (!m_pCurWidget->IsLoaded() && |
| 848 (m_pCurWidget->GetStatus() & XFA_WIDGETSTATUS_Visible)) { | 848 (m_pCurWidget->GetStatus() & XFA_WidgetStatus_Visible)) { |
| 849 m_pCurWidget->LoadWidget(); | 849 m_pCurWidget->LoadWidget(); |
| 850 } | 850 } |
| 851 return m_pCurWidget; | 851 return m_pCurWidget; |
| 852 } | 852 } |
| 853 } | 853 } |
| 854 pItem = m_ContentIterator.MoveToNext(); | 854 pItem = m_ContentIterator.MoveToNext(); |
| 855 } | 855 } |
| 856 return NULL; | 856 return NULL; |
| 857 } | 857 } |
| 858 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToPrevious() { | 858 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToPrevious() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { | 899 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { |
| 900 return NULL; | 900 return NULL; |
| 901 } | 901 } |
| 902 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { | 902 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { |
| 903 return FALSE; | 903 return FALSE; |
| 904 } | 904 } |
| 905 void CXFA_WidgetAccIterator::SkipTree() { | 905 void CXFA_WidgetAccIterator::SkipTree() { |
| 906 m_ContentIterator.SkipChildrenAndMoveToNext(); | 906 m_ContentIterator.SkipChildrenAndMoveToNext(); |
| 907 m_pCurWidgetAcc = NULL; | 907 m_pCurWidgetAcc = NULL; |
| 908 } | 908 } |
| OLD | NEW |