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

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



Revision: 1700
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1700&view=rev
Author:   tetragon
Date:     2007-10-04 11:22:07 -0700 (Thu, 04 Oct 2007)

Log Message:
-----------
Add support for named format tags (such as <bold>foo</bold>)

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-10-04 17:29:54 UTC (rev 1699)
+++ trunk/LedgerSMB/Template/ODS.pm	2007-10-04 18:22:07 UTC (rev 1700)
@@ -745,6 +745,12 @@
 	unshift @style_stack, $style_table{$mystyle};
 }
 
+sub _named_format {
+	my ($name, $t, $format) = @_;
+	$format->{att}{$name} = 1;
+	&_format_handler($t, $format);
+}
+
 sub _format_cleanup_handler {
 	my ($t, $format) = @_;
 	shift @style_stack;
@@ -762,9 +768,19 @@
 			cell => \&_cell_handler,
 			formula => \&_formula_handler,
 			format => \&_format_handler,
+			bold => sub { &_named_format('bold', @_) },
+			hidden => sub { &_named_format('hidden', @_) },
+			italic => sub { &_named_format('italic', @_) },
+			shadow => sub { &_named_format('shadow', @_) },
+			strikeout => sub { &_named_format('strikeout', @_) },
 			},
 		twig_handlers => {
 			format => \&_format_cleanup_handler,
+			bold => \&_format_cleanup_handler,
+			hidden => \&_format_cleanup_handler,
+			italic => \&_format_cleanup_handler,
+			shadow => \&_format_cleanup_handler,
+			strikeout => \&_format_cleanup_handler,
 			}
 		);
 	$parser->parse($template);

Modified: trunk/UI/am-list-accounts.odst
===================================================================
--- trunk/UI/am-list-accounts.odst	2007-10-04 17:29:54 UTC (rev 1699)
+++ trunk/UI/am-list-accounts.odst	2007-10-04 18:22:07 UTC (rev 1700)
@@ -18,9 +18,9 @@
 		<?lsmb IF loop.first ?><format num_format="3">
 		<?lsmb END ?>
 			<?lsmb IF row.$column.href ?>
-			<format font_shadow="1">
+			<italic>
 			<cell text="<?lsmb row.$column.text ?>" />
-			</format>
+			</italic>
 			<?lsmb ELSE ?>
 			<format font_outline="1">
 			<cell text="<?lsmb row.$column ?>" />


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