From: Vadim Zeitlin Date: Sun, 18 Dec 2005 22:33:35 +0000 (+0000) Subject: assert if opening more than one find/replace dialog under the same parent -- this... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cba1c2ca127cbc8ce1aeb87b13b968caff0f995e assert if opening more than one find/replace dialog under the same parent -- this doesn't work currently (and maybe can't work at all) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index 0c3f2cff64..5fa2be38e2 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -190,14 +190,14 @@ void wxFindReplaceDialogImpl::SubclassDialog(HWND hwnd) // check that we don't subclass the parent twice: this would be a bad idea // as then we'd have infinite recursion in wxFindReplaceWindowProc - if ( !wxCheckWindowWndProc((WXHWND)hwnd, (WXFARPROC)wxFindReplaceWindowProc) ) - { - // set the new one and save the old as user data to allow access to it - // from wxFindReplaceWindowProc - m_oldParentWndProc = wxSetWindowProc(hwnd, wxFindReplaceWindowProc); + wxCHECK_RET( wxGetWindowProc(hwnd) != wxFindReplaceWindowProc, + _T("can't have more than one find dialog currently") ); - wxSetWindowUserData(hwnd, (void *)m_oldParentWndProc); - } + // set the new one and save the old as user data to allow access to it + // from wxFindReplaceWindowProc + m_oldParentWndProc = wxSetWindowProc(hwnd, wxFindReplaceWindowProc); + + wxSetWindowUserData(hwnd, (void *)m_oldParentWndProc); } wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl()