From a6b17dc87c612ece88589c4a678674b4a89491a3 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 19 Jan 2007 17:09:38 +0000 Subject: [PATCH] Update svn: r7933 --- src/GrampsDb/_GrampsBSDDB.py | 2 +- src/GrampsDb/_GrampsDbBase.py | 3 ++- src/GrampsDb/_GrampsInMemDB.py | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/GrampsDb/_GrampsBSDDB.py b/src/GrampsDb/_GrampsBSDDB.py index 911d0dba6..b876519d7 100644 --- a/src/GrampsDb/_GrampsBSDDB.py +++ b/src/GrampsDb/_GrampsBSDDB.py @@ -1209,7 +1209,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): The function must be overridden in the derived class. """ name = str(person.get_primary_name().get_surname()) - if self.surnames.keys().count(name) > 1: + if self.surnames.keys().count(name) == 1: self.surname_list.remove(unicode(name)) def _get_obj_from_gramps_id(self,val,tbl,class_init,prim_tbl): diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index 41241e62f..f1f82ef26 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -470,9 +470,10 @@ class GrampsDbBase(GrampsDBCallback): if old_data: old_person = Person(old_data) if (old_data[2] != person.gender or - old_data[3][2]!= person.primary_name.first_name): + old_data[3][4]!= person.primary_name.first_name): self.genderStats.uncount_person(old_person) self.genderStats.count_person(person) + if (old_data[3][5]!=person.primary_name.surname): self.remove_from_surname_list(old_person) self.add_to_surname_list(person,transaction.batch) else: diff --git a/src/GrampsDb/_GrampsInMemDB.py b/src/GrampsDb/_GrampsInMemDB.py index 51f132ff7..c174b4597 100644 --- a/src/GrampsDb/_GrampsInMemDB.py +++ b/src/GrampsDb/_GrampsInMemDB.py @@ -154,15 +154,20 @@ class GrampsInMemDB(GrampsDbBase): """ name = str(person.get_primary_name().get_surname()) count = 0 + do_remove = True + for person_id in iter(self.person_map): p = self.get_person_from_handle(person_id) pn = str(p.get_primary_name().get_surname()) if pn == name: count += 1 if count > 1: - self.surname_list.remove(unicode(name)) + do_remove = False break + if do_remove: + self.surname_list.remove(unicode(name)) + def _del_person(self,handle): person = self.get_person_from_handle(str(handle)) del self.id_trans[person.get_gramps_id()]