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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user