* src/docgen/OpenDrawDoc.py: add support for superscripts

* src/docgen/OpenOfficeDoc.py: add support for superscripts
* src/plugins/Ancestors.py: New Ancestors report added


svn: r1727
This commit is contained in:
Don Allingham 2003-06-14 02:18:55 +00:00
parent 5b15e209cc
commit f9c3e6291f
2 changed files with 15 additions and 2 deletions

View File

@ -108,6 +108,8 @@ class OpenDrawDoc(DrawDoc.DrawDoc):
self.f.write('style:font-pitch="variable"/>\n')
self.f.write('</office:font-decls>\n')
self.f.write('<office:automatic-styles>\n')
self.f.write('<style:style style:name="GSuper" style:family="text">')
self.f.write('<style:properties style:text-position="super 58%"/>')
self.f.write('<style:style style:name="P1" style:family="paragraph">\n')
self.f.write('<style:properties fo:margin-left="0cm" ')
self.f.write('fo:margin-right="0cm" fo:text-indent="0cm"/>\n')
@ -366,8 +368,13 @@ class OpenDrawDoc(DrawDoc.DrawDoc):
self.f.write('</text:p>\n')
def write_text(self,text):
text = string.replace(text,'\t','<text:tab-stop/>')
text = string.replace(text,'\n','<text:line-break/>')
text = text.replace('&','&amp;'); # Must be first
text = text.replace('\t','<text:tab-stop/>')
text = text.replace('\n','<text:line-break/>')
text = text.replace('<','&lt;');
text = text.replace('>','&gt;');
text = text.replace('&lt;super&gt;','<text:span text:style-name="GSuper">')
text = text.replace('&lt;/super&gt;','</text:span>')
self.f.write(text)
def _write_manifest(self):

View File

@ -113,6 +113,10 @@ class OpenOfficeDoc(TextDoc.TextDoc):
self.f.write('style:font-pitch="variable"/>\n')
self.f.write('</office:font-decls>\n')
self.f.write('<office:automatic-styles>\n')
self.f.write('<style:style style:name="GSuper" style:family="text">')
self.f.write('<style:properties style:text-position="super 58%"/>')
self.f.write('</style:style>\n')
for style_name in self.style_list.keys():
style = self.style_list[style_name]
self.f.write('<style:style style:name="NL')
@ -525,6 +529,8 @@ class OpenOfficeDoc(TextDoc.TextDoc):
text = string.replace(text,'<','&lt;');
text = string.replace(text,'>','&gt;');
text = string.replace(text,'\n','<text:line-break/>')
text = text.replace('&lt;super&gt;','<text:span text:style-name="GSuper">')
text = text.replace('&lt;/super&gt;','</text:span>')
self.f.write(text)
def _write_manifest(self):