From cddf3b851d38ff7f5aa72a2e9175a2fab47404d1 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 3 Apr 2006 11:56:57 +0000 Subject: Make sure we don't show "100%" on downloads unless they're really 2006-04-03 Christian Persch * embed/mozilla/MozDownload.cpp: Make sure we don't show "100%" on downloads unless they're really completed. --- embed/mozilla/MozDownload.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index 4591b1a90..0410ca5b0 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -554,13 +554,16 @@ MozDownload::OnProgressChange (nsIWebProgress *aWebProgress, mLastUpdate = now; - if (aMaxTotalProgress == -1) + if (aMaxTotalProgress < 0) { mPercentComplete = -1; } else { - mPercentComplete = (PRInt32)(((float)aCurTotalProgress / (float)aMaxTotalProgress) * 100.0 + 0.5); + /* Make sure not to round up, so we don't display 100% unless + * it's really finished! + */ + mPercentComplete = (PRInt32)(((float)aCurTotalProgress / (float)aMaxTotalProgress) * 100.0); } mTotalProgress = aMaxTotalProgress; -- cgit v1.2.3