OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/cpdfsdk_pageview.h" | 7 #include "fpdfsdk/include/cpdfsdk_pageview.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
10 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" | 10 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); | 224 pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); |
225 if (!pSDKAnnot) | 225 if (!pSDKAnnot) |
226 return nullptr; | 226 return nullptr; |
227 | 227 |
228 m_fxAnnotArray.push_back(pSDKAnnot); | 228 m_fxAnnotArray.push_back(pSDKAnnot); |
229 return pSDKAnnot; | 229 return pSDKAnnot; |
230 } | 230 } |
231 #endif // PDF_ENABLE_XFA | 231 #endif // PDF_ENABLE_XFA |
232 | 232 |
233 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { | 233 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) { |
234 return pDict ? AddAnnot(pDict->GetStringBy("Subtype").c_str(), pDict) | 234 return pDict ? AddAnnot(pDict->GetStringFor("Subtype").c_str(), pDict) |
235 : nullptr; | 235 : nullptr; |
236 } | 236 } |
237 | 237 |
238 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, | 238 CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType, |
239 CPDF_Dictionary* pDict) { | 239 CPDF_Dictionary* pDict) { |
240 return nullptr; | 240 return nullptr; |
241 } | 241 } |
242 | 242 |
243 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { | 243 FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) { |
244 #ifdef PDF_ENABLE_XFA | 244 #ifdef PDF_ENABLE_XFA |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 return pAnnot; | 578 return pAnnot; |
579 } | 579 } |
580 return nullptr; | 580 return nullptr; |
581 } | 581 } |
582 | 582 |
583 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { | 583 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { |
584 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; | 584 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; |
585 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); | 585 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); |
586 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; | 586 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; |
587 } | 587 } |
OLD | NEW |