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

Side by Side Diff: fpdfsdk/src/formfiller/FFL_ListBox.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: rebase 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
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/formfiller/FormFiller.h" 7 #include "../../include/formfiller/FormFiller.h"
8 #include "../../include/formfiller/FFL_FormFiller.h" 8 #include "../../include/formfiller/FFL_FormFiller.h"
9 #include "../../include/formfiller/FFL_ListBox.h" 9 #include "../../include/formfiller/FFL_ListBox.h"
10 //#include "../../include/formfiller/FFL_Module.h" 10 //#include "../../include/formfiller/FFL_Module.h"
11 #include "../../include/formfiller/FFL_IFormFiller.h" 11 #include "../../include/formfiller/FFL_IFormFiller.h"
12 //#include "../../include/formfiller/FFL_Undo.h" 12 //#include "../../include/formfiller/FFL_Undo.h"
13 #include "../../include/formfiller/FFL_CBA_Fontmap.h" 13 #include "../../include/formfiller/FFL_CBA_Fontmap.h"
14 14
15 15
16 #define FFL_DEFAULTLISTBOXFONTSIZE 12.0f 16 #define FFL_DEFAULTLISTBOXFONTSIZE 12.0f
17 17
18 18
19 /* ------------------------------- CFFL_ListBox ------------------------------- */ 19 /* ------------------------------- CFFL_ListBox ------------------------------- */
20 20
21 CFFL_ListBox::CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) : 21 CFFL_ListBox::CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
22 CFFL_FormFiller(pApp, pWidget), 22 CFFL_FormFiller(pApp, pWidget),
23 m_pFontMap(NULL) 23 m_pFontMap(NULL)
24 { 24 {
25 } 25 }
26 26
27 CFFL_ListBox::~CFFL_ListBox() 27 CFFL_ListBox::~CFFL_ListBox()
28 { 28 {
29 » if (m_pFontMap) 29 delete m_pFontMap;
Tom Sepez 2015/07/16 17:22:44 nit: ditto.
Lei Zhang 2015/07/16 21:20:48 Done.
30 » { 30 m_pFontMap = NULL;
31 » » delete m_pFontMap;
32 » » m_pFontMap = NULL;
33 » }
34 } 31 }
35 32
36 PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() 33 PWL_CREATEPARAM CFFL_ListBox::GetCreateParam()
37 { 34 {
38 PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam(); 35 PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
39 36
40 ASSERT(m_pWidget != NULL); 37 ASSERT(m_pWidget != NULL);
41 FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags(); 38 FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
42 39
43 if (dwFieldFlag & FIELDFLAG_MULTISELECT) 40 if (dwFieldFlag & FIELDFLAG_MULTISELECT)
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 289
293 if (CommitData(pPageView, nFlag)) 290 if (CommitData(pPageView, nFlag))
294 { 291 {
295 DestroyPDFWindow(pPageView); 292 DestroyPDFWindow(pPageView);
296 m_bValid = FALSE; 293 m_bValid = FALSE;
297 } 294 }
298 } 295 }
299 } 296 }
300 } 297 }
301 298
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698