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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 } | 463 } |
464 | 464 |
465 FPDF_FILEHANDLER* CPDFSDK_FormFillEnvironment::OpenFile(int fileType, | 465 FPDF_FILEHANDLER* CPDFSDK_FormFillEnvironment::OpenFile(int fileType, |
466 FPDF_WIDESTRING wsURL, | 466 FPDF_WIDESTRING wsURL, |
467 const char* mode) { | 467 const char* mode) { |
468 if (m_pInfo && m_pInfo->FFI_OpenFile) | 468 if (m_pInfo && m_pInfo->FFI_OpenFile) |
469 return m_pInfo->FFI_OpenFile(m_pInfo, fileType, wsURL, mode); | 469 return m_pInfo->FFI_OpenFile(m_pInfo, fileType, wsURL, mode); |
470 return nullptr; | 470 return nullptr; |
471 } | 471 } |
472 | 472 |
473 IFX_FileRead* CPDFSDK_FormFillEnvironment::DownloadFromURL( | 473 IFX_SeekableReadStream* CPDFSDK_FormFillEnvironment::DownloadFromURL( |
474 const FX_WCHAR* url) { | 474 const FX_WCHAR* url) { |
475 if (!m_pInfo || !m_pInfo->FFI_DownloadFromURL) | 475 if (!m_pInfo || !m_pInfo->FFI_DownloadFromURL) |
476 return nullptr; | 476 return nullptr; |
477 | 477 |
478 CFX_ByteString bstrURL = CFX_WideString(url).UTF16LE_Encode(); | 478 CFX_ByteString bstrURL = CFX_WideString(url).UTF16LE_Encode(); |
479 FPDF_WIDESTRING wsURL = | 479 FPDF_WIDESTRING wsURL = |
480 (FPDF_WIDESTRING)bstrURL.GetBuffer(bstrURL.GetLength()); | 480 (FPDF_WIDESTRING)bstrURL.GetBuffer(bstrURL.GetLength()); |
481 | 481 |
482 FPDF_LPFILEHANDLER fileHandler = m_pInfo->FFI_DownloadFromURL(m_pInfo, wsURL); | 482 FPDF_LPFILEHANDLER fileHandler = m_pInfo->FFI_DownloadFromURL(m_pInfo, wsURL); |
483 | 483 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 } else { | 761 } else { |
762 m_pFocusAnnot.Reset(pFocusAnnot.Get()); | 762 m_pFocusAnnot.Reset(pFocusAnnot.Get()); |
763 } | 763 } |
764 } | 764 } |
765 return FALSE; | 765 return FALSE; |
766 } | 766 } |
767 | 767 |
768 FX_BOOL CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { | 768 FX_BOOL CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { |
769 return GetPDFDocument()->GetUserPermissions() & nFlag; | 769 return GetPDFDocument()->GetUserPermissions() & nFlag; |
770 } | 770 } |
OLD | NEW |