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

Side by Side Diff: fpdfsdk/src/formfiller/FFL_IFormFiller.cpp

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 6 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 | « core/src/fxge/win32/fx_win32_print.cpp ('k') | fpdfsdk/src/fpdf_dataavail.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 "../../include/formfiller/FFL_FormFiller.h" 7 #include "../../include/formfiller/FFL_FormFiller.h"
8 #include "../../include/formfiller/FFL_IFormFiller.h" 8 #include "../../include/formfiller/FFL_IFormFiller.h"
9 #include "../../include/formfiller/FFL_CheckBox.h" 9 #include "../../include/formfiller/FFL_CheckBox.h"
10 #include "../../include/formfiller/FFL_ComboBox.h" 10 #include "../../include/formfiller/FFL_ComboBox.h"
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 void CFFL_IFormFiller::RemoveFormFiller(CPDFSDK_Annot* pAnnot) 697 void CFFL_IFormFiller::RemoveFormFiller(CPDFSDK_Annot* pAnnot)
698 { 698 {
699 if ( pAnnot != NULL ) 699 if ( pAnnot != NULL )
700 { 700 {
701 UnRegisterFormFiller( pAnnot ); 701 UnRegisterFormFiller( pAnnot );
702 } 702 }
703 } 703 }
704 704
705 void CFFL_IFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) 705 void CFFL_IFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot)
706 { 706 {
707 » CFFL_FormFiller * pFormFiller = NULL; 707 CFFL_FormFiller* pFormFiller = nullptr;
708 708 if (m_Maps.Lookup(pAnnot,pFormFiller)) {
709 » if (m_Maps.Lookup(pAnnot,pFormFiller)) 709 delete pFormFiller;
710 » { 710 m_Maps.RemoveKey(pAnnot);
711 » » if (pFormFiller) 711 }
712 » » » delete pFormFiller;
713 » » m_Maps.RemoveKey(pAnnot);
714 » }
715 } 712 }
716 713
717 void CFFL_IFormFiller::SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameFie ld, FX_BOOL bNext) 714 void CFFL_IFormFiller::SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameFie ld, FX_BOOL bNext)
718 { 715 {
719 716
720 } 717 }
721 718
722 void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX _FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet) 719 void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX _FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet)
723 { 720 {
724 ASSERT(pPrivateData != NULL); 721 ASSERT(pPrivateData != NULL);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 ASSERT(pPrivateData != NULL); 1128 ASSERT(pPrivateData != NULL);
1132 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; 1129 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
1133 ASSERT(pData->pWidget != NULL); 1130 ASSERT(pData->pWidget != NULL);
1134 1131
1135 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); 1132 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
1136 ASSERT(pFormFiller != NULL); 1133 ASSERT(pFormFiller != NULL);
1137 1134
1138 if (!bEditOrList) 1135 if (!bEditOrList)
1139 pFormFiller->OnKeyStroke(bExit); 1136 pFormFiller->OnKeyStroke(bExit);
1140 } 1137 }
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_print.cpp ('k') | fpdfsdk/src/fpdf_dataavail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698