| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h" | 7 #include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/parser/cpdf_array.h" | 9 #include "core/fpdfapi/parser/cpdf_array.h" |
| 10 #include "core/fpdfapi/parser/cpdf_stream_acc.h" | 10 #include "core/fpdfapi/parser/cpdf_stream_acc.h" |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 FX_BOOL ret = SubmitDataInternal(hDoc, submit); | 702 FX_BOOL ret = SubmitDataInternal(hDoc, submit); |
| 703 NotifySubmit(FALSE); | 703 NotifySubmit(FALSE); |
| 704 return ret; | 704 return ret; |
| 705 } | 705 } |
| 706 | 706 |
| 707 IFX_SeekableReadStream* CPDFXFA_DocEnvironment::OpenLinkedFile( | 707 IFX_SeekableReadStream* CPDFXFA_DocEnvironment::OpenLinkedFile( |
| 708 CXFA_FFDoc* hDoc, | 708 CXFA_FFDoc* hDoc, |
| 709 const CFX_WideString& wsLink) { | 709 const CFX_WideString& wsLink) { |
| 710 CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pDocument->GetFormFillEnv(); | 710 CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pDocument->GetFormFillEnv(); |
| 711 if (!pFormFillEnv) | 711 if (!pFormFillEnv) |
| 712 return FALSE; | 712 return nullptr; |
| 713 | 713 |
| 714 CFX_ByteString bs = wsLink.UTF16LE_Encode(); | 714 CFX_ByteString bs = wsLink.UTF16LE_Encode(); |
| 715 int len = bs.GetLength(); | 715 int len = bs.GetLength(); |
| 716 FPDF_FILEHANDLER* pFileHandler = | 716 FPDF_FILEHANDLER* pFileHandler = |
| 717 pFormFillEnv->OpenFile(0, (FPDF_WIDESTRING)bs.GetBuffer(len), "rb"); | 717 pFormFillEnv->OpenFile(0, (FPDF_WIDESTRING)bs.GetBuffer(len), "rb"); |
| 718 bs.ReleaseBuffer(len); | 718 bs.ReleaseBuffer(len); |
| 719 | |
| 720 if (!pFileHandler) | 719 if (!pFileHandler) |
| 721 return nullptr; | 720 return nullptr; |
| 721 |
| 722 return new CFPDF_FileStream(pFileHandler); | 722 return new CFPDF_FileStream(pFileHandler); |
| 723 } | 723 } |
| 724 | 724 |
| 725 FX_BOOL CPDFXFA_DocEnvironment::ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler, | 725 FX_BOOL CPDFXFA_DocEnvironment::ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler, |
| 726 int fileType, | 726 int fileType, |
| 727 FPDF_DWORD encodeType, | 727 FPDF_DWORD encodeType, |
| 728 FPDF_DWORD flag) { | 728 FPDF_DWORD flag) { |
| 729 if (!m_pDocument->GetXFADocView()) | 729 if (!m_pDocument->GetXFADocView()) |
| 730 return FALSE; | 730 return FALSE; |
| 731 | 731 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 !m_pDocument->GetFormFillEnv()->GetJSRuntime()) { | 1025 !m_pDocument->GetFormFillEnv()->GetJSRuntime()) { |
| 1026 return FALSE; | 1026 return FALSE; |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pDocument->GetFormFillEnv(); | 1029 CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pDocument->GetFormFillEnv(); |
| 1030 if (!m_pJSContext) | 1030 if (!m_pJSContext) |
| 1031 m_pJSContext = pFormFillEnv->GetJSRuntime()->NewContext(); | 1031 m_pJSContext = pFormFillEnv->GetJSRuntime()->NewContext(); |
| 1032 | 1032 |
| 1033 return pFormFillEnv->GetJSRuntime()->GetValueByName(szPropName, pValue); | 1033 return pFormFillEnv->GetJSRuntime()->GetValueByName(szPropName, pValue); |
| 1034 } | 1034 } |
| OLD | NEW |