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 "../../../include/fxcrt/fx_ext.h" | 7 #include "../../../include/fxcrt/fx_ext.h" |
8 #include "../../../include/fpdfapi/fpdf_serial.h" | 8 #include "../../../include/fpdfapi/fpdf_serial.h" |
9 #include "../../../include/fpdfapi/fpdf_parser.h" | 9 #include "../../../include/fpdfapi/fpdf_parser.h" |
10 #include "editint.h" | 10 #include "editint.h" |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 } | 930 } |
931 int32_t CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj) { | 931 int32_t CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj) { |
932 if (!m_pXRefStream) { | 932 if (!m_pXRefStream) { |
933 return 1; | 933 return 1; |
934 } | 934 } |
935 FX_DWORD objnum = pObj->GetObjNum(); | 935 FX_DWORD objnum = pObj->GetObjNum(); |
936 if (m_pParser && m_pParser->m_ObjVersion.GetSize() > (int32_t)objnum && | 936 if (m_pParser && m_pParser->m_ObjVersion.GetSize() > (int32_t)objnum && |
937 m_pParser->m_ObjVersion[objnum] > 0) { | 937 m_pParser->m_ObjVersion[objnum] > 0) { |
938 return 1; | 938 return 1; |
939 } | 939 } |
940 if (pObj->GetType() == PDFOBJ_NUMBER) { | 940 |
| 941 if (pObj->IsNumber()) |
941 return 1; | 942 return 1; |
942 } | 943 |
943 CPDF_Dictionary* pDict = pObj->GetDict(); | 944 CPDF_Dictionary* pDict = pObj->GetDict(); |
944 if (pObj->GetType() == PDFOBJ_STREAM) { | 945 if (pObj->GetType() == PDFOBJ_STREAM) { |
945 if (pDict && pDict->GetString(FX_BSTRC("Type")) == FX_BSTRC("XRef")) { | 946 if (pDict && pDict->GetString(FX_BSTRC("Type")) == FX_BSTRC("XRef")) { |
946 return 0; | 947 return 0; |
947 } | 948 } |
948 return 1; | 949 return 1; |
949 } | 950 } |
950 if (pDict) { | 951 if (pDict) { |
951 if (pDict == m_pDocument->m_pRootDict || pDict == m_pEncryptDict) { | 952 if (pDict == m_pDocument->m_pRootDict || pDict == m_pEncryptDict) { |
952 return 1; | 953 return 1; |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2127 m_bNewCrypto = FALSE; | 2128 m_bNewCrypto = FALSE; |
2128 if (!m_bStandardSecurity) { | 2129 if (!m_bStandardSecurity) { |
2129 return; | 2130 return; |
2130 } | 2131 } |
2131 if (m_pEncryptDict) { | 2132 if (m_pEncryptDict) { |
2132 m_pEncryptDict->Release(); | 2133 m_pEncryptDict->Release(); |
2133 m_pEncryptDict = NULL; | 2134 m_pEncryptDict = NULL; |
2134 } | 2135 } |
2135 m_bStandardSecurity = FALSE; | 2136 m_bStandardSecurity = FALSE; |
2136 } | 2137 } |
OLD | NEW |