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 "fpdfsdk/include/fsdk_mgr.h" | 7 #include "fpdfsdk/include/fsdk_mgr.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 const size_t nCount = m_pAnnotList->Count(); | 900 const size_t nCount = m_pAnnotList->Count(); |
901 #endif // PDF_ENABLE_XFA | 901 #endif // PDF_ENABLE_XFA |
902 | 902 |
903 SetLock(TRUE); | 903 SetLock(TRUE); |
904 | 904 |
905 #ifdef PDF_ENABLE_XFA | 905 #ifdef PDF_ENABLE_XFA |
906 CFX_RetainPtr<CPDFXFA_Page> protector(m_page); | 906 CFX_RetainPtr<CPDFXFA_Page> protector(m_page); |
907 if (m_pSDKDoc->GetXFADocument()->GetDocType() == DOCTYPE_DYNAMIC_XFA) { | 907 if (m_pSDKDoc->GetXFADocument()->GetDocType() == DOCTYPE_DYNAMIC_XFA) { |
908 CXFA_FFPageView* pageView = m_page->GetXFAPageView(); | 908 CXFA_FFPageView* pageView = m_page->GetXFAPageView(); |
909 std::unique_ptr<IXFA_WidgetIterator> pWidgetHander( | 909 std::unique_ptr<IXFA_WidgetIterator> pWidgetHander( |
910 pageView->CreateWidgetIterator(XFA_TRAVERSEWAY_Form, | 910 pageView->CreateWidgetIterator( |
911 XFA_WIDGETFILTER_Visible | | 911 XFA_TRAVERSEWAY_Form, |
912 XFA_WIDGETFILTER_Viewable | | 912 XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable)); |
913 XFA_WIDGETFILTER_AllType)); | |
914 if (!pWidgetHander) { | 913 if (!pWidgetHander) { |
915 SetLock(FALSE); | 914 SetLock(FALSE); |
916 return; | 915 return; |
917 } | 916 } |
918 | 917 |
919 while (CXFA_FFWidget* pXFAAnnot = pWidgetHander->MoveToNext()) { | 918 while (CXFA_FFWidget* pXFAAnnot = pWidgetHander->MoveToNext()) { |
920 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pXFAAnnot, this); | 919 CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pXFAAnnot, this); |
921 if (!pAnnot) | 920 if (!pAnnot) |
922 continue; | 921 continue; |
923 m_fxAnnotArray.push_back(pAnnot); | 922 m_fxAnnotArray.push_back(pAnnot); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1012 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
1014 if (!pFocusAnnot) | 1013 if (!pFocusAnnot) |
1015 return nullptr; | 1014 return nullptr; |
1016 | 1015 |
1017 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1016 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
1018 if (pAnnot == pFocusAnnot) | 1017 if (pAnnot == pFocusAnnot) |
1019 return pAnnot; | 1018 return pAnnot; |
1020 } | 1019 } |
1021 return nullptr; | 1020 return nullptr; |
1022 } | 1021 } |
OLD | NEW |