| 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 "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 CCodec_ModuleMgr* g_pCodecModule = nullptr; | 255 CCodec_ModuleMgr* g_pCodecModule = nullptr; |
| 256 | 256 |
| 257 DLLEXPORT void STDCALL FPDF_InitLibrary() { | 257 DLLEXPORT void STDCALL FPDF_InitLibrary() { |
| 258 FPDF_InitLibraryWithConfig(nullptr); | 258 FPDF_InitLibraryWithConfig(nullptr); |
| 259 } | 259 } |
| 260 | 260 |
| 261 DLLEXPORT void STDCALL | 261 DLLEXPORT void STDCALL |
| 262 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { | 262 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { |
| 263 g_pCodecModule = new CCodec_ModuleMgr(); | 263 g_pCodecModule = new CCodec_ModuleMgr(); |
| 264 | 264 |
| 265 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr, g_pCodecModule); | 265 CFX_GEModule* pModule = CFX_GEModule::Get(); |
| 266 CPDF_ModuleMgr::Create(); | 266 pModule->Init(cfg ? cfg->m_pUserFontPaths : nullptr, g_pCodecModule); |
| 267 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get(); | 267 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get(); |
| 268 pModuleMgr->SetCodecModule(g_pCodecModule); | 268 pModuleMgr->SetCodecModule(g_pCodecModule); |
| 269 pModuleMgr->InitPageModule(); | 269 pModuleMgr->InitPageModule(); |
| 270 pModuleMgr->LoadEmbeddedGB1CMaps(); | 270 pModuleMgr->LoadEmbeddedGB1CMaps(); |
| 271 pModuleMgr->LoadEmbeddedJapan1CMaps(); | 271 pModuleMgr->LoadEmbeddedJapan1CMaps(); |
| 272 pModuleMgr->LoadEmbeddedCNS1CMaps(); | 272 pModuleMgr->LoadEmbeddedCNS1CMaps(); |
| 273 pModuleMgr->LoadEmbeddedKorea1CMaps(); | 273 pModuleMgr->LoadEmbeddedKorea1CMaps(); |
| 274 | 274 |
| 275 #ifdef PDF_ENABLE_XFA | 275 #ifdef PDF_ENABLE_XFA |
| 276 CPDFXFA_App::GetInstance()->Initialize( | 276 CPDFXFA_App::GetInstance()->Initialize( |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 if (!buffer) { | 1108 if (!buffer) { |
| 1109 *buflen = len; | 1109 *buflen = len; |
| 1110 } else if (*buflen >= len) { | 1110 } else if (*buflen >= len) { |
| 1111 memcpy(buffer, utf16Name.c_str(), len); | 1111 memcpy(buffer, utf16Name.c_str(), len); |
| 1112 *buflen = len; | 1112 *buflen = len; |
| 1113 } else { | 1113 } else { |
| 1114 *buflen = -1; | 1114 *buflen = -1; |
| 1115 } | 1115 } |
| 1116 return (FPDF_DEST)pDestObj; | 1116 return (FPDF_DEST)pDestObj; |
| 1117 } | 1117 } |
| OLD | NEW |