Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIXED: cell canonization in list context
- Loading branch information
nadim khemir
committed
May 5, 2011
1 parent
8c9d01f
commit 67ee4d9
Showing
10 changed files
with
453 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
use Carp ; | ||
use strict ; | ||
use warnings ; | ||
|
||
use Spreadsheet::Perl ; | ||
|
||
my $ss = tie my %ss, "Spreadsheet::Perl" ; | ||
|
||
for | ||
( | ||
['A1:B3', 1, 1, 'A2:B3'] | ||
) | ||
{ | ||
my $offset_cell = $ss->OffsetAddress(@$_) ; | ||
my $offset_string = "Can't compute!" ; | ||
|
||
if(defined $offset_cell) | ||
{ | ||
$offset_string = join ", ", $ss->GetCellsOffset($_->[0], $offset_cell) ; | ||
} | ||
else | ||
{ | ||
$offset_cell = "Can't offset!" ; | ||
} | ||
|
||
print '' . (join(", ", @$_)) . " => " . $offset_cell . " offset: " . $offset_string . "\n" ; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
use Carp ; | ||
use strict ; | ||
use warnings ; | ||
|
||
use Spreadsheet::Perl ; | ||
|
||
my $ss = tie my %ss, "Spreadsheet::Perl" ; | ||
$ss->SetNames("FIRST_RANGE", "A1:A2") ; | ||
|
||
for | ||
( | ||
['A1', 'A1:A1', 1] | ||
, ['Z9', 'Z9:Z9', 1] | ||
, ['ZZ1', 'ZZ1:ZZ1', 1] | ||
, ['AAA1', 'AAA1:AAA1', 1] | ||
, ['B2', 'B2:D5', 1] | ||
, ['D2', 'B2:D5', 1] | ||
, ['B5', 'B2:D5', 1] | ||
, ['D5', 'B2:D5', 1] | ||
, ['C3', 'B2:D5', 1] | ||
|
||
, ['A1', 'B2:D5', 0] | ||
, ['C1', 'B2:D5', 0] | ||
, ['E1', 'B2:D5', 0] | ||
, ['A3', 'B2:D5', 0] | ||
, ['E3', 'B2:D5', 0] | ||
, ['A6', 'B2:D5', 0] | ||
, ['C6', 'B2:D5', 0] | ||
, ['E6', 'B2:D5', 0] | ||
|
||
, ['A1', 'FIRST_RANGE', 1] | ||
, ['E6', 'FIRST_RANGE', 0] | ||
|
||
) | ||
{ | ||
my ($cell, $range, $expected) = @{$_} ; | ||
|
||
printf "$cell within range $range: %d => expected $expected\n", | ||
$ss->is_within_range($cell, $range) ; | ||
} | ||
|
||
|
Oops, something went wrong.