| 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 "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
| 8 | 8 |
| 9 #include "../include/fpdfxfa/fpdfxfa_app.h" | 9 #include "../include/fpdfxfa/fpdfxfa_app.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) { | 409 DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) { |
| 410 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 410 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 411 if (!pDoc) | 411 if (!pDoc) |
| 412 return -1; | 412 return -1; |
| 413 | 413 |
| 414 CPDF_Dictionary* pDict = pDoc->GetParser()->GetEncryptDict(); | 414 CPDF_Dictionary* pDict = pDoc->GetParser()->GetEncryptDict(); |
| 415 return pDict ? pDict->GetInteger("R") : -1; | 415 return pDict ? pDict->GetInteger("R") : -1; |
| 416 } | 416 } |
| 417 | 417 |
| 418 DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document) { | 418 DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document) { |
| 419 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 419 CPDFXFA_Document* pDoc = static_cast<CPDFXFA_Document*>(document); |
| 420 return pDoc ? pDoc->GetPageCount() : 0; | 420 return pDoc ? pDoc->GetPageCount() : 0; |
| 421 } | 421 } |
| 422 | 422 |
| 423 DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, | 423 DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, |
| 424 int page_index) { | 424 int page_index) { |
| 425 if (!document) | 425 if (!document) |
| 426 return nullptr; | 426 return nullptr; |
| 427 CPDFXFA_Document* pDoc = static_cast<CPDFXFA_Document*>(document); | 427 CPDFXFA_Document* pDoc = static_cast<CPDFXFA_Document*>(document); |
| 428 if (page_index < 0 || page_index >= pDoc->GetPageCount()) | 428 if (page_index < 0 || page_index >= pDoc->GetPageCount()) |
| 429 return nullptr; | 429 return nullptr; |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 if (!buffer) { | 1057 if (!buffer) { |
| 1058 *buflen = len; | 1058 *buflen = len; |
| 1059 } else if (*buflen >= len) { | 1059 } else if (*buflen >= len) { |
| 1060 memcpy(buffer, utf16Name.c_str(), len); | 1060 memcpy(buffer, utf16Name.c_str(), len); |
| 1061 *buflen = len; | 1061 *buflen = len; |
| 1062 } else { | 1062 } else { |
| 1063 *buflen = -1; | 1063 *buflen = -1; |
| 1064 } | 1064 } |
| 1065 return (FPDF_DEST)pDestObj; | 1065 return (FPDF_DEST)pDestObj; |
| 1066 } | 1066 } |
| OLD | NEW |