From 7674cf3fbe71dad50a5e9419a0c441583bf669b4 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 5 Mar 2009 20:55:06 +0000 Subject: [PATCH] Fix a divide by zero when "scale columns" was set to yes, but there were no scalable columns to scale --- admin/reports.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/reports.inc.php b/admin/reports.inc.php index f774969..1fbb50d 100644 --- a/admin/reports.inc.php +++ b/admin/reports.inc.php @@ -586,8 +586,10 @@ foreach($report_stock as $n=>$v) { * we can enforce margins) */ if($report['option']['fit_columns'] == 'yes') { // && $total_width > $label_stock['label_width']) { $static_width = $total_width - $scale_width; - $scale_factor = ($label_stock['label_width'] - $static_width) / $scale_width; -//echo "$scale_factor; + if($scale_width) + $scale_factor = ($label_stock['label_width'] - $static_width) / $scale_width; + else + $scale_factor = 1.0; } else { $scale_factor = 1.0; }