| 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 "core/fpdfapi/parser/cpdf_document.h" | 7 #include "core/fpdfapi/parser/cpdf_document.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "core/fpdfapi/cpdf_modulemgr.h" | 13 #include "core/fpdfapi/cpdf_modulemgr.h" |
| 14 #include "core/fpdfapi/font/cpdf_fontencoding.h" | 14 #include "core/fpdfapi/font/cpdf_fontencoding.h" |
| 15 #include "core/fpdfapi/page/cpdf_docpagedata.h" | 15 #include "core/fpdfapi/page/cpdf_docpagedata.h" |
| 16 #include "core/fpdfapi/page/cpdf_pagemodule.h" | 16 #include "core/fpdfapi/page/cpdf_pagemodule.h" |
| 17 #include "core/fpdfapi/page/pageint.h" | 17 #include "core/fpdfapi/page/pageint.h" |
| 18 #include "core/fpdfapi/parser/cpdf_array.h" | 18 #include "core/fpdfapi/parser/cpdf_array.h" |
| 19 #include "core/fpdfapi/parser/cpdf_dictionary.h" | 19 #include "core/fpdfapi/parser/cpdf_dictionary.h" |
| 20 #include "core/fpdfapi/parser/cpdf_linearized.h" | 20 #include "core/fpdfapi/parser/cpdf_linearized_header.h" |
| 21 #include "core/fpdfapi/parser/cpdf_number.h" | 21 #include "core/fpdfapi/parser/cpdf_number.h" |
| 22 #include "core/fpdfapi/parser/cpdf_parser.h" | 22 #include "core/fpdfapi/parser/cpdf_parser.h" |
| 23 #include "core/fpdfapi/parser/cpdf_reference.h" | 23 #include "core/fpdfapi/parser/cpdf_reference.h" |
| 24 #include "core/fpdfapi/parser/cpdf_stream.h" | 24 #include "core/fpdfapi/parser/cpdf_stream.h" |
| 25 #include "core/fpdfapi/render/render_int.h" | 25 #include "core/fpdfapi/render/render_int.h" |
| 26 #include "core/fxcodec/JBig2_DocumentContext.h" | 26 #include "core/fxcodec/JBig2_DocumentContext.h" |
| 27 #include "core/fxge/cfx_unicodeencoding.h" | 27 #include "core/fxge/cfx_unicodeencoding.h" |
| 28 #include "core/fxge/fx_font.h" | 28 #include "core/fxge/fx_font.h" |
| 29 #include "third_party/base/ptr_util.h" | 29 #include "third_party/base/ptr_util.h" |
| 30 #include "third_party/base/stl_util.h" | 30 #include "third_party/base/stl_util.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 if (pInfoObj) | 373 if (pInfoObj) |
| 374 m_pInfoDict = pInfoObj->GetDict(); | 374 m_pInfoDict = pInfoObj->GetDict(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void CPDF_Document::LoadDoc() { | 377 void CPDF_Document::LoadDoc() { |
| 378 LoadDocInternal(); | 378 LoadDocInternal(); |
| 379 m_PageList.SetSize(RetrievePageCount()); | 379 m_PageList.SetSize(RetrievePageCount()); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void CPDF_Document::LoadLinearizedDoc( | 382 void CPDF_Document::LoadLinearizedDoc( |
| 383 const CPDF_Linearized* pLinearizationParams) { | 383 const CPDF_LinearizedHeader* pLinearizationParams) { |
| 384 m_bLinearized = true; | 384 m_bLinearized = true; |
| 385 LoadDocInternal(); | 385 LoadDocInternal(); |
| 386 m_PageList.SetSize(pLinearizationParams->GetPageCount()); | 386 m_PageList.SetSize(pLinearizationParams->GetPageCount()); |
| 387 m_iFirstPageNo = pLinearizationParams->GetFirstPageNo(); | 387 m_iFirstPageNo = pLinearizationParams->GetFirstPageNo(); |
| 388 m_dwFirstPageObjNum = pLinearizationParams->GetFirstPageObjNum(); | 388 m_dwFirstPageObjNum = pLinearizationParams->GetFirstPageObjNum(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 void CPDF_Document::LoadPages() { | 391 void CPDF_Document::LoadPages() { |
| 392 m_PageList.SetSize(RetrievePageCount()); | 392 m_PageList.SetSize(RetrievePageCount()); |
| 393 } | 393 } |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 pBBox, pLogFont->lfWeight / 5); | 1036 pBBox, pLogFont->lfWeight / 5); |
| 1037 pFontDesc->SetIntegerFor("CapHeight", capheight); | 1037 pFontDesc->SetIntegerFor("CapHeight", capheight); |
| 1038 pFontDict->SetReferenceFor("FontDescriptor", this, | 1038 pFontDict->SetReferenceFor("FontDescriptor", this, |
| 1039 AddIndirectObject(pFontDesc)); | 1039 AddIndirectObject(pFontDesc)); |
| 1040 hFont = SelectObject(hDC, hFont); | 1040 hFont = SelectObject(hDC, hFont); |
| 1041 DeleteObject(hFont); | 1041 DeleteObject(hFont); |
| 1042 DeleteDC(hDC); | 1042 DeleteDC(hDC); |
| 1043 return LoadFont(pBaseDict); | 1043 return LoadFont(pBaseDict); |
| 1044 } | 1044 } |
| 1045 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 1045 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| OLD | NEW |