You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
161 lines
4.8 KiB
161 lines
4.8 KiB
Index: PostScript-Simple-0.07/lib/PostScript/Simple.pm |
|
--- PostScript-Simple-0.07/lib/PostScript/Simple.pm.orig 2005-05-04 16:42:28.187771138 +0200 |
|
+++ PostScript-Simple-0.07/lib/PostScript/Simple.pm 2005-05-04 16:58:39.923776000 +0200 |
|
@@ -1322,10 +1322,21 @@ |
|
|
|
my ($x, $y, $r) = @_; |
|
|
|
- unless (@_ == 3) |
|
+ if (@_ == 4) |
|
{ |
|
- $self->_error("circle: wrong number of arguments"); |
|
- return 0; |
|
+ if (defined($opt{'filled'})) |
|
+ { |
|
+ $opt{'filled'} = 1; |
|
+ } |
|
+ else |
|
+ { |
|
+ $opt{'filled'} = 0; |
|
+ } |
|
+ } |
|
+ elsif (@_ != 3) |
|
+ { |
|
+ $self->_error( "wrong number of args for line" ); |
|
+ return 0; |
|
} |
|
|
|
if (!$self->{usedcircle}) |
|
@@ -1378,7 +1385,7 @@ |
|
|
|
my ($x, $y, $r, $a, $text) = @_; |
|
|
|
- unless (@_ == 5) { |
|
+ unless (@_ == 5 || @_ == 6) { |
|
$self->_error("circletext: wrong number of arguments"); |
|
return 0; |
|
} |
|
@@ -1499,16 +1506,23 @@ |
|
|
|
my ($x1, $y1, $x2, $y2) = @_; |
|
|
|
- unless (@_ == 4) { |
|
- $self->_error("box: wrong number of arguments"); |
|
- return 0; |
|
+ if (@_ == 5) |
|
+ { |
|
+ if (defined($opt{'filled'})) |
|
+ { |
|
+ $opt{'filled'} = 1; |
|
+ } |
|
+ else |
|
+ { |
|
+ $opt{'filled'} = 0; |
|
+ } |
|
} |
|
- |
|
- if (!defined($opt{'filled'})) |
|
+ elsif (@_ != 4) |
|
{ |
|
- $opt{'filled'} = 0; |
|
+ $self->_error( "wrong number of args for line" ); |
|
+ return 0; |
|
} |
|
- |
|
+ |
|
unless ($self->{usedbox}) |
|
{ |
|
$self->{psfunctions} .= "/box { |
|
@@ -1606,7 +1616,7 @@ |
|
%opt = %{; shift}; |
|
} |
|
|
|
- unless ( @_ == 3 ) |
|
+ unless ( @_ == 3 || @_ == 4 ) |
|
{ # check required params first |
|
$self->_error("text: wrong number of arguments"); |
|
return 0; |
|
@@ -1818,7 +1828,7 @@ |
|
|
|
my ($file, $x1, $y1, $x2, $y2) = @_; |
|
|
|
- unless (@_ == 5) { |
|
+ unless (@_ == 5 || @_ == 6) { |
|
$self->_error("importepsfile: wrong number of arguments"); |
|
return 0; |
|
} |
|
Index: PDF-Table-0.9.3/lib/PDF/Table.pm |
|
--- PDF-Table-0.9.3/lib/PDF/Table.pm.orig 2006-12-27 15:44:26 +0100 |
|
+++ PDF-Table-0.9.3/lib/PDF/Table.pm 2007-10-31 14:16:23 +0100 |
|
@@ -384,15 +384,14 @@ |
|
|
|
# Keep a running total of the overall min and max widths |
|
$col_props->[$j]->{min_w} = $col_props->[$j]->{min_w} || 0; |
|
- $col_props->[$j]->{max_w} = $col_props->[$j]->{max_w} || 0; |
|
+ $col_props->[$j]->{max_w} = $col_props->[$j]->{max_w} || 99999999; |
|
|
|
if( $min_col_w > $col_props->[$j]->{min_w} ) |
|
{ # Calculated Minimum Column Width is more than user-defined |
|
$col_props->[$j]->{min_w} = $min_col_w ; |
|
} |
|
- if( $max_col_w > $col_props->[$j]->{max_w} ) |
|
- { # Calculated Maximum Column Width is more than user-defined |
|
- $col_props->[$j]->{max_w} = $max_col_w ; |
|
+ if( $col_props->[$j]->{min_w} > $col_props->[$j]->{max_w} ) { |
|
+ $col_props->[$j]->{max_w} = $col_props->[$j]->{min_w}; |
|
} |
|
}#End of for(my $j.... |
|
$row_props->[$rows_counter] = $column_widths; |
|
@@ -599,11 +598,11 @@ |
|
$background_color ) |
|
{ |
|
$gfx_bg->rect( $cur_x, $cur_y-$row_h, $calc_column_widths->[$j], $row_h); |
|
- if ( $cell_props->[$row_cnt][$j]->{'background_color'} && !$first_row ) |
|
+ if ( $cell_props->[$row_cnt][$j]->{'background_color'} && !($first_row and ref $header_props) ) |
|
{ |
|
$gfx_bg->fillcolor($cell_props->[$row_cnt][$j]->{'background_color'}); |
|
} |
|
- elsif( $col_props->[$j]->{'background_color'} && !$first_row ) |
|
+ elsif( $col_props->[$j]->{'background_color'} && !($first_row and ref $header_props) ) |
|
{ |
|
$gfx_bg->fillcolor($col_props->[$j]->{'background_color'}); |
|
} |
|
@@ -621,7 +620,7 @@ |
|
$gfx->move( $xbase , $cur_y ); |
|
$gfx->hline( $xbase + $width ); |
|
$rows_counter++; |
|
- $row_cnt++ unless ( $first_row ); |
|
+ $row_cnt++ unless ( $first_row and ref $header_props ); |
|
$first_row = 0; |
|
}# End of while(scalar(@{$data}) and $cur_y-$row_h > $bot_marg) |
|
|
|
@@ -679,12 +678,23 @@ |
|
|
|
} |
|
|
|
- my $span = 0; |
|
- # Calculate how much can be added to every column to fit the available width |
|
- $span = ($avail_width - $min_width) / scalar( @$col_props); |
|
- for(my $j = 0; $j < scalar(@$col_props); $j++ ) |
|
- { |
|
- $calc_widths->[$j] = $col_props->[$j]->{min_w} + $span; |
|
+ my $expansion_width = ($avail_width - $min_width); |
|
+ my $expansion_cols = scalar(@$col_props); |
|
+ my $expansion_span = int($expansion_width / $expansion_cols); |
|
+ foreach my $j ( sort { $col_props->[$a]->{max_w} <=> $col_props->[$b]->{max_w} } (0..$#{$col_props}) ) { |
|
+ $calc_widths->[$j] = $col_props->[$j]->{min_w}; |
|
+ my $expansion_possible = $col_props->[$j]->{max_w} - $col_props->[$j]->{min_w}; |
|
+ if ($expansion_span <= $expansion_possible) { |
|
+ $calc_widths->[$j] += $expansion_span; |
|
+ $expansion_width -= $expansion_span; |
|
+ $expansion_cols--; |
|
+ } |
|
+ else { |
|
+ $calc_widths->[$j] += $expansion_possible; |
|
+ $expansion_width -= $expansion_possible; |
|
+ $expansion_cols--; |
|
+ $expansion_span = int($expansion_width / $expansion_cols); |
|
+ } |
|
} |
|
|
|
return ($calc_widths,$avail_width);
|
|
|