summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-04 18:22:07 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-04 18:22:07 +0000
commitd885a1f0c89a56714f0db7c0e4d8dbf9f30a5ea9 (patch)
tree4454f9fb28254a8c15d3e3f7da27f7a130569c02
parent509ed84d2670bb3bf9f63ba68014a47e7e0c39fe (diff)
Add support for named format tags (such as <bold>foo</bold>)
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1700 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--LedgerSMB/Template/ODS.pm16
-rw-r--r--UI/am-list-accounts.odst4
2 files changed, 18 insertions, 2 deletions
diff --git a/LedgerSMB/Template/ODS.pm b/LedgerSMB/Template/ODS.pm
index c2d8f75c..08df87a7 100644
--- a/LedgerSMB/Template/ODS.pm
+++ b/LedgerSMB/Template/ODS.pm
@@ -745,6 +745,12 @@ sub _format_handler {
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 @@ sub _ods_process {
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);
diff --git a/UI/am-list-accounts.odst b/UI/am-list-accounts.odst
index 163fc054..7a4cdfdc 100644
--- a/UI/am-list-accounts.odst
+++ b/UI/am-list-accounts.odst
@@ -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 ?>" />