diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ea6fbc0f3..4ee4e2fd1 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,5 +1,7 @@ 2005-11-25 Martin Hawlisch - * src/GenericFilter.py (HasCommonAncestorWith): Catch no longer existing person + * src/GenericFilter.py (HasCommonAncestorWith): Catch no longer + existing person; (IsSpouseOfFilterMatch) Call prepare for recursive + filter 2005-11-24 Don Allingham * src/po/template.po: updated translation file diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index 155ddb968..7493bc32a 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -1409,8 +1409,11 @@ class IsSpouseOfFilterMatch(Rule): description = _("Matches people married to anybody matching a filter") category = _('Family filters') + def prepare(self,db): + self.filt = MatchesFilter (self.list) + self.filt.prepare(db) + def apply(self,db,person): - filt = MatchesFilter (self.list) for family_handle in person.get_family_handle_list (): family = db.get_family_from_handle(family_handle) for spouse_id in [family.get_father_handle (), family.get_mother_handle ()]: @@ -1418,7 +1421,7 @@ class IsSpouseOfFilterMatch(Rule): continue if spouse_id == person.handle: continue - if filt.apply (db, db.get_person_from_handle( spouse_id)): + if self.filt.apply (db, db.get_person_from_handle( spouse_id)): return True return False