[prev in list] [next in list] [prev in thread] [next in thread]
List: openpkg-cvs
Subject: [CVS] OpenPKG: openpkg-src/perl-gfx/ perl-gfx.patch perl-gfx.spec
From: "Ralf S. Engelschall" <rse () openpkg ! org>
Date: 2007-10-31 10:16:03
Message-ID: 20071031101603.E4FA01B5050 () master ! openpkg ! org
[Download RAW message or body]
OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: rse@openpkg.org
Module: openpkg-src Date: 31-Oct-2007 11:16:02
Branch: HEAD Handle: 2007103110160100
Modified files:
openpkg-src/perl-gfx perl-gfx.patch perl-gfx.spec
Log:
fix the world by letting one set a max_w (maximum width) on a table
column and let PDF::Table do a reasonable calculation based on this
(instead of mainly ignoring it as before)
Summary:
Revision Changes Path
1.3 +52 -0 openpkg-src/perl-gfx/perl-gfx.patch
1.81 +1 -1 openpkg-src/perl-gfx/perl-gfx.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/perl-gfx/perl-gfx.patch
============================================================================
$ cvs diff -u -r1.2 -r1.3 perl-gfx.patch
--- openpkg-src/perl-gfx/perl-gfx.patch 22 Jan 2006 17:32:54 -0000 1.2
+++ openpkg-src/perl-gfx/perl-gfx.patch 31 Oct 2007 10:16:01 -0000 1.3
@@ -84,3 +84,55 @@
$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 11:14:06 +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;
+@@ -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);
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/perl-gfx/perl-gfx.spec
============================================================================
$ cvs diff -u -r1.80 -r1.81 perl-gfx.spec
--- openpkg-src/perl-gfx/perl-gfx.spec 30 Oct 2007 12:33:20 -0000 1.80
+++ openpkg-src/perl-gfx/perl-gfx.spec 31 Oct 2007 10:16:01 -0000 1.81
@@ -49,7 +49,7 @@
Group: Perl
License: GPL/Artistic
Version: %{V_perl}
-Release: 20071030
+Release: 20071031
# list of sources
Source0: http://www.cpan.org/modules/by-module/Image/Image-Info-%{V_image_info}.tar.gz
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List openpkg-cvs@openpkg.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic