2007-04-10 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_ReadGedcom.py: add hack to force illegal "BET ABT" to be read
	as "EST BET"
	* src/ReportBase/_BareReportDialog.py: escape ampersands
	* src/docgen/ODFDoc.py: escape ampersands
	* src/ManagedWindow.py: escape ampersands



svn: r8377
This commit is contained in:
Don Allingham 2007-04-11 04:54:38 +00:00
parent fdec255b9f
commit 553477b1d5
5 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2007-04-10 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: add hack to force illegal "BET ABT" to be read
as "EST BET"
* src/ReportBase/_BareReportDialog.py: escape ampersands
* src/docgen/ODFDoc.py: escape ampersands
* src/ManagedWindow.py: escape ampersands
2007-04-10 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2007-04-10 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/plugins/ImportGeneWeb.py: Some parsing enhancements * src/plugins/ImportGeneWeb.py: Some parsing enhancements

View File

@ -2384,6 +2384,9 @@ class GedcomParser(UpdateCallback):
def extract_date(self, text): def extract_date(self, text):
dateobj = RelLib.Date() dateobj = RelLib.Date()
text = text.replace('BET ABT','EST BET') # Horrible hack for Tim Lyons
try: try:
match = intRegexp.match(text) match = intRegexp.match(text)
if match: if match:
@ -2391,7 +2394,6 @@ class GedcomParser(UpdateCallback):
text, comment = match.groups() text, comment = match.groups()
else: else:
int_val = False int_val = False
match = modRegexp.match(text) match = modRegexp.match(text)
qual = None qual = None
if match: if match:

View File

@ -395,7 +395,8 @@ class ManagedWindow:
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def set_titles(window,title,t,msg=None): def set_titles(window,title,t,msg=None):
if title: if title:
title.set_text('<span weight="bold" size="larger">%s</span>' % t) print escape(t)
title.set_text('<span weight="bold" size="larger">%s</span>' % escape(t))
title.set_use_markup(True) title.set_use_markup(True)
if msg: if msg:
window.set_title('%s - GRAMPS' % msg) window.set_title('%s - GRAMPS' % msg)

View File

@ -27,6 +27,7 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from types import ClassType, InstanceType from types import ClassType, InstanceType
from gettext import gettext as _ from gettext import gettext as _
from xml.sax.saxutils import escape
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -330,7 +331,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
of the currently selected person.""" of the currently selected person."""
title = self.get_header(self.name) title = self.get_header(self.name)
label = gtk.Label('<span size="larger" weight="bold">%s</span>' % title) label = gtk.Label('<span size="larger" weight="bold">%s</span>' % escape(title))
label.set_use_markup(True) label.set_use_markup(True)
self.window.vbox.pack_start(label, True, True, self.window.vbox.pack_start(label, True, True,
BareReportDialog.border_pad) BareReportDialog.border_pad)

View File

@ -824,7 +824,7 @@ class ODFDoc(BaseDoc.BaseDoc):
self.cntnt.write(name) self.cntnt.write(name)
self.cntnt.write('" text:outline-level="' + str(self.level) + '">') self.cntnt.write('" text:outline-level="' + str(self.level) + '">')
if leader != None: if leader != None:
self.cntnt.write(leader) self.cntnt.write(escape(leader))
self.cntnt.write('<text:tab/>') self.cntnt.write('<text:tab/>')
self.new_cell = 0 self.new_cell = 0
@ -995,7 +995,7 @@ class ODFDoc(BaseDoc.BaseDoc):
self.cntnt.write('<text:p text:style-name="X%s"> ' % pname) self.cntnt.write('<text:p text:style-name="X%s"> ' % pname)
self.cntnt.write('<text:span text:style-name="F%s">\n' % pname) self.cntnt.write('<text:span text:style-name="F%s">\n' % pname)
self.write_text('\n'.join(text)) self.write_text('\n'.join(escape(text)))
self.cntnt.write('</text:span>\n</text:p>\n</draw:text-box>\n') self.cntnt.write('</text:span>\n</text:p>\n</draw:text-box>\n')
self.cntnt.write('</draw:frame>\n') self.cntnt.write('</draw:frame>\n')
@ -1067,7 +1067,7 @@ class ODFDoc(BaseDoc.BaseDoc):
self.cntnt.write('<text:p text:style-name="F%s">' % para_name) self.cntnt.write('<text:p text:style-name="F%s">' % para_name)
self.cntnt.write('<text:span text:style-name="F%s"' % para_name) self.cntnt.write('<text:span text:style-name="F%s"' % para_name)
self.cntnt.write(' fo:max-height="%.2f">' % font.get_size() ) self.cntnt.write(' fo:max-height="%.2f">' % font.get_size() )
self.cntnt.write(text) self.cntnt.write(escape(text))
self.cntnt.write('</text:span></text:p>') self.cntnt.write('</text:span></text:p>')
self.cntnt.write('</draw:text-box>\n') self.cntnt.write('</draw:text-box>\n')
self.cntnt.write('</draw:frame>\n') self.cntnt.write('</draw:frame>\n')
@ -1139,7 +1139,7 @@ class ODFDoc(BaseDoc.BaseDoc):
self.cntnt.write('<draw:text-box>') self.cntnt.write('<draw:text-box>')
self.cntnt.write('<text:p text:style-name="X%s">' % para_name) self.cntnt.write('<text:p text:style-name="X%s">' % para_name)
self.cntnt.write('<text:span text:style-name="F%s">' % para_name) self.cntnt.write('<text:span text:style-name="F%s">' % para_name)
self.cntnt.write(text) self.cntnt.write(escape(text))
self.cntnt.write('</text:span>\n') self.cntnt.write('</text:span>\n')
self.cntnt.write('</text:p>\n') self.cntnt.write('</text:p>\n')
self.cntnt.write('</draw:text-box>') self.cntnt.write('</draw:text-box>')