From 4facfd846a73aa4861433293b8dd4d6a1f880eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= Date: Mon, 4 Dec 2017 19:25:12 +0100 Subject: [PATCH] WX_PROGRESS_REPORTER: fix assert warnings --- common/widgets/progress_reporter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/widgets/progress_reporter.cpp b/common/widgets/progress_reporter.cpp index 9638e449bf..3dd35c51fe 100644 --- a/common/widgets/progress_reporter.cpp +++ b/common/widgets/progress_reporter.cpp @@ -29,8 +29,8 @@ PROGRESS_REPORTER::PROGRESS_REPORTER( int aNumPhases ) : m_phase( 0 ), m_progress( 0 ), - m_maxProgress( 1 ), - m_numPhases( aNumPhases ) + m_numPhases( aNumPhases ), + m_maxProgress( 1 ) { }; @@ -97,6 +97,10 @@ WX_PROGRESS_REPORTER::~WX_PROGRESS_REPORTER() void WX_PROGRESS_REPORTER::updateUI() { int cur = currentProgress(); + + if( cur < 0 || cur > 1000 ) + cur = 0; + SetRange( 1000 ); Update( cur, m_message ); }