parent
1c550c4c60
commit
06620b869e
@ -1,3 +1,8 @@
|
||||
2007-07-08 Brian Matherly <brian@gramps-project.org>
|
||||
Robert Cawley <rjc@cawley.id.au>
|
||||
* src/docgen/ODFDoc.py
|
||||
(write_note): Fix display of preformatted notes (#0001109)
|
||||
|
||||
2007-07-08 Alex Roitman <shura@gramps-project.org>
|
||||
* src/GrampsDb/_GrampsDBDir.py (write_lock_file): Work around
|
||||
os.getlogin() problem on some terminals.
|
||||
|
@ -64,7 +64,7 @@ _esc_map = {
|
||||
'\x1a' : '',
|
||||
'\x0c' : '',
|
||||
'\n' : '<text:line-break/>',
|
||||
'\t' : '<text:tab-stop/>',
|
||||
'\t' : '<text:tab />',
|
||||
'<super>' : '<text:span text:style-name="GSuper">',
|
||||
'</super>' : '</text:span>',
|
||||
}
|
||||
@ -861,21 +861,13 @@ class ODFDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc,BaseDoc.DrawDoc):
|
||||
|
||||
def write_note(self,text,format,style_name):
|
||||
if format == 1:
|
||||
text = text.replace('&','&') # Must be first
|
||||
text = text.replace('<','<')
|
||||
text = text.replace('>','>')
|
||||
text = escape(text,_esc_map)
|
||||
# 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.cntnt.write('<text:span text:style-name="GRAMPS-preformat">')
|
||||
self.cntnt.write(escape(text,_esc_map))
|
||||
self.cntnt.write(text)
|
||||
self.cntnt.write('</text:span>')
|
||||
self.end_paragraph()
|
||||
elif format == 0:
|
||||
|
Loading…
Reference in New Issue
Block a user