[Python-modules-commits] [python-odf] 99/118: Can now understand bookmarks
Wolfgang Borgert
debacle at moszumanska.debian.org
Fri Oct 3 21:27:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to reference refs/remotes/upstream/master
in repository python-odf.
commit 1ae6931ef0b019e731b642bdf5f69dd93356ff14
Author: Søren Roug <soren.roug at eea.europa.eu>
Date: Sun Feb 13 13:19:06 2011 +0000
Can now understand bookmarks
---
odf/attrconverters.py | 6 +++---
odf/odf2xhtml.py | 13 ++++++++++++-
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/odf/attrconverters.py b/odf/attrconverters.py
index 3d56fcb..b75f80a 100644
--- a/odf/attrconverters.py
+++ b/odf/attrconverters.py
@@ -402,11 +402,11 @@ attrconverters = {
((DRAWNS,u'decimal-places'), None): cnv_string,
((DRAWNS,u'display'), None): cnv_string,
((DRAWNS,u'display-name'), None): cnv_string,
- ((DRAWNS,u'distance'), None): cnv_string,
+ ((DRAWNS,u'distance'), None): cnv_lengthorpercent,
((DRAWNS,u'dots1'), None): cnv_integer,
- ((DRAWNS,u'dots1-length'), None): cnv_length,
+ ((DRAWNS,u'dots1-length'), None): cnv_lengthorpercent,
((DRAWNS,u'dots2'), None): cnv_integer,
- ((DRAWNS,u'dots2-length'), None): cnv_length,
+ ((DRAWNS,u'dots2-length'), None): cnv_lengthorpercent,
((DRAWNS,u'end-angle'), None): cnv_double,
((DRAWNS,u'end'), None): cnv_string,
((DRAWNS,u'end-color'), None): cnv_string,
diff --git a/odf/odf2xhtml.py b/odf/odf2xhtml.py
index 7de139d..b2f03d3 100644
--- a/odf/odf2xhtml.py
+++ b/odf/odf2xhtml.py
@@ -404,6 +404,7 @@ class ODF2XHTML(handler.ContentHandler):
(TEXTNS, "alphabetical-index-source"):(self.s_text_x_source, self.e_text_x_source),
(TEXTNS, "bibliography-configuration"):(self.s_ignorexml, None),
(TEXTNS, "bibliography-source"):(self.s_text_x_source, self.e_text_x_source),
+ (TEXTNS, 'bookmark'): (self.s_text_bookmark, None),
(TEXTNS, 'h'): (self.s_text_h, self.e_text_h),
(TEXTNS, "illustration-index-source"):(self.s_text_x_source, self.e_text_x_source),
(TEXTNS, 'line-break'):(self.s_text_line_break, None),
@@ -580,7 +581,7 @@ class ODF2XHTML(handler.ContentHandler):
def classname(self, attrs):
""" Generate a class name from a style name """
- c = attrs[(TEXTNS,'style-name')]
+ c = attrs.get((TEXTNS,'style-name'),'')
c = c.replace(".","_")
return c
@@ -1137,6 +1138,16 @@ ol, ul { padding-left: 2em; }
self.closetag('a', False)
self.purgedata()
+ def s_text_bookmark(self, tag, attrs):
+ """ Bookmark definition """
+ name = attrs[(TEXTNS,'name')]
+ html_id = self.get_anchor(name)
+ self.writedata()
+ self.opentag('span', {'id':html_id})
+ self.closetag('span', False)
+ self.purgedata()
+
+
def s_text_h(self, tag, attrs):
""" Headings start """
level = int(attrs[(TEXTNS,'outline-level')])
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-odf.git
More information about the Python-modules-commits
mailing list