aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozDownload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r--embed/mozilla/MozDownload.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 4591b1a90..8aa2ad334 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;