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>
|
2007-07-08 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/GrampsDb/_GrampsDBDir.py (write_lock_file): Work around
|
* src/GrampsDb/_GrampsDBDir.py (write_lock_file): Work around
|
||||||
os.getlogin() problem on some terminals.
|
os.getlogin() problem on some terminals.
|
||||||
|
@ -64,7 +64,7 @@ _esc_map = {
|
|||||||
'\x1a' : '',
|
'\x1a' : '',
|
||||||
'\x0c' : '',
|
'\x0c' : '',
|
||||||
'\n' : '<text:line-break/>',
|
'\n' : '<text:line-break/>',
|
||||||
'\t' : '<text:tab-stop/>',
|
'\t' : '<text:tab />',
|
||||||
'<super>' : '<text:span text:style-name="GSuper">',
|
'<super>' : '<text:span text:style-name="GSuper">',
|
||||||
'</super>' : '</text:span>',
|
'</super>' : '</text:span>',
|
||||||
}
|
}
|
||||||
@ -861,21 +861,13 @@ class ODFDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc,BaseDoc.DrawDoc):
|
|||||||
|
|
||||||
def write_note(self,text,format,style_name):
|
def write_note(self,text,format,style_name):
|
||||||
if format == 1:
|
if format == 1:
|
||||||
text = text.replace('&','&') # Must be first
|
text = escape(text,_esc_map)
|
||||||
text = text.replace('<','<')
|
|
||||||
text = text.replace('>','>')
|
|
||||||
# Replace multiple spaces: have to go from the largest number down
|
# Replace multiple spaces: have to go from the largest number down
|
||||||
for n in range(text.count(' '),1,-1):
|
for n in range(text.count(' '),1,-1):
|
||||||
text = text.replace(' '*n, ' <text:s text:c="%d"/>' % (n-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.start_paragraph(style_name)
|
||||||
self.cntnt.write('<text:span text:style-name="GRAMPS-preformat">')
|
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.cntnt.write('</text:span>')
|
||||||
self.end_paragraph()
|
self.end_paragraph()
|
||||||
elif format == 0:
|
elif format == 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user