I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2005-09-06 20:19:41-07 by mlcohen
merged cells in a spreadsheet
There seems to be an issue with handling merged cells in a calc (spreadsheet) document. For example, if I have a file with the following content:

A1: "This is A1"
B1-E1 (merged): "This is B1"
F1-K1 (merged): This is F1"
L1: "This is L1"

then capturing A1 and B1 with getCellValue gives the correct data, but all the other cells come out in the wrong place - when I read D1, instead of getting null I get "This is F1", and when I read F1 I get "This is L1". It seems that each group of merged cells is interpreted as 2 cells wide. I expected normalizeSheet to fix this - looking at the underlying xml, each merged cell does only take up 2 entries, and this seems like the kind of thing normalizeSheet was intended for. Only there's no difference whether or not I've used normalizeSheet. Sample code:
my $inFile = ooDocument(file => $fileName); my $sheet = $inFile->normalizeSheet('Sheet1', 20, 20); # extra large to be safe my $value = $inFile->getCellValue($sheet,"F1"); print "G1: $value\n"; # Prints "This is L1", should say "This is F1"

I've only been using perl for a few weeks, so it's possible I'm doing something stupid, but I've looked this over again and again.

I don't think it makes a difference, but I'm using StarOffice 7, not openoffice. Any ideas?
Direct Responses: 981 | 986 | Write a response
Posted on 2005-09-12 12:35:35-07 by jmgdoc in response to 962
Re: merged cells in a spreadsheet
The real bug could be elsewhere... getCellValue() should return undef when the required cell is covered.
Could you send me your document at jmgdoc[at]cpan.org for more investigation ?
PS: There is no difference about that between SO and OOo.
Direct Responses: Write a response
Posted on 2005-09-12 19:42:06-07 by jmgdoc in response to 962
Re: merged cells in a spreadsheet

A bug has been found in the normalizeSheet() method.
This bug could produce a wrong cell addressing in rows containing merged cells.
It's fixed in 2.007 (which will be available in the next hours).

Please download the new version and tell us if your script works.

Thanks for your report !
Direct Responses: 997 | Write a response
Posted on 2005-09-15 21:41:47-07 by mlcohen in response to 986
Re: merged cells in a spreadsheet
I'm glad I could help. I haven't tried the newer version yet since I realized that my life will actually be easier not merging the cells....between when I reported the problem and you posted the results, I figured out a workaround that turned out to be much better :) Thanks, Matt
Direct Responses: Write a response