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 "public/fpdf_ppo.h" | 7 #include "public/fpdf_ppo.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 } | 78 } |
79 | 79 |
80 CFX_ByteString cbPageType = pNewPages->GetStringBy("Type", ""); | 80 CFX_ByteString cbPageType = pNewPages->GetStringBy("Type", ""); |
81 if (cbPageType.Equal("")) { | 81 if (cbPageType.Equal("")) { |
82 pNewPages->SetAt("Type", new CPDF_Name("Pages")); | 82 pNewPages->SetAt("Type", new CPDF_Name("Pages")); |
83 } | 83 } |
84 | 84 |
85 CPDF_Array* pKeysArray = pNewPages->GetArrayBy("Kids"); | 85 CPDF_Array* pKeysArray = pNewPages->GetArrayBy("Kids"); |
86 if (!pKeysArray) { | 86 if (!pKeysArray) { |
87 CPDF_Array* pNewKids = new CPDF_Array; | 87 CPDF_Array* pNewKids = new CPDF_Array; |
88 FX_DWORD Kidsobjnum = -1; | 88 FX_DWORD Kidsobjnum = pDestPDFDoc->AddIndirectObject(pNewKids); |
Tom Sepez
2016/03/16 18:35:00
no kidding. !!! :)
Wei Li
2016/03/17 02:24:06
You bet :)
| |
89 Kidsobjnum = pDestPDFDoc->AddIndirectObject(pNewKids); | |
90 | 89 |
91 pNewPages->SetAt("Kids", new CPDF_Reference(pDestPDFDoc, Kidsobjnum)); | 90 pNewPages->SetAt("Kids", new CPDF_Reference(pDestPDFDoc, Kidsobjnum)); |
92 pNewPages->SetAt("Count", new CPDF_Number(0)); | 91 pNewPages->SetAt("Count", new CPDF_Number(0)); |
93 } | 92 } |
94 | 93 |
95 return TRUE; | 94 return TRUE; |
96 } | 95 } |
97 | 96 |
98 FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc, | 97 FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc, |
99 std::vector<FX_WORD>* pPageNums, | 98 std::vector<FX_WORD>* pPageNums, |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 if (!pSrcDict) | 405 if (!pSrcDict) |
407 return FALSE; | 406 return FALSE; |
408 | 407 |
409 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); | 408 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); |
410 if (!pDstDict) | 409 if (!pDstDict) |
411 return FALSE; | 410 return FALSE; |
412 | 411 |
413 pDstDict->SetAt("ViewerPreferences", pSrcDict->Clone(TRUE)); | 412 pDstDict->SetAt("ViewerPreferences", pSrcDict->Clone(TRUE)); |
414 return TRUE; | 413 return TRUE; |
415 } | 414 } |
OLD | NEW |