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/cpdfsdk_formfillenvironment.h" | 7 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 const FX_WCHAR* url) { | 466 const FX_WCHAR* url) { |
467 if (!m_pInfo || !m_pInfo->FFI_DownloadFromURL) | 467 if (!m_pInfo || !m_pInfo->FFI_DownloadFromURL) |
468 return nullptr; | 468 return nullptr; |
469 | 469 |
470 CFX_ByteString bstrURL = CFX_WideString(url).UTF16LE_Encode(); | 470 CFX_ByteString bstrURL = CFX_WideString(url).UTF16LE_Encode(); |
471 FPDF_WIDESTRING wsURL = | 471 FPDF_WIDESTRING wsURL = |
472 (FPDF_WIDESTRING)bstrURL.GetBuffer(bstrURL.GetLength()); | 472 (FPDF_WIDESTRING)bstrURL.GetBuffer(bstrURL.GetLength()); |
473 | 473 |
474 FPDF_LPFILEHANDLER fileHandler = m_pInfo->FFI_DownloadFromURL(m_pInfo, wsURL); | 474 FPDF_LPFILEHANDLER fileHandler = m_pInfo->FFI_DownloadFromURL(m_pInfo, wsURL); |
475 | 475 |
476 return new CFPDF_FileStream(fileHandler); | 476 return MakeSeekableStream(fileHandler); |
477 } | 477 } |
478 | 478 |
479 CFX_WideString CPDFSDK_FormFillEnvironment::PostRequestURL( | 479 CFX_WideString CPDFSDK_FormFillEnvironment::PostRequestURL( |
480 const FX_WCHAR* wsURL, | 480 const FX_WCHAR* wsURL, |
481 const FX_WCHAR* wsData, | 481 const FX_WCHAR* wsData, |
482 const FX_WCHAR* wsContentType, | 482 const FX_WCHAR* wsContentType, |
483 const FX_WCHAR* wsEncode, | 483 const FX_WCHAR* wsEncode, |
484 const FX_WCHAR* wsHeader) { | 484 const FX_WCHAR* wsHeader) { |
485 if (!m_pInfo || !m_pInfo->FFI_PostRequestURL) | 485 if (!m_pInfo || !m_pInfo->FFI_PostRequestURL) |
486 return L""; | 486 return L""; |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 } else { | 753 } else { |
754 m_pFocusAnnot.Reset(pFocusAnnot.Get()); | 754 m_pFocusAnnot.Reset(pFocusAnnot.Get()); |
755 } | 755 } |
756 } | 756 } |
757 return false; | 757 return false; |
758 } | 758 } |
759 | 759 |
760 bool CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { | 760 bool CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { |
761 return !!(GetPDFDocument()->GetUserPermissions() & nFlag); | 761 return !!(GetPDFDocument()->GetUserPermissions() & nFlag); |
762 } | 762 } |
OLD | NEW |