Break shared note links after finished reading GEDCOM

svn: r866
This commit is contained in:
Don Allingham 2002-03-28 14:57:40 +00:00
parent 9232082e9f
commit abcc1b8d38
2 changed files with 20 additions and 2 deletions

View File

@ -407,6 +407,18 @@ class MergePeople:
# copy children from source to target # copy children from source to target
for child in src_family.getChildList():
if child not in tgt_family.getChildList():
tgt_family.addChild(child)
if child.getMainParents() == src_family:
child.setMainParents(tgt_family)
else:
index = 0
for fam in child.getParentList()[:]:
if fam[0] == src_family:
child.getParentList()[index] = (tgt_family,fam[1],fam[2])
index = index + 1
# delete the old source family # delete the old source family
del self.db.getFamilyMap()[src_family.getId()] del self.db.getFamilyMap()[src_family.getId()]
@ -433,9 +445,9 @@ class MergePeople:
child.setMainParents(tgt_family) child.setMainParents(tgt_family)
else: else:
index = 0 index = 0
for fam in child.getAltFamilies(): for fam in child.getParentList()[:]:
if fam[0] == src_family: if fam[0] == src_family:
child.getAltFamilies()[index] = (tgt_family,fam[1],fam[2]) child.getParentList()[index] = (tgt_family,fam[1],fam[2])
index = index + 1 index = index + 1
# add family events from the old to the new # add family events from the old to the new

View File

@ -88,6 +88,9 @@ class SourceNote:
"""Return in note instance, not just the text""" """Return in note instance, not just the text"""
return self.note return self.note
def unique_note(self):
self.note = Note(self.note.get())
class LdsOrd(SourceNote): class LdsOrd(SourceNote):
"""LDS Ordinance support""" """LDS Ordinance support"""
def __init__(self,source=None): def __init__(self,source=None):
@ -1143,6 +1146,9 @@ class Person:
self.note = Note() self.note = Note()
return self.note return self.note
def unique_note(self):
self.note = Note(self.note.get())
def setPosition(self,pos): def setPosition(self,pos):
"""sets a graphical location pointer for graphic display (x,y)""" """sets a graphical location pointer for graphic display (x,y)"""
self.position = pos self.position = pos