remove m_endModalCalled flag, it seems to be unnecessary

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-21 01:37:39 +00:00
parent 88a6739128
commit 89424d9b35
2 changed files with 2 additions and 9 deletions

View File

@@ -120,8 +120,6 @@ private:
// gripper if we have one // gripper if we have one
void OnWindowCreate(wxWindowCreateEvent& event); void OnWindowCreate(wxWindowCreateEvent& event);
bool m_endModalCalled; // allow for closing within InitDialog
#if wxUSE_TOOLBAR && defined(__POCKETPC__) #if wxUSE_TOOLBAR && defined(__POCKETPC__)
wxToolBar* m_dialogToolBar; wxToolBar* m_dialogToolBar;
#endif #endif

View File

@@ -147,7 +147,6 @@ void wxDialog::Init()
{ {
m_isShown = false; m_isShown = false;
m_modalData = NULL; m_modalData = NULL;
m_endModalCalled = false;
#if wxUSE_TOOLBAR && defined(__POCKETPC__) #if wxUSE_TOOLBAR && defined(__POCKETPC__)
m_dialogToolBar = NULL; m_dialogToolBar = NULL;
#endif #endif
@@ -281,14 +280,11 @@ int wxDialog::ShowModal()
{ {
wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") ); wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") );
m_endModalCalled = false;
Show(); Show();
// EndModal may have been called from InitDialog handler (called from // EndModal may have been called from InitDialog handler (called from
// inside Show()), which would cause an infinite loop if we didn't take it // inside Show()) and hidden the dialog back again
// into account if ( !IsShown() )
if ( !m_endModalCalled )
{ {
// enter and run the modal loop // enter and run the modal loop
wxDialogModalDataTiedPtr modalData(&m_modalData, wxDialogModalDataTiedPtr modalData(&m_modalData,
@@ -303,7 +299,6 @@ void wxDialog::EndModal(int retCode)
{ {
wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") ); wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
m_endModalCalled = true;
SetReturnCode(retCode); SetReturnCode(retCode);
Hide(); Hide();