| 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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); | 833 pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); |
| 834 if (!pSDKAnnot) | 834 if (!pSDKAnnot) |
| 835 return nullptr; | 835 return nullptr; |
| 836 | 836 |
| 837 m_fxAnnotArray.push_back(pSDKAnnot); | 837 m_fxAnnotArray.push_back(pSDKAnnot); |
| 838 return pSDKAnnot; | 838 return pSDKAnnot; |
| 839 } | 839 } |
| 840 #endif // PDF_ENABLE_XFA | 840 #endif // PDF_ENABLE_XFA |
| 841 | 841 |
| 842 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { | 842 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { |
| 843 return pDict ? AddAnnot(pDict->GetStringBy("Subtype"), pDict) : nullptr; | 843 return pDict ? AddAnnot(pDict->GetStringBy("Subtype").c_str(), pDict) |
| 844 : nullptr; |
| 844 } | 845 } |
| 845 | 846 |
| 846 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, | 847 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, |
| 847 CPDF_Dictionary* pDict) { | 848 CPDF_Dictionary* pDict) { |
| 848 return NULL; | 849 return NULL; |
| 849 } | 850 } |
| 850 | 851 |
| 851 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { | 852 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { |
| 852 #ifdef PDF_ENABLE_XFA | 853 #ifdef PDF_ENABLE_XFA |
| 853 if (!pAnnot) | 854 if (!pAnnot) |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1200 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
| 1200 if (!pFocusAnnot) | 1201 if (!pFocusAnnot) |
| 1201 return nullptr; | 1202 return nullptr; |
| 1202 | 1203 |
| 1203 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1204 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
| 1204 if (pAnnot == pFocusAnnot) | 1205 if (pAnnot == pFocusAnnot) |
| 1205 return pAnnot; | 1206 return pAnnot; |
| 1206 } | 1207 } |
| 1207 return nullptr; | 1208 return nullptr; |
| 1208 } | 1209 } |
| OLD | NEW |