From: Robert Bohne Date: Sun, 29 Apr 2012 15:37:28 +0000 (+0200) Subject: Behavior of merge_range adjusted #35559 X-Git-Tag: v0.34~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c1e4ae46cba1ca40a94115e19e838918bc44329b;p=p5sagit%2FExcel-Template.git Behavior of merge_range adjusted #35559 Now it works: Content . (As described in the POD) --- diff --git a/Changes b/Changes index d407bff..0520c3c 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl distribution Excel::Template + + Behavior of merge_range adjusted, now it works: + Content . (As described in the POD) Merge range formatting tends to collide with non-merged formatting, thanks to Nigel Metheringham. Fixed some documentation errors, thanks to Robert James Clay. diff --git a/lib/Excel/Template/Element/MergeRange.pm b/lib/Excel/Template/Element/MergeRange.pm index e8b72dd..b540942 100644 --- a/lib/Excel/Template/Element/MergeRange.pm +++ b/lib/Excel/Template/Element/MergeRange.pm @@ -4,9 +4,9 @@ use strict; BEGIN { use vars qw(@ISA); - @ISA = qw(Excel::Template::Element); + @ISA = qw(Excel::Template::Element::Cell); - use Excel::Template::Element; + use Excel::Template::Element::Cell; use Excel::Template::Element::Range; } @@ -46,7 +46,7 @@ sub render { $context->active_worksheet->merge_range( $range, - $context->get($self, 'TEXT'), + $self->_get_text($context), $format, ); @@ -86,9 +86,26 @@ None - + Text to insert into merged range +Or a cross rows: + + + + + + + + + + + + Text to insert into merged range + + + + =head1 AUTHOR Stevan Little (stevan.little@iinteractive.com) diff --git a/t/028_merge_range.t b/t/028_merge_range.t index 51f8d89..6872857 100644 --- a/t/028_merge_range.t +++ b/t/028_merge_range.t @@ -27,6 +27,11 @@ Spreadsheet::WriteExcel::Worksheet::write( '0', '0', '', '1' ) Spreadsheet::WriteExcel::Worksheet::write( '0', '1', '', '1' ) Spreadsheet::WriteExcel::add_format( '' ) Spreadsheet::WriteExcel::Worksheet::merge_range( 'A1:B1', 'This is the Foo Range', '2' ) +Spreadsheet::WriteExcel::add_worksheet( '' ) +Spreadsheet::WriteExcel::Worksheet::new( '' ) +Spreadsheet::WriteExcel::Worksheet::write( '0', '0', '', '1' ) +Spreadsheet::WriteExcel::Worksheet::write( '0', '1', '', '1' ) +Spreadsheet::WriteExcel::Worksheet::merge_range( 'A1:B1', 'This is the Foo Range2', '2' ) Spreadsheet::WriteExcel::close( '' ) __END_EXPECTED__ @@ -34,9 +39,14 @@ __DATA__ - - + + + + + + This is the Foo Range2 +