[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1671] trunk



Revision: 1671
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1671&view=rev
Author:   tetragon
Date:     2007-09-26 10:54:15 -0700 (Wed, 26 Sep 2007)

Log Message:
-----------
Fixing multi-sheet output

Modified Paths:
--------------
    trunk/LedgerSMB/Template/ODS.pm
    trunk/UI/am-list-accounts.odst

Modified: trunk/LedgerSMB/Template/ODS.pm
===================================================================
--- trunk/LedgerSMB/Template/ODS.pm	2007-09-26 17:52:12 UTC (rev 1670)
+++ trunk/LedgerSMB/Template/ODS.pm	2007-09-26 17:54:15 UTC (rev 1671)
@@ -81,8 +81,17 @@
 sub _worksheet_handler {
 	$rowcount = -1;
 	$currcol = 0;
-	my $sheet = $ods->getTable(0, $_->{att}->{rows}, $_->{att}->{columns});
-	$ods->renameTable($sheet, $_->{att}->{name});
+	my $rows = $_->{att}->{rows};
+	my $columns = $_->{att}->{columns};
+	$rows ||= 1000;
+	$columns ||= 52;
+	my $sheet;
+	if ($_->is_first_child) {
+		$sheet = $ods->getTable(0, $rows, $columns);
+		$ods->renameTable($sheet, $_->{att}->{name});
+	} else {
+		$sheet = $ods->appendTable($_->{att}->{name}, $rows, $columns);
+	}
 }
 
 sub _row_handler {
@@ -727,7 +736,6 @@
 sub _format_cleanup_handler {
 	my ($t, $format) = @_;
 	shift @style_stack;
-	$t->purge;
 }
 
 sub _ods_process {

Modified: trunk/UI/am-list-accounts.odst
===================================================================
--- trunk/UI/am-list-accounts.odst	2007-09-26 17:52:12 UTC (rev 1670)
+++ trunk/UI/am-list-accounts.odst	2007-09-26 17:54:15 UTC (rev 1671)
@@ -38,4 +38,9 @@
 	</row>
 	<?lsmb END ?>
 	</worksheet>
+	<worksheet name="test2" rows='3' columns='1'>
+	<row><cell text='1' type='number' /></row>
+	<row><cell text='2' type='number' /></row>
+	<row><formula text='sum(A1:A2)' type='formula' /></row>
+	</worksheet>
 </workbook>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.