From 93c9ec2f01187be03340da1029c0deb7bc8ba03d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Oct 2017 19:39:29 +0200 Subject: [PATCH] Remove unnecessary check from DoNativeBeforeUpdate() Don't test if we're using the native task dialog in this function because it is only called if we are, so simplify the code by omitting this check. --- src/msw/progdlg.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index dd497efd93..bae1c0c723 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -511,31 +511,28 @@ bool wxProgressDialog::Pulse(const wxString& newmsg, bool *skip) bool wxProgressDialog::DoNativeBeforeUpdate(bool *skip) { #ifdef wxHAS_MSW_TASKDIALOG - if ( HasNativeTaskDialog() ) + wxCriticalSectionLocker locker(m_sharedData->m_cs); + + if ( m_sharedData->m_skipped ) { - wxCriticalSectionLocker locker(m_sharedData->m_cs); - - if ( m_sharedData->m_skipped ) + if ( skip && !*skip ) { - if ( skip && !*skip ) - { - *skip = true; - m_sharedData->m_skipped = false; - m_sharedData->m_notifications |= wxSPDD_ENABLE_SKIP; - } + *skip = true; + m_sharedData->m_skipped = false; + m_sharedData->m_notifications |= wxSPDD_ENABLE_SKIP; } - - if ( m_sharedData->m_state == Canceled ) - m_timeStop = m_sharedData->m_timeStop; - - return m_sharedData->m_state != Canceled; } -#endif // wxHAS_MSW_TASKDIALOG + if ( m_sharedData->m_state == Canceled ) + m_timeStop = m_sharedData->m_timeStop; + + return m_sharedData->m_state != Canceled; +#else // !wxHAS_MSW_TASKDIALOG wxUnusedVar(skip); wxFAIL_MSG( "unreachable" ); return false; +#endif // wxHAS_MSW_TASKDIALOG/!wxHAS_MSW_TASKDIALOG } void wxProgressDialog::Resume()