summaryrefslogtreecommitdiff
path: root/LedgerSMB
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 /LedgerSMB
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
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/Template/ODS.pm16
1 files changed, 16 insertions, 0 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);