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/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fpdfapi/fpdf_page.h" | 9 #include "../../../include/fpdfapi/fpdf_page.h" |
10 #include "../../../../third_party/numerics/safe_math.h" | 10 #include "../../../../third_party/numerics/safe_math.h" |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2187 key = PDF_NameDecode(key); | 2187 key = PDF_NameDecode(key); |
2188 if (key == FX_BSTRC("/Contents")) { | 2188 if (key == FX_BSTRC("/Contents")) { |
2189 dwSignValuePos = m_Pos; | 2189 dwSignValuePos = m_Pos; |
2190 } | 2190 } |
2191 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, level + 1); | 2191 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, level + 1); |
2192 if (pObj == NULL) { | 2192 if (pObj == NULL) { |
2193 continue; | 2193 continue; |
2194 } | 2194 } |
2195 if (key.GetLength() >= 1) { | 2195 if (key.GetLength() >= 1) { |
2196 if (nKeys < 32) { | 2196 if (nKeys < 32) { |
2197 pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLe
ngth() - 1), pObj); | 2197 pDict->SetAt(CFX_ByteStringC(key.c_str() + 1, key.GetLength(
) - 1), pObj); |
2198 } else { | 2198 } else { |
2199 pDict->AddValue(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.Ge
tLength() - 1), pObj); | 2199 pDict->AddValue(CFX_ByteStringC(key.c_str() + 1, key.GetLeng
th() - 1), pObj); |
2200 } | 2200 } |
2201 } | 2201 } |
2202 } | 2202 } |
2203 if (IsSignatureDict(pDict)) { | 2203 if (IsSignatureDict(pDict)) { |
2204 FX_FILESIZE dwSavePos = m_Pos; | 2204 FX_FILESIZE dwSavePos = m_Pos; |
2205 m_Pos = dwSignValuePos; | 2205 m_Pos = dwSignValuePos; |
2206 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, level + 1, N
ULL, FALSE); | 2206 CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, level + 1, N
ULL, FALSE); |
2207 pDict->SetAt(FX_BSTRC("Contents"), pObj); | 2207 pDict->SetAt(FX_BSTRC("Contents"), pObj); |
2208 m_Pos = dwSavePos; | 2208 m_Pos = dwSavePos; |
2209 } | 2209 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2373 if (!GetNextChar(ch)) { | 2373 if (!GetNextChar(ch)) { |
2374 break; | 2374 break; |
2375 } | 2375 } |
2376 if (ch == 0x0A || ch == 0x0D) { | 2376 if (ch == 0x0A || ch == 0x0D) { |
2377 break; | 2377 break; |
2378 } | 2378 } |
2379 } | 2379 } |
2380 return NULL; | 2380 return NULL; |
2381 } | 2381 } |
2382 if (key.GetLength() == 1) { | 2382 if (key.GetLength() == 1) { |
2383 pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLength
() - 1), pObj); | 2383 pDict->SetAt(CFX_ByteStringC(key.c_str() + 1, key.GetLength() -
1), pObj); |
2384 } else { | 2384 } else { |
2385 pDict->AddValue(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLen
gth() - 1), pObj); | 2385 pDict->AddValue(CFX_ByteStringC(key.c_str() + 1, key.GetLength()
- 1), pObj); |
2386 } | 2386 } |
2387 } | 2387 } |
2388 if (pContext) { | 2388 if (pContext) { |
2389 pContext->m_DictEnd = m_Pos; | 2389 pContext->m_DictEnd = m_Pos; |
2390 if (pContext->m_Flags & PDFPARSE_NOSTREAM) { | 2390 if (pContext->m_Flags & PDFPARSE_NOSTREAM) { |
2391 return pDict; | 2391 return pDict; |
2392 } | 2392 } |
2393 } | 2393 } |
2394 FX_FILESIZE SavedPos = m_Pos; | 2394 FX_FILESIZE SavedPos = m_Pos; |
2395 FX_BOOL bIsNumber; | 2395 FX_BOOL bIsNumber; |
(...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4426 { | 4426 { |
4427 FX_INT32 iSize = m_childNode.GetSize(); | 4427 FX_INT32 iSize = m_childNode.GetSize(); |
4428 for (FX_INT32 i = 0; i < iSize; ++i) { | 4428 for (FX_INT32 i = 0; i < iSize; ++i) { |
4429 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4429 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
4430 if (pNode) { | 4430 if (pNode) { |
4431 delete pNode; | 4431 delete pNode; |
4432 } | 4432 } |
4433 } | 4433 } |
4434 m_childNode.RemoveAll(); | 4434 m_childNode.RemoveAll(); |
4435 } | 4435 } |
OLD | NEW |