From 5a3fd23a68128171b8701dbf48db343203c4962c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 31 Oct 2017 17:32:27 +0100 Subject: [PATCH] Remove a now redundant test in UpdateExpandedInformation() Checking for m_progressBarMarquee is not necessary any longer, just testing the value is enough. Update the comments to explain why is it so. No real changes. --- src/msw/progdlg.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 49a33eb49e..15b24e40bf 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -569,8 +569,8 @@ bool wxProgressDialog::Pulse(const wxString& newmsg, bool *skip) m_sharedData->m_notifications |= wxSPDD_MESSAGE_CHANGED; } - // The value passed here doesn't matter, only elapsed time makes sense - // in indeterminate mode anyhow. + // Value of 0 is special and is used when we can't estimate the + // remaining and total times, which is exactly what we need here. UpdateExpandedInformation(0); return m_sharedData->m_state != Canceled; @@ -990,8 +990,9 @@ void wxProgressDialog::UpdateExpandedInformation(int value) // The value of 0 is special, we can't estimate anything before we have at // least one update, so leave the times dependent on it indeterminate. // - // Similarly, in indeterminate mode we don't have any estimations neither. - if ( !value || m_sharedData->m_progressBarMarquee ) + // This value is also used by Pulse(), as in the indeterminate mode we can + // never estimate anything. + if ( !value ) { estimatedTime = remainingTime = static_cast(-1);