* src/docgen/OpenOfficeDoc.py: Surround images by paragraph tags

when inside the table cell.


svn: r1718
This commit is contained in:
Alex Roitman 2003-06-13 04:07:13 +00:00
parent ec5e7e7bc7
commit 1584227b86
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2003-06-12 Tim Waugh <twaugh@redhat.com>
* src/docgen/OpenOfficeDoc.py: Surround images by paragraph tags
when inside the table cell.
2003-06-12 Don Allingham <dallingham@users.sourceforge.net> 2003-06-12 Don Allingham <dallingham@users.sourceforge.net>
* src/DrawDoc.py: support for drawing wedges and rotated text * src/DrawDoc.py: support for drawing wedges and rotated text
* src/docgen/PSDrawDoc.py: postscipt support for wedges and rotated * src/docgen/PSDrawDoc.py: postscipt support for wedges and rotated

View File

@ -61,6 +61,7 @@ class OpenOfficeDoc(TextDoc.TextDoc):
self.level = 0 self.level = 0
self.time = "0000-00-00T00:00:00" self.time = "0000-00-00T00:00:00"
self.new_page = 0 self.new_page = 0
self.new_cell = 0
def open(self,filename): def open(self,filename):
t = time.localtime(time.time()) t = time.localtime(time.time())
@ -259,6 +260,8 @@ class OpenOfficeDoc(TextDoc.TextDoc):
base = os.path.basename(name) base = os.path.basename(name)
tag = string.replace(base,'.','_') tag = string.replace(base,'.','_')
if self.new_cell:
self.f.write('<text:p>\n')
if pos == "left": if pos == "left":
self.f.write('<draw:image draw:style-name="Left" ') self.f.write('<draw:image draw:style-name="Left" ')
elif pos == "right": elif pos == "right":
@ -278,6 +281,8 @@ class OpenOfficeDoc(TextDoc.TextDoc):
self.f.write(base) self.f.write(base)
self.f.write('" xlink:type="simple" xlink:show="embed" ') self.f.write('" xlink:type="simple" xlink:show="embed" ')
self.f.write('xlink:actuate="onLoad"/>\n') self.f.write('xlink:actuate="onLoad"/>\n')
if self.new_cell:
self.f.write('</text:p>\n')
def start_table(self,name,style_name): def start_table(self,name,style_name):
self.f.write('<table:table table:name="') self.f.write('<table:table table:name="')
@ -306,11 +311,13 @@ class OpenOfficeDoc(TextDoc.TextDoc):
self.f.write(' table:number-columns-spanned="%s">\n' % span) self.f.write(' table:number-columns-spanned="%s">\n' % span)
else: else:
self.f.write('>\n') self.f.write('>\n')
self.new_cell = 1
def end_cell(self): def end_cell(self):
self.f.write('</table:table-cell>\n') self.f.write('</table:table-cell>\n')
for col in range(1,self.span): for col in range(1,self.span):
self.f.write('<table:covered-table-cell/>\n') self.f.write('<table:covered-table-cell/>\n')
self.new_cell = 0
def start_bold(self): def start_bold(self):
self.f.write('<text:span text:style-name="Tbold">') self.f.write('<text:span text:style-name="Tbold">')
@ -504,12 +511,14 @@ class OpenOfficeDoc(TextDoc.TextDoc):
if leader != None: if leader != None:
self.f.write(leader) self.f.write(leader)
self.f.write('<text:tab-stop/>') self.f.write('<text:tab-stop/>')
self.new_cell = 0
def end_paragraph(self): def end_paragraph(self):
if self.level == 0: if self.level == 0:
self.f.write('</text:p>\n') self.f.write('</text:p>\n')
else: else:
self.f.write('</text:h>\n') self.f.write('</text:h>\n')
self.new_cell = 1
def write_text(self,text): def write_text(self,text):
text = string.replace(text,'\n','<text:line-break/>') text = string.replace(text,'\n','<text:line-break/>')