Move the zero-check to before we divide by the number. Fixes crash when

all 3 header or all 3 footer print prefs are empty strings. Bug 102257,
r=rods, sr=shaver


git-svn-id: svn://10.0.0.236/trunk@104358 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2001-10-01 23:57:57 +00:00
parent 51c80eea8f
commit d063da77e9
2 changed files with 2 additions and 2 deletions

View File

@@ -427,8 +427,8 @@ nsPageFrame::DrawHeaderFooter(nsIRenderingContext& aRenderingContext,
if (!aStr2.IsEmpty()) numStrs++;
if (!aStr3.IsEmpty()) numStrs++;
nscoord strSpace = aRect.width / numStrs;
if (numStrs == 0) return;
nscoord strSpace = aRect.width / numStrs;
if (!aStr1.IsEmpty()) {
DrawHeaderFooter(aRenderingContext, aFrame, aHeaderFooter, nsIPrintOptions::kJustLeft, aStr1, aRect, aHeight, strSpace);