| 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/include/fpdfapi/fpdf_parser.h" | 7 #include "core/include/fpdfapi/fpdf_parser.h" |
| 8 | 8 |
| 9 #include "core/include/fpdfapi/fpdf_serial.h" | 9 #include "core/include/fpdfapi/fpdf_serial.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if (bNumber) { | 53 if (bNumber) { |
| 54 FX_DWORD objnum = FXSYS_atoi(word); | 54 FX_DWORD objnum = FXSYS_atoi(word); |
| 55 word = parser.GetNextWord(&bNumber); | 55 word = parser.GetNextWord(&bNumber); |
| 56 if (!bNumber) { | 56 if (!bNumber) { |
| 57 break; | 57 break; |
| 58 } | 58 } |
| 59 word = parser.GetNextWord(nullptr); | 59 word = parser.GetNextWord(nullptr); |
| 60 if (word != "obj") { | 60 if (word != "obj") { |
| 61 break; | 61 break; |
| 62 } | 62 } |
| 63 CPDF_Object* pObj = parser.GetObject(this, objnum, 0, nullptr, true); | 63 CPDF_Object* pObj = parser.GetObject(this, objnum, 0, true); |
| 64 if (!pObj) { | 64 if (!pObj) { |
| 65 break; | 65 break; |
| 66 } | 66 } |
| 67 InsertIndirectObject(objnum, pObj); | 67 InsertIndirectObject(objnum, pObj); |
| 68 word = parser.GetNextWord(nullptr); | 68 word = parser.GetNextWord(nullptr); |
| 69 if (word != "endobj") { | 69 if (word != "endobj") { |
| 70 break; | 70 break; |
| 71 } | 71 } |
| 72 } else { | 72 } else { |
| 73 if (word != "trailer") { | 73 if (word != "trailer") { |
| 74 break; | 74 break; |
| 75 } | 75 } |
| 76 if (CPDF_Dictionary* pMainDict = | 76 if (CPDF_Dictionary* pMainDict = |
| 77 ToDictionary(parser.GetObject(this, 0, 0, nullptr, true))) { | 77 ToDictionary(parser.GetObject(this, 0, 0, true))) { |
| 78 m_pRootDict = pMainDict->GetDict("Root"); | 78 m_pRootDict = pMainDict->GetDict("Root"); |
| 79 pMainDict->Release(); | 79 pMainDict->Release(); |
| 80 } | 80 } |
| 81 break; | 81 break; |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 FX_BOOL CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const { | 85 FX_BOOL CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const { |
| 86 if (!m_pRootDict) { | 86 if (!m_pRootDict) { |
| 87 return FALSE; | 87 return FALSE; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 result += wsFileName[1]; | 168 result += wsFileName[1]; |
| 169 result += ':'; | 169 result += ':'; |
| 170 result += ChangeSlash(wsFileName.c_str() + 2); | 170 result += ChangeSlash(wsFileName.c_str() + 2); |
| 171 return result; | 171 return result; |
| 172 } | 172 } |
| 173 CFX_WideString result; | 173 CFX_WideString result; |
| 174 result += '\\'; | 174 result += '\\'; |
| 175 result += ChangeSlash(wsFileName.c_str()); | 175 result += ChangeSlash(wsFileName.c_str()); |
| 176 return result; | 176 return result; |
| 177 } | 177 } |
| OLD | NEW |