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 <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "fpdfsdk/include/fsdk_mgr.h" | 10 #include "fpdfsdk/include/fsdk_mgr.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 458 } |
459 | 459 |
460 FX_BOOL CPDFSDK_Document::ProcOpenAction() { | 460 FX_BOOL CPDFSDK_Document::ProcOpenAction() { |
461 if (!m_pDoc) | 461 if (!m_pDoc) |
462 return FALSE; | 462 return FALSE; |
463 | 463 |
464 CPDF_Dictionary* pRoot = GetPDFDocument()->GetRoot(); | 464 CPDF_Dictionary* pRoot = GetPDFDocument()->GetRoot(); |
465 if (!pRoot) | 465 if (!pRoot) |
466 return FALSE; | 466 return FALSE; |
467 | 467 |
468 CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction"); | 468 CPDF_Object* pOpenAction = pRoot->GetDictBy("OpenAction"); |
469 if (!pOpenAction) | 469 if (!pOpenAction) |
470 pOpenAction = pRoot->GetArray("OpenAction"); | 470 pOpenAction = pRoot->GetArrayBy("OpenAction"); |
471 | 471 |
472 if (!pOpenAction) | 472 if (!pOpenAction) |
473 return FALSE; | 473 return FALSE; |
474 | 474 |
475 if (pOpenAction->IsArray()) | 475 if (pOpenAction->IsArray()) |
476 return TRUE; | 476 return TRUE; |
477 | 477 |
478 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { | 478 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { |
479 CPDF_Action action(pDict); | 479 CPDF_Action action(pDict); |
480 if (m_pEnv->GetActionHander()) | 480 if (m_pEnv->GetActionHander()) |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); | 812 pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); |
813 if (!pSDKAnnot) | 813 if (!pSDKAnnot) |
814 return nullptr; | 814 return nullptr; |
815 | 815 |
816 m_fxAnnotArray.push_back(pSDKAnnot); | 816 m_fxAnnotArray.push_back(pSDKAnnot); |
817 return pSDKAnnot; | 817 return pSDKAnnot; |
818 } | 818 } |
819 #endif // PDF_ENABLE_XFA | 819 #endif // PDF_ENABLE_XFA |
820 | 820 |
821 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { | 821 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { |
822 return pDict ? AddAnnot(pDict->GetString("Subtype"), pDict) : nullptr; | 822 return pDict ? AddAnnot(pDict->GetStringBy("Subtype"), pDict) : nullptr; |
823 } | 823 } |
824 | 824 |
825 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, | 825 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, |
826 CPDF_Dictionary* pDict) { | 826 CPDF_Dictionary* pDict) { |
827 return NULL; | 827 return NULL; |
828 } | 828 } |
829 | 829 |
830 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { | 830 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { |
831 #ifdef PDF_ENABLE_XFA | 831 #ifdef PDF_ENABLE_XFA |
832 if (!pAnnot) | 832 if (!pAnnot) |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1172 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
1173 if (!pFocusAnnot) | 1173 if (!pFocusAnnot) |
1174 return nullptr; | 1174 return nullptr; |
1175 | 1175 |
1176 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1176 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
1177 if (pAnnot == pFocusAnnot) | 1177 if (pAnnot == pFocusAnnot) |
1178 return pAnnot; | 1178 return pAnnot; |
1179 } | 1179 } |
1180 return nullptr; | 1180 return nullptr; |
1181 } | 1181 } |
OLD | NEW |