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 <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 IFX_FileRead* pFileAccess = FX_CreateFileRead((const FX_CHAR*)file_path); | 360 IFX_FileRead* pFileAccess = FX_CreateFileRead((const FX_CHAR*)file_path); |
361 if (!pFileAccess) { | 361 if (!pFileAccess) { |
362 return nullptr; | 362 return nullptr; |
363 } | 363 } |
364 | 364 |
365 std::unique_ptr<CPDF_Parser> pParser(new CPDF_Parser); | 365 std::unique_ptr<CPDF_Parser> pParser(new CPDF_Parser); |
366 pParser->SetPassword(password); | 366 pParser->SetPassword(password); |
367 | 367 |
368 std::unique_ptr<CPDF_Document> pDocument( | 368 std::unique_ptr<CPDF_Document> pDocument( |
369 new CPDF_Document(std::move(pParser))); | 369 new CPDF_Document(std::move(pParser))); |
370 CPDF_Parser::Error error = pParser->StartParse(pFileAccess, pDocument.get()); | 370 CPDF_Parser::Error error = |
| 371 pDocument->GetParser()->StartParse(pFileAccess, pDocument.get()); |
371 if (error != CPDF_Parser::SUCCESS) { | 372 if (error != CPDF_Parser::SUCCESS) { |
372 ProcessParseError(error); | 373 ProcessParseError(error); |
373 return nullptr; | 374 return nullptr; |
374 } | 375 } |
375 #ifdef PDF_ENABLE_XFA | 376 #ifdef PDF_ENABLE_XFA |
376 return new CPDFXFA_Document(std::move(pDocument), CPDFXFA_App::GetInstance()); | 377 return new CPDFXFA_Document(std::move(pDocument), CPDFXFA_App::GetInstance()); |
377 #else // PDF_ENABLE_XFA | 378 #else // PDF_ENABLE_XFA |
378 return pDocument.release(); | 379 return pDocument.release(); |
379 #endif // PDF_ENABLE_XFA | 380 #endif // PDF_ENABLE_XFA |
380 } | 381 } |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 if (!buffer) { | 1117 if (!buffer) { |
1117 *buflen = len; | 1118 *buflen = len; |
1118 } else if (*buflen >= len) { | 1119 } else if (*buflen >= len) { |
1119 memcpy(buffer, utf16Name.c_str(), len); | 1120 memcpy(buffer, utf16Name.c_str(), len); |
1120 *buflen = len; | 1121 *buflen = len; |
1121 } else { | 1122 } else { |
1122 *buflen = -1; | 1123 *buflen = -1; |
1123 } | 1124 } |
1124 return (FPDF_DEST)pDestObj; | 1125 return (FPDF_DEST)pDestObj; |
1125 } | 1126 } |
OLD | NEW |