From 41d3ab4d58a361009bc09ea4f8ef75d0ee234eff Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Tue, 16 Aug 2011 20:31:30 +0000 Subject: [PATCH] 5159: Import of xml file with note linking to duplicate object points to original object svn: r18038 --- src/plugins/import/ImportXml.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/import/ImportXml.py b/src/plugins/import/ImportXml.py index 500856528..874abf14d 100644 --- a/src/plugins/import/ImportXml.py +++ b/src/plugins/import/ImportXml.py @@ -1576,6 +1576,18 @@ class GrampsParser(UpdateCallback): tagtype.set_from_xml_str(attrs['name'].lower()) try: 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) except KeyError: tagvalue = None