Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp

Issue 1399833002: Allow building of XFA branch without XFA (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Keep GN in sync. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/fpdf_formfill.h" 7 #include "../../../public/fpdf_formfill.h"
8 #include "../../include/fsdk_define.h" 8 #include "../../include/fsdk_define.h"
9 #include "../../include/fsdk_mgr.h" 9 #include "../../include/fsdk_mgr.h"
10 #include "../../include/fpdfxfa/fpdfxfa_doc.h" 10 #include "../../include/fpdfxfa/fpdfxfa_doc.h"
(...skipping 25 matching lines...) Expand all
36 m_pEnvList.RemoveAll(); 36 m_pEnvList.RemoveAll();
37 } 37 }
38 38
39 CPDFXFA_App::~CPDFXFA_App() { 39 CPDFXFA_App::~CPDFXFA_App() {
40 delete m_pFontMgr; 40 delete m_pFontMgr;
41 m_pFontMgr = NULL; 41 m_pFontMgr = NULL;
42 42
43 delete m_pXFAApp; 43 delete m_pXFAApp;
44 m_pXFAApp = NULL; 44 m_pXFAApp = NULL;
45 45
46 #ifdef PDF_ENABLE_XFA
46 FXJSE_Runtime_Release(m_hJSERuntime); 47 FXJSE_Runtime_Release(m_hJSERuntime);
47 m_hJSERuntime = NULL; 48 m_hJSERuntime = NULL;
48 49
49 FXJSE_Finalize(); 50 FXJSE_Finalize();
50 BC_Library_Destory(); 51 BC_Library_Destory();
52 #endif
51 } 53 }
52 54
53 FX_BOOL CPDFXFA_App::Initialize() { 55 FX_BOOL CPDFXFA_App::Initialize() {
56 #ifdef PDF_ENABLE_XFA
54 BC_Library_Init(); 57 BC_Library_Init();
55 FXJSE_Initialize(); 58 FXJSE_Initialize();
56 59
57 m_hJSERuntime = FXJSE_Runtime_Create(); 60 m_hJSERuntime = FXJSE_Runtime_Create();
58 if (!m_hJSERuntime) 61 if (!m_hJSERuntime)
59 return FALSE; 62 return FALSE;
60 63
61 m_pXFAApp = IXFA_App::Create(this); 64 m_pXFAApp = IXFA_App::Create(this);
62 if (!m_pXFAApp) 65 if (!m_pXFAApp)
63 return FALSE; 66 return FALSE;
64 67
65 m_pFontMgr = IXFA_FontMgr::CreateDefault(); 68 m_pFontMgr = IXFA_FontMgr::CreateDefault();
66 if (!m_pFontMgr) 69 if (!m_pFontMgr)
67 return FALSE; 70 return FALSE;
68 71
69 m_pXFAApp->SetDefaultFontMgr(m_pFontMgr); 72 m_pXFAApp->SetDefaultFontMgr(m_pFontMgr);
73 #endif
70 return TRUE; 74 return TRUE;
71 } 75 }
72 76
73 FX_BOOL CPDFXFA_App::AddFormFillEnv(CPDFDoc_Environment* pEnv) { 77 FX_BOOL CPDFXFA_App::AddFormFillEnv(CPDFDoc_Environment* pEnv) {
74 if (!pEnv) 78 if (!pEnv)
75 return FALSE; 79 return FALSE;
76 80
77 m_pEnvList.Add(pEnv); 81 m_pEnvList.Add(pEnv);
78 return TRUE; 82 return TRUE;
79 } 83 }
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 return FALSE; 527 return FALSE;
524 } 528 }
525 529
526 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { 530 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() {
527 CXFA_FWLAdapterTimerMgr* pAdapter = NULL; 531 CXFA_FWLAdapterTimerMgr* pAdapter = NULL;
528 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); 532 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
529 if (pEnv) 533 if (pEnv)
530 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); 534 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv);
531 return pAdapter; 535 return pAdapter;
532 } 536 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698