From f156033144078bafe189c7f76531bfd413e67957 Mon Sep 17 00:00:00 2001 From: "kestes%walrus.com" Date: Fri, 3 May 2002 22:29:28 +0000 Subject: [PATCH] fix break multiline empty on change of tree state --- .../tinderbox2/src/lib/TinderDB/VC_Bonsai.pm | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/webtools/tinderbox2/src/lib/TinderDB/VC_Bonsai.pm b/webtools/tinderbox2/src/lib/TinderDB/VC_Bonsai.pm index aa70859a4e9d..9cdac71d5b14 100755 --- a/webtools/tinderbox2/src/lib/TinderDB/VC_Bonsai.pm +++ b/webtools/tinderbox2/src/lib/TinderDB/VC_Bonsai.pm @@ -40,8 +40,8 @@ # Contributor(s): -# $Revision: 1.33 $ -# $Date: 2002/05/03 22:01:05 $ +# $Revision: 1.34 $ +# $Date: 2002/05/03 22:29:28 $ # $Author: kestes%walrus.com $ # $Source: /home/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/lib/TinderDB/VC_Bonsai.pm,v $ # $Name: $ @@ -101,7 +101,7 @@ use TreeData; use VCDisplay; -$VERSION = ( qw $Revision: 1.33 $ )[1]; +$VERSION = ( qw $Revision: 1.34 $ )[1]; @ISA = qw(TinderDB::BasicTxtDB); @@ -335,7 +335,23 @@ sub status_table_start { return ; } +# a helper function to determine if we break a large cell symbolizing +# no data. +sub is_break_cell { + my ($tree,$time,$last_treestate) = @_; + + + $is_state_same = ( + !(defined($DATABASE{$tree}{$time}{'treestate'})) || + ($last_treestate eq $DATABASE{$tree}{$time}{'treestate'}) + ); + + $is_author_data = defined($DATABASE{$tree}{$time}{'author'}); + $is_break_cell = ( !($is_state_same) || ($is_author_data) ); + + return $is_break_cell; +} @@ -381,17 +397,29 @@ sub status_table_row { } # create a multi-row dummy cell for missing data? + # cell stops if there is data or the treestate changes. + + # first find out what time the break will occur at. my $next_time; my $next_index = $NEXT_DB; $next_time = $DB_TIMES[$next_index]; - while (!defined($DATABASE{$tree}{$next_time}{'author'})) { + + while (!( + is_break_cell($tree,$next_time,$LAST_TREESTATE) + )) { $next_time = $DB_TIMES[$next_index]; $next_index++; + } + + # Do we need a multiline empty cell or do we have data? + if ( $next_time < $row_times->[$row_index] ) { + # now convert the break time to a rowspan. + my ($rowspan) = 1; while ( ( ($row_index + $rowspan) <= $#{$row_times}) && @@ -622,6 +650,7 @@ sub status_table_row { $query_links.= "\t\t".$text_browser_color_string."\n"; @outrow = ( + "\t\n". "\t\n". $query_links. "\t\n".