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

Side by Side Diff: fpdfsdk/pdfwindow/PWL_ListBox.cpp

Issue 2160023002: Reset notify parameter in CPWL_ListBox OnDestroy(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 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 | « no previous file | 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 "fpdfsdk/pdfwindow/PWL_ListBox.h" 7 #include "fpdfsdk/pdfwindow/PWL_ListBox.h"
8 8
9 #include "fpdfsdk/fxedit/include/fxet_edit.h" 9 #include "fpdfsdk/fxedit/include/fxet_edit.h"
10 #include "fpdfsdk/fxedit/include/fxet_list.h" 10 #include "fpdfsdk/fxedit/include/fxet_list.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 m_pList->InvalidateRect(pRect); 66 m_pList->InvalidateRect(pRect);
67 } 67 }
68 68
69 CPWL_ListBox::CPWL_ListBox() 69 CPWL_ListBox::CPWL_ListBox()
70 : m_pList(new CFX_ListCtrl), 70 : m_pList(new CFX_ListCtrl),
71 m_bMouseDown(FALSE), 71 m_bMouseDown(FALSE),
72 m_bHoverSel(FALSE), 72 m_bHoverSel(FALSE),
73 m_pFillerNotify(nullptr) {} 73 m_pFillerNotify(nullptr) {}
74 74
75 CPWL_ListBox::~CPWL_ListBox() { 75 CPWL_ListBox::~CPWL_ListBox() {
76 // Remove the notifier from the list before we start destruction because
77 // CFX_ListCtrl will cause an invalidation on destruction. That invalidation
78 // will call into the m_pListNotify object, but, m_pListNotify may have
Lei Zhang 2016/07/18 22:22:07 |m_pListNotify|, no comma after "but"
dsinclair 2016/07/19 13:13:45 Done.
79 // already been destroyed.
80 if (m_pList)
Lei Zhang 2016/07/18 22:22:07 BTW, I think this always evals to true? Maybe for
dsinclair 2016/07/19 13:13:45 Possibly, have to check the child classes to see i
81 m_pList->SetNotify(nullptr);
Lei Zhang 2016/07/18 22:22:07 Should this be in OnDestroy() below to mirror the
dsinclair 2016/07/19 13:13:45 Done.
76 } 82 }
77 83
78 CFX_ByteString CPWL_ListBox::GetClassName() const { 84 CFX_ByteString CPWL_ListBox::GetClassName() const {
79 return "CPWL_ListBox"; 85 return "CPWL_ListBox";
80 } 86 }
81 87
82 void CPWL_ListBox::OnCreated() { 88 void CPWL_ListBox::OnCreated() {
83 if (m_pList) { 89 if (m_pList) {
84 m_pList->SetFontMap(GetFontMap()); 90 m_pList->SetFontMap(GetFontMap());
85 m_pListNotify.reset(new CPWL_List_Notify(this)); 91 m_pListNotify.reset(new CPWL_List_Notify(this));
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 if (zDelta < 0) { 528 if (zDelta < 0) {
523 m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); 529 m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag));
524 } else { 530 } else {
525 m_pList->OnVK_UP(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); 531 m_pList->OnVK_UP(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag));
526 } 532 }
527 533
528 FX_BOOL bExit = FALSE; 534 FX_BOOL bExit = FALSE;
529 OnNotifySelChanged(FALSE, bExit, nFlag); 535 OnNotifySelChanged(FALSE, bExit, nFlag);
530 return TRUE; 536 return TRUE;
531 } 537 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698