Fix bug in processing of Place FORM in GEDCOM import as a result of fix
for 8233. When an unused Place was removed, PlaceImport still tried to generate the place hierarchy. Also fixed bug in GEDCOM import where a default PLAC FORM in the GEDCOM header was ignored.
This commit is contained in:
parent
4c69260c4b
commit
e6cb3b1360
@ -5372,6 +5372,7 @@ class GedcomParser(UpdateCallback):
|
|||||||
self.place_names[title].append(place_handle)
|
self.place_names[title].append(place_handle)
|
||||||
else:
|
else:
|
||||||
place.merge(old_place)
|
place.merge(old_place)
|
||||||
|
self.place_import.remove_location(old_place.handle)
|
||||||
self.dbase.remove_place(place_handle, self.trans)
|
self.dbase.remove_place(place_handle, self.trans)
|
||||||
self.place_names[old_title].remove(place_handle)
|
self.place_names[old_title].remove(place_handle)
|
||||||
else:
|
else:
|
||||||
@ -5392,7 +5393,7 @@ class GedcomParser(UpdateCallback):
|
|||||||
sub_state = CurrentState()
|
sub_state = CurrentState()
|
||||||
sub_state.place = place
|
sub_state.place = place
|
||||||
sub_state.level = state.level+1
|
sub_state.level = state.level+1
|
||||||
sub_state.pf = PlaceParser()
|
sub_state.pf = self.place_parser
|
||||||
|
|
||||||
self.__parse_level(sub_state, self.event_place_map,
|
self.__parse_level(sub_state, self.event_place_map,
|
||||||
self.__undefined)
|
self.__undefined)
|
||||||
@ -5538,6 +5539,7 @@ class GedcomParser(UpdateCallback):
|
|||||||
self.__add_location(place, location)
|
self.__add_location(place, location)
|
||||||
else:
|
else:
|
||||||
place.merge(old_place)
|
place.merge(old_place)
|
||||||
|
self.place_import.remove_location(old_place.handle)
|
||||||
self.dbase.remove_place(place_handle, self.trans)
|
self.dbase.remove_place(place_handle, self.trans)
|
||||||
self.place_names[title].remove(place_handle)
|
self.place_names[title].remove(place_handle)
|
||||||
else:
|
else:
|
||||||
|
@ -51,6 +51,15 @@ class PlaceImport(object):
|
|||||||
self.loc2handle[location] = handle
|
self.loc2handle[location] = handle
|
||||||
self.handle2loc[handle] = location
|
self.handle2loc[handle] = location
|
||||||
|
|
||||||
|
def remove_location(self, handle):
|
||||||
|
"""
|
||||||
|
Remove the location of a place already in the database.
|
||||||
|
"""
|
||||||
|
if handle in self.handle2loc:
|
||||||
|
loc = self.handle2loc[handle]
|
||||||
|
del(self.loc2handle[loc])
|
||||||
|
del(self.handle2loc[handle])
|
||||||
|
|
||||||
def generate_hierarchy(self, trans):
|
def generate_hierarchy(self, trans):
|
||||||
"""
|
"""
|
||||||
Generate missing places in the place hierarchy.
|
Generate missing places in the place hierarchy.
|
||||||
|
Loading…
Reference in New Issue
Block a user