| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 } | 446 } |
| 447 | 447 |
| 448 FX_BOOL CPDFSDK_Document::ProcOpenAction() { | 448 FX_BOOL CPDFSDK_Document::ProcOpenAction() { |
| 449 if (!m_pDoc) | 449 if (!m_pDoc) |
| 450 return FALSE; | 450 return FALSE; |
| 451 | 451 |
| 452 CPDF_Dictionary* pRoot = GetPDFDocument()->GetRoot(); | 452 CPDF_Dictionary* pRoot = GetPDFDocument()->GetRoot(); |
| 453 if (!pRoot) | 453 if (!pRoot) |
| 454 return FALSE; | 454 return FALSE; |
| 455 | 455 |
| 456 CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction"); | 456 CPDF_Object* pOpenAction = pRoot->GetDictBy("OpenAction"); |
| 457 if (!pOpenAction) | 457 if (!pOpenAction) |
| 458 pOpenAction = pRoot->GetArray("OpenAction"); | 458 pOpenAction = pRoot->GetArrayBy("OpenAction"); |
| 459 | 459 |
| 460 if (!pOpenAction) | 460 if (!pOpenAction) |
| 461 return FALSE; | 461 return FALSE; |
| 462 | 462 |
| 463 if (pOpenAction->IsArray()) | 463 if (pOpenAction->IsArray()) |
| 464 return TRUE; | 464 return TRUE; |
| 465 | 465 |
| 466 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { | 466 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { |
| 467 CPDF_Action action(pDict); | 467 CPDF_Action action(pDict); |
| 468 if (m_pEnv->GetActionHander()) | 468 if (m_pEnv->GetActionHander()) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 CPDFSDK_Annot* pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); | 709 CPDFSDK_Annot* pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); |
| 710 if (!pSDKAnnot) | 710 if (!pSDKAnnot) |
| 711 return nullptr; | 711 return nullptr; |
| 712 | 712 |
| 713 m_fxAnnotArray.push_back(pSDKAnnot); | 713 m_fxAnnotArray.push_back(pSDKAnnot); |
| 714 pAnnotHandler->Annot_OnCreate(pSDKAnnot); | 714 pAnnotHandler->Annot_OnCreate(pSDKAnnot); |
| 715 return pSDKAnnot; | 715 return pSDKAnnot; |
| 716 } | 716 } |
| 717 | 717 |
| 718 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { | 718 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { |
| 719 return pDict ? AddAnnot(pDict->GetString("Subtype"), pDict) : nullptr; | 719 return pDict ? AddAnnot(pDict->GetStringBy("Subtype"), pDict) : nullptr; |
| 720 } | 720 } |
| 721 | 721 |
| 722 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, | 722 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, |
| 723 CPDF_Dictionary* pDict) { | 723 CPDF_Dictionary* pDict) { |
| 724 return NULL; | 724 return NULL; |
| 725 } | 725 } |
| 726 | 726 |
| 727 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { | 727 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { |
| 728 return FALSE; | 728 return FALSE; |
| 729 } | 729 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 917 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
| 918 if (!pFocusAnnot) | 918 if (!pFocusAnnot) |
| 919 return nullptr; | 919 return nullptr; |
| 920 | 920 |
| 921 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 921 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
| 922 if (pAnnot == pFocusAnnot) | 922 if (pAnnot == pFocusAnnot) |
| 923 return pAnnot; | 923 return pAnnot; |
| 924 } | 924 } |
| 925 return nullptr; | 925 return nullptr; |
| 926 } | 926 } |
| OLD | NEW |