| 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 "xfa/fxfa/include/xfa_ffapp.h" | 7 #include "xfa/fxfa/include/xfa_ffapp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 return m_pDocHandler; | 108 return m_pDocHandler; |
| 109 } | 109 } |
| 110 CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, | 110 CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, |
| 111 IFX_FileRead* pStream, | 111 IFX_FileRead* pStream, |
| 112 FX_BOOL bTakeOverFile) { | 112 FX_BOOL bTakeOverFile) { |
| 113 CXFA_FFDoc* pDoc = new CXFA_FFDoc(this, pProvider); | 113 CXFA_FFDoc* pDoc = new CXFA_FFDoc(this, pProvider); |
| 114 FX_BOOL bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile); | 114 FX_BOOL bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile); |
| 115 if (!bSuccess) { | 115 if (!bSuccess) { |
| 116 delete pDoc; | 116 delete pDoc; |
| 117 pDoc = NULL; | 117 pDoc = nullptr; |
| 118 } | 118 } |
| 119 return pDoc; | 119 return pDoc; |
| 120 } | 120 } |
| 121 CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, | 121 CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocProvider* pProvider, |
| 122 CPDF_Document* pPDFDoc) { | 122 CPDF_Document* pPDFDoc) { |
| 123 if (pPDFDoc == NULL) { | 123 if (!pPDFDoc) |
| 124 return NULL; | 124 return nullptr; |
| 125 } | 125 |
| 126 CXFA_FFDoc* pDoc = new CXFA_FFDoc(this, pProvider); | 126 CXFA_FFDoc* pDoc = new CXFA_FFDoc(this, pProvider); |
| 127 FX_BOOL bSuccess = pDoc->OpenDoc(pPDFDoc); | 127 FX_BOOL bSuccess = pDoc->OpenDoc(pPDFDoc); |
| 128 if (!bSuccess) { | 128 if (!bSuccess) { |
| 129 delete pDoc; | 129 delete pDoc; |
| 130 pDoc = NULL; | 130 pDoc = nullptr; |
| 131 } | 131 } |
| 132 return pDoc; | 132 return pDoc; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void CXFA_FFApp::SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr) { | 135 void CXFA_FFApp::SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr) { |
| 136 if (!m_pFontMgr) | 136 if (!m_pFontMgr) |
| 137 m_pFontMgr = new CXFA_FontMgr(); | 137 m_pFontMgr = new CXFA_FontMgr(); |
| 138 m_pFontMgr->SetDefFontMgr(std::move(pFontMgr)); | 138 m_pFontMgr->SetDefFontMgr(std::move(pFontMgr)); |
| 139 } | 139 } |
| 140 | 140 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 165 m_pAdapterWidgetMgr = new CXFA_FWLAdapterWidgetMgr; | 165 m_pAdapterWidgetMgr = new CXFA_FWLAdapterWidgetMgr; |
| 166 pDelegate->OnSetCapability(FWL_WGTMGR_DisableThread | | 166 pDelegate->OnSetCapability(FWL_WGTMGR_DisableThread | |
| 167 FWL_WGTMGR_DisableForm); | 167 FWL_WGTMGR_DisableForm); |
| 168 m_pWidgetMgrDelegate = pDelegate; | 168 m_pWidgetMgrDelegate = pDelegate; |
| 169 } | 169 } |
| 170 return m_pAdapterWidgetMgr; | 170 return m_pAdapterWidgetMgr; |
| 171 } | 171 } |
| 172 IFWL_AdapterTimerMgr* CXFA_FFApp::GetTimerMgr() { | 172 IFWL_AdapterTimerMgr* CXFA_FFApp::GetTimerMgr() { |
| 173 return m_pProvider->GetTimerMgr(); | 173 return m_pProvider->GetTimerMgr(); |
| 174 } | 174 } |
| OLD | NEW |