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

Side by Side Diff: fpdfsdk/src/pdfwindow/PWL_FontMap.cpp

Issue 1195363002: Cleanup: Do not check pointers before deleting them, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: nits Created 5 years, 5 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/javascript/JS_Runtime.cpp ('k') | no next file » | 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 "../../include/pdfwindow/PDFWindow.h" 7 #include "../../include/pdfwindow/PDFWindow.h"
8 #include "../../include/pdfwindow/PWL_Wnd.h" 8 #include "../../include/pdfwindow/PWL_Wnd.h"
9 #include "../../include/pdfwindow/PWL_FontMap.h" 9 #include "../../include/pdfwindow/PWL_FontMap.h"
10 10
11 #define DEFAULT_FONT_NAME "Helvetica" 11 #define DEFAULT_FONT_NAME "Helvetica"
12 12
13 /* ------------------------------ CPWL_FontMap ------------------------------ */ 13 /* ------------------------------ CPWL_FontMap ------------------------------ */
14 14
15 CPWL_FontMap::CPWL_FontMap(IFX_SystemHandler* pSystemHandler) : 15 CPWL_FontMap::CPWL_FontMap(IFX_SystemHandler* pSystemHandler) :
16 m_pPDFDoc(NULL), 16 m_pPDFDoc(NULL),
17 m_pSystemHandler(pSystemHandler) 17 m_pSystemHandler(pSystemHandler)
18 { 18 {
19 ASSERT(m_pSystemHandler != NULL); 19 ASSERT(m_pSystemHandler != NULL);
20 } 20 }
21 21
22 CPWL_FontMap::~CPWL_FontMap() 22 CPWL_FontMap::~CPWL_FontMap()
23 { 23 {
24 » if (m_pPDFDoc) 24 delete m_pPDFDoc;
25 » { 25 m_pPDFDoc = NULL;
26 » » delete m_pPDFDoc;
27 » » m_pPDFDoc = NULL;
28 » }
29 26
30 » Empty(); 27 Empty();
31 } 28 }
32 29
33 void CPWL_FontMap::SetSystemHandler(IFX_SystemHandler* pSystemHandler) 30 void CPWL_FontMap::SetSystemHandler(IFX_SystemHandler* pSystemHandler)
34 { 31 {
35 m_pSystemHandler = pSystemHandler; 32 m_pSystemHandler = pSystemHandler;
36 } 33 }
37 34
38 CPDF_Document* CPWL_FontMap::GetDocument() 35 CPDF_Document* CPWL_FontMap::GetDocument()
39 { 36 {
40 if (!m_pPDFDoc) 37 if (!m_pPDFDoc)
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 } 587 }
591 588
592 CPWL_DocFontMap::~CPWL_DocFontMap() 589 CPWL_DocFontMap::~CPWL_DocFontMap()
593 { 590 {
594 } 591 }
595 592
596 CPDF_Document* CPWL_DocFontMap::GetDocument() 593 CPDF_Document* CPWL_DocFontMap::GetDocument()
597 { 594 {
598 return m_pAttachedDoc; 595 return m_pAttachedDoc;
599 } 596 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/JS_Runtime.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698