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 "core/fpdfapi/fpdf_edit/editint.h" | 7 #include "core/fpdfapi/fpdf_edit/editint.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 return FALSE; | 772 return FALSE; |
773 } | 773 } |
774 offset += len + 7; | 774 offset += len + 7; |
775 if (m_PrevOffset > 0) { | 775 if (m_PrevOffset > 0) { |
776 if (pFile->AppendString("/Prev ") < 0) { | 776 if (pFile->AppendString("/Prev ") < 0) { |
777 return FALSE; | 777 return FALSE; |
778 } | 778 } |
779 FX_CHAR offset_buf[20]; | 779 FX_CHAR offset_buf[20]; |
780 FXSYS_memset(offset_buf, 0, sizeof(offset_buf)); | 780 FXSYS_memset(offset_buf, 0, sizeof(offset_buf)); |
781 FXSYS_i64toa(m_PrevOffset, offset_buf, 10); | 781 FXSYS_i64toa(m_PrevOffset, offset_buf, 10); |
782 int32_t len = (int32_t)FXSYS_strlen(offset_buf); | 782 int32_t offset_len = (int32_t)FXSYS_strlen(offset_buf); |
783 if (pFile->AppendBlock(offset_buf, len) < 0) { | 783 if (pFile->AppendBlock(offset_buf, offset_len) < 0) { |
784 return FALSE; | 784 return FALSE; |
785 } | 785 } |
786 offset += len + 6; | 786 offset += offset_len + 6; |
787 } | 787 } |
788 FX_BOOL bPredictor = TRUE; | 788 FX_BOOL bPredictor = TRUE; |
789 CPDF_FlateEncoder encoder(m_Buffer.GetBuffer(), m_Buffer.GetLength(), TRUE, | 789 CPDF_FlateEncoder encoder(m_Buffer.GetBuffer(), m_Buffer.GetLength(), TRUE, |
790 bPredictor); | 790 bPredictor); |
791 if (pFile->AppendString("/Filter /FlateDecode") < 0) { | 791 if (pFile->AppendString("/Filter /FlateDecode") < 0) { |
792 return FALSE; | 792 return FALSE; |
793 } | 793 } |
794 offset += 20; | 794 offset += 20; |
795 if (bPredictor) { | 795 if (bPredictor) { |
796 if ((len = pFile->AppendString("/DecodeParms<</Columns 7/Predictor 12>>")) < | 796 if ((len = pFile->AppendString("/DecodeParms<</Columns 7/Predictor 12>>")) < |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2009 m_pCryptoHandler = nullptr; | 2009 m_pCryptoHandler = nullptr; |
2010 } | 2010 } |
2011 void CPDF_Creator::ResetStandardSecurity() { | 2011 void CPDF_Creator::ResetStandardSecurity() { |
2012 if (!m_bLocalCryptoHandler) | 2012 if (!m_bLocalCryptoHandler) |
2013 return; | 2013 return; |
2014 | 2014 |
2015 delete m_pCryptoHandler; | 2015 delete m_pCryptoHandler; |
2016 m_pCryptoHandler = nullptr; | 2016 m_pCryptoHandler = nullptr; |
2017 m_bLocalCryptoHandler = FALSE; | 2017 m_bLocalCryptoHandler = FALSE; |
2018 } | 2018 } |
OLD | NEW |