git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
charset: coalesce and abbreviate rowspan>3
[sheet.git]
/
charset.plp
diff --git
a/charset.plp
b/charset.plp
index b1c680e1d833f41b623b981e8b878854bab4866c..18d7c50453c83ca2237ee5c9773473123f338a7f 100644
(file)
--- a/
charset.plp
+++ b/
charset.plp
@@
-303,11
+303,22
@@
sub range_cell {
}
elsif (my $rows = int($len / $cols)) {
# multiple full rows
}
elsif (my $rows = int($len / $cols)) {
# multiple full rows
+ my $rowsize = $colsize * $cols;
if ($len -= $rows * $cols) {
# partial row remains
if ($len -= $rows * $cols) {
# partial row remains
- $table->{$offset + $
colsize*$rows * $col
s} //= [$len*$colsize, "$class joinu", '', $title];
+ $table->{$offset + $
rowsize * $row
s} //= [$len*$colsize, "$class joinu", '', $title];
$class .= ' joind';
}
$class .= ' joind';
}
+
+ # coalesce multiple rows
+ while ($rows > 3) {
+ $info->{skip}->{$offset += $rowsize}++;
+ $rows--;
+ }
+ if ($rows > 2) {
+ $info->{skip}->{$offset += $rowsize} = 0;
+ }
+
$attr .= sprintf ' rowspan=%d', $rows;
$len = $cols;
}
$attr .= sprintf ' rowspan=%d', $rows;
$len = $cols;
}
@@
-346,7
+357,10
@@
for my $row (@request) {
}
print '<tr><th>';
}
print '<tr><th>';
- {
+ if (defined $row->{skip}->{$offset}) {
+ print '⋮';
+ }
+ else {
if (my $rowmod = $offset % $rowdiv) {
# offset in column units
printf '<small>+%X</small>', $rowmod;
if (my $rowmod = $offset % $rowdiv) {
# offset in column units
printf '<small>+%X</small>', $rowmod;