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 "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" | 7 #include "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 if (key.IsEmpty()) | 464 if (key.IsEmpty()) |
465 continue; | 465 continue; |
466 | 466 |
467 if (key == "/Contents") | 467 if (key == "/Contents") |
468 dwSignValuePos = m_Pos; | 468 dwSignValuePos = m_Pos; |
469 | 469 |
470 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, true); | 470 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, true); |
471 if (!pObj) | 471 if (!pObj) |
472 continue; | 472 continue; |
473 | 473 |
474 CFX_ByteStringC keyNoSlash(key.c_str() + 1, key.GetLength() - 1); | 474 CFX_ByteStringC keyNoSlash(key.raw_str() + 1, key.GetLength() - 1); |
475 pDict->SetAt(keyNoSlash, pObj); | 475 pDict->SetAt(keyNoSlash, pObj); |
476 } | 476 } |
477 | 477 |
478 // Only when this is a signature dictionary and has contents, we reset the | 478 // Only when this is a signature dictionary and has contents, we reset the |
479 // contents to the un-decrypted form. | 479 // contents to the un-decrypted form. |
480 if (pDict->IsSignatureDict() && dwSignValuePos) { | 480 if (pDict->IsSignatureDict() && dwSignValuePos) { |
481 CFX_AutoRestorer<FX_FILESIZE> save_pos(&m_Pos); | 481 CFX_AutoRestorer<FX_FILESIZE> save_pos(&m_Pos); |
482 m_Pos = dwSignValuePos; | 482 m_Pos = dwSignValuePos; |
483 pDict->SetAt("Contents", GetObject(pObjList, objnum, gennum, false)); | 483 pDict->SetAt("Contents", GetObject(pObjList, objnum, gennum, false)); |
484 } | 484 } |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 if (limit && m_Pos == limit) | 981 if (limit && m_Pos == limit) |
982 return -1; | 982 return -1; |
983 } | 983 } |
984 return -1; | 984 return -1; |
985 } | 985 } |
986 | 986 |
987 void CPDF_SyntaxParser::SetEncrypt( | 987 void CPDF_SyntaxParser::SetEncrypt( |
988 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) { | 988 std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler) { |
989 m_pCryptoHandler = std::move(pCryptoHandler); | 989 m_pCryptoHandler = std::move(pCryptoHandler); |
990 } | 990 } |
OLD | NEW |