| 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 "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
| 8 #include "../include/fpdfview.h" | 8 #include "../include/fpdfview.h" |
| 9 #include "../include/fsdk_rendercontext.h" | 9 #include "../include/fsdk_rendercontext.h" |
| 10 #include "../include/fpdf_progressive.h" | 10 #include "../include/fpdf_progressive.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 catch (...) { | 276 catch (...) { |
| 277 delete pParser; | 277 delete pParser; |
| 278 SetLastError(FPDF_ERR_UNKNOWN); | 278 SetLastError(FPDF_ERR_UNKNOWN); |
| 279 return NULL; | 279 return NULL; |
| 280 } | 280 } |
| 281 return pParser->GetDocument(); | 281 return pParser->GetDocument(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code); | 284 extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code); |
| 285 | 285 |
| 286 class CMemFile: public IFX_FileRead, public CFX_Object | 286 class CMemFile FX_FINAL: public IFX_FileRead, public CFX_Object |
| 287 { | 287 { |
| 288 public: | 288 public: |
| 289 CMemFile(FX_BYTE* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {} | 289 CMemFile(FX_BYTE* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {} |
| 290 | 290 |
| 291 virtual void Release() {delete this;} | 291 virtual void Release() {delete this;} |
| 292 virtual FX_FILESIZE GetSize() {return m_size;} | 292 virtual FX_FILESIZE GetSize() {return m_size;} |
| 293 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offs
et, size_t size) | 293 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offs
et, size_t size) |
| 294 { | 294 { |
| 295 if(offset+size > (FX_DWORD)m_size) return FALSE; | 295 if(offset+size > (FX_DWORD)m_size) return FALSE; |
| 296 FXSYS_memcpy(buffer, m_pBuf+offset, size); | 296 FXSYS_memcpy(buffer, m_pBuf+offset, size); |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 { | 894 { |
| 895 if (document == NULL) | 895 if (document == NULL) |
| 896 return NULL; | 896 return NULL; |
| 897 if (name == NULL || name[0] == 0) | 897 if (name == NULL || name[0] == 0) |
| 898 return NULL; | 898 return NULL; |
| 899 | 899 |
| 900 CPDF_Document* pDoc = (CPDF_Document*)document; | 900 CPDF_Document* pDoc = (CPDF_Document*)document; |
| 901 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); | 901 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); |
| 902 return name_tree.LookupNamedDest(pDoc, name); | 902 return name_tree.LookupNamedDest(pDoc, name); |
| 903 } | 903 } |
| OLD | NEW |