5159: Import of xml file with note linking to duplicate object points to original object

svn: r18038
This commit is contained in:
Michiel Nauta 2011-08-16 20:31:30 +00:00
parent 9dd5465216
commit 41d3ab4d58

View File

@ -1576,6 +1576,18 @@ class GrampsParser(UpdateCallback):
tagtype.set_from_xml_str(attrs['name'].lower()) tagtype.set_from_xml_str(attrs['name'].lower())
try: try:
val = attrs['value'] val = attrs['value']
match = self.grampsuri.match(val)
if match:
target = {"Person":"person", "Family":"family",
"Event":"event", "Place":"place", "Source":"source",
"Repository":"repository", "Media":"media",
"Note":"note"}[str(match.group('object_class'))]
if match.group('handle') in self.import_handles:
if target in self.import_handles[match.group('handle')]:
val = "gramps://%s/handle/%s" % (
match.group('object_class'),
self.import_handles[match.group('handle')]
[target])
tagvalue = gen.lib.StyledTextTagType.STYLE_TYPE[int(tagtype)](val) tagvalue = gen.lib.StyledTextTagType.STYLE_TYPE[int(tagtype)](val)
except KeyError: except KeyError:
tagvalue = None tagvalue = None