* src/docgen/OpenOfficeDoc.py (write_note): Implement function.
svn: r2514
This commit is contained in:
parent
570fd76a2f
commit
2819de10a2
@ -6,6 +6,7 @@
|
||||
* src/docgen/RTFDoc.py (write_note): Implement function.
|
||||
* src/docgen/AbiWordDoc.py (write_note): Implement function.
|
||||
* src/docgen/AbiWord2Doc.py (write_note): Implement function.
|
||||
* src/docgen/OpenOfficeDoc.py (write_note): Implement function.
|
||||
|
||||
2003-12-11 Don Allingham <dallingham@users.sourceforge.net>
|
||||
* src/plugins/WriteFtree.py (FtreeWriter.export): make sure that the
|
||||
|
@ -17,6 +17,9 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provides a BaseDoc based interface to the AbiWord document format.
|
||||
"""
|
||||
@ -223,10 +226,9 @@ class AbiWordDoc(BaseDoc.BaseDoc):
|
||||
|
||||
def write_note(self,text,format,style_name):
|
||||
if format == 1:
|
||||
for line in text.split('\n'):
|
||||
self.start_paragraph(style_name)
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
self.start_paragraph(style_name)
|
||||
self.write_text(text)
|
||||
self.end_paragraph()
|
||||
elif format == 0:
|
||||
for line in text.split('\n\n'):
|
||||
self.start_paragraph(style_name)
|
||||
|
@ -17,6 +17,9 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provides a BaseDoc based interface to the AbiWord document format.
|
||||
"""
|
||||
@ -237,10 +240,9 @@ class AbiWordDoc(BaseDoc.BaseDoc):
|
||||
|
||||
def write_note(self,text,format,style_name):
|
||||
if format == 1:
|
||||
for line in text.split('\n'):
|
||||
self.start_paragraph(style_name)
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
self.start_paragraph(style_name)
|
||||
self.write_text(text)
|
||||
self.end_paragraph()
|
||||
elif format == 0:
|
||||
for line in text.split('\n\n'):
|
||||
self.start_paragraph(style_name)
|
||||
|
@ -18,6 +18,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Standard Python Modules
|
||||
@ -665,6 +667,30 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
|
||||
self.f.write('</text:h>\n')
|
||||
self.new_cell = 1
|
||||
|
||||
def write_note(self,text,format,style_name):
|
||||
if format == 1:
|
||||
text = text.replace('&','&') # Must be first
|
||||
text = text.replace('<','<')
|
||||
text = text.replace('>','>')
|
||||
# Replace multiple spaces: have to go from the largest number down
|
||||
for n in range(text.count(' '),1,-1):
|
||||
text = text.replace(' '*n, ' <text:s text:c="%d"/>' % (n-1) )
|
||||
text = text.replace('\n','<text:line-break/>')
|
||||
text = text.replace('\t','<text:tab-stop/>')
|
||||
text = text.replace('<super>','<text:span text:style-name="GSuper">')
|
||||
text = text.replace('</super>','</text:span>')
|
||||
|
||||
self.start_paragraph(style_name)
|
||||
self.f.write(text)
|
||||
self.end_paragraph()
|
||||
elif format == 0:
|
||||
for line in text.split('\n\n'):
|
||||
self.start_paragraph(style_name)
|
||||
line = line.replace('\n',' ')
|
||||
line = string.join(string.split(line))
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
|
||||
def write_text(self,text):
|
||||
text = text.replace('&','&') # Must be first
|
||||
text = text.replace('<','<')
|
||||
|
Loading…
Reference in New Issue
Block a user