Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Cvs P5ee > [svn:p5ee] r971...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 550 of 716
Post > Topic >>

[svn:p5ee] r9714 - p5ee/trunk/App-Repository/lib/App

by spadkins@[EMAIL PROTECTED] Jul 10, 2007 at 02:24 PM

Author: spadkins
Date: Tue Jul 10 14:24:26 2007
New Revision: 9714

Modified:
   p5ee/trunk/App-Repository/lib/App/Repository.pm

Log:
summarize_rows() produces a undef if all values that are summed are undef

Modified: p5ee/trunk/App-Repository/lib/App/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository.pm	(original)
+++ p5ee/trunk/App-Repository/lib/App/Repository.pm	Tue Jul 10 14:24:26
2007
@[EMAIL PROTECTED]
 -3074,7 +3074,7 @[EMAIL PROTECTED]
                     }
                 }
                 foreach $i (@[EMAIL PROTECTED]
) {
-                    $summary_row->[$i] = 0;
+                    $summary_row->[$i] = undef;
                 }
                 $summary_row{$key} = $summary_row;
                 push(@[EMAIL PROTECTED]
 $key);
@[EMAIL PROTECTED]
 -3089,11 +3089,25 @[EMAIL PROTECTED]
                            
$alternate_aggregate_row_idx->{$alternate_aggregate_key} = $rowidx;
                         }
                         if
($alternate_aggregate_row_idx->{$alternate_aggregate_key} == $rowidx) {
-                            $summary_row->[$i] += $row->[$i];
+                            if (defined $row->[$i]) {
+                                if (defined $summary_row->[$i]) {
+                                    $summary_row->[$i] += $row->[$i];
+                                }
+                                else {
+                                    $summary_row->[$i] = $row->[$i];
+                                }
+                            }
                         }
                     }
                     else {
-                        $summary_row->[$i] += $row->[$i];
+                        if (defined $row->[$i]) {
+                            if (defined $summary_row->[$i]) {
+                                $summary_row->[$i] += $row->[$i];
+                            }
+                            else {
+                                $summary_row->[$i] = $row->[$i];
+                            }
+                        }
                     }
                 }
             }
 




 1 Posts in Topic:
[svn:p5ee] r9714 - p5ee/trunk/App-Repository/lib/App
spadkins@[EMAIL PROTECTED  2007-07-10 14:24:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 22:25:26 CDT 2008.