| 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 "xfa/fxfa/include/xfa_ffdoc.h" | 7 #include "xfa/fxfa/include/xfa_ffdoc.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 pChunkElement = pXMLElement; | 80 pChunkElement = pXMLElement; |
| 81 break; | 81 break; |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 if (!pChunkElement) { | 85 if (!pChunkElement) { |
| 86 return FALSE; | 86 return FALSE; |
| 87 } | 87 } |
| 88 CFX_WideString wsPDFContent; | 88 CFX_WideString wsPDFContent; |
| 89 pChunkElement->GetTextData(wsPDFContent); | 89 pChunkElement->GetTextData(wsPDFContent); |
| 90 iBufferSize = FX_Base64DecodeW(wsPDFContent, wsPDFContent.GetLength(), NULL); | 90 iBufferSize = |
| 91 FX_Base64DecodeW(wsPDFContent.c_str(), wsPDFContent.GetLength(), NULL); |
| 91 pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1); | 92 pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1); |
| 92 pByteBuffer[iBufferSize] = '0'; // FIXME: I bet this is wrong. | 93 pByteBuffer[iBufferSize] = '0'; // FIXME: I bet this is wrong. |
| 93 FX_Base64DecodeW(wsPDFContent, wsPDFContent.GetLength(), pByteBuffer); | 94 FX_Base64DecodeW(wsPDFContent.c_str(), wsPDFContent.GetLength(), pByteBuffer); |
| 94 return TRUE; | 95 return TRUE; |
| 95 } | 96 } |
| 96 void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) { | 97 void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) { |
| 97 CXFA_Node* pChildNode = pNewRoot->GetNodeItem(XFA_NODEITEM_FirstChild); | 98 CXFA_Node* pChildNode = pNewRoot->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 98 while (pChildNode) { | 99 while (pChildNode) { |
| 99 CXFA_Node* pOriginChild = | 100 CXFA_Node* pOriginChild = |
| 100 pOriginRoot->GetFirstChildByName(pChildNode->GetNameHash()); | 101 pOriginRoot->GetFirstChildByName(pChildNode->GetNameHash()); |
| 101 if (pOriginChild) { | 102 if (pOriginChild) { |
| 102 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 103 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); |
| 103 } else { | 104 } else { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } | 420 } |
| 420 pExport->Release(); | 421 pExport->Release(); |
| 421 return bFlags; | 422 return bFlags; |
| 422 } | 423 } |
| 423 FX_BOOL CXFA_FFDoc::ImportData(IFX_FileRead* pStream, FX_BOOL bXDP) { | 424 FX_BOOL CXFA_FFDoc::ImportData(IFX_FileRead* pStream, FX_BOOL bXDP) { |
| 424 std::unique_ptr<CXFA_DataImporter, ReleaseDeleter<CXFA_DataImporter>> | 425 std::unique_ptr<CXFA_DataImporter, ReleaseDeleter<CXFA_DataImporter>> |
| 425 importer(new CXFA_DataImporter(m_pDocument)); | 426 importer(new CXFA_DataImporter(m_pDocument)); |
| 426 | 427 |
| 427 return importer->ImportData(pStream); | 428 return importer->ImportData(pStream); |
| 428 } | 429 } |
| OLD | NEW |