diff --git a/ChangeLog b/ChangeLog index 7fbc02f45..7a3f686c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-29 Gary Burton + * src/plugins/TimeLine.py: + * src/Sort.py: Use fallback events e.g. baptism/burial when no birth or + death events are available. + 2008-01-29 Peter Landgren * src/plugins/ChangeNames.py: Improved capitalization rules for names with one prefix and multiple surnames with or without hyphen(s) diff --git a/src/Sort.py b/src/Sort.py index d58e48654..39d511602 100644 --- a/src/Sort.py +++ b/src/Sort.py @@ -41,6 +41,7 @@ import locale #------------------------------------------------------------------------- from gen.lib import Date from BasicUtils import name_displayer as _nd +from ReportBase import ReportUtils #------------------------------------------------------------------------- # @@ -94,15 +95,15 @@ class Sort: first = self.database.get_person_from_handle(first_id) second = self.database.get_person_from_handle(second_id) - birth_ref1 = first.get_birth_ref() - if birth_ref1: - date1 = self.database.get_event_from_handle(birth_ref1.ref).get_date_object() + birth1 = ReportUtils.get_birth_or_fallback(self.database, first) + if birth1: + date1 = birth1.get_date_object() else: date1 = Date() - birth_ref2 = second.get_birth_ref() - if birth_ref2: - date2 = self.database.get_event_from_handle(birth_ref2.ref).get_date_object() + birth2 = ReportUtils.get_birth_or_fallback(self.database, second) + if birth2: + date2 = birth2.get_date_object() else: date2 = Date() diff --git a/src/plugins/TimeLine.py b/src/plugins/TimeLine.py index 4a7b64538..7eab7e10b 100644 --- a/src/plugins/TimeLine.py +++ b/src/plugins/TimeLine.py @@ -132,16 +132,14 @@ class TimeLine(Report): for p_id in self.plist: p = self.database.get_person_from_handle(p_id) - b_ref = p.get_birth_ref() - if b_ref: - birth = self.database.get_event_from_handle(b_ref.ref) + birth = ReportUtils.get_birth_or_fallback(self.database, p) + if birth: b = birth.get_date_object().get_year() else: b = None - d_ref = p.get_death_ref() - if d_ref: - death = self.database.get_event_from_handle(d_ref.ref) + death = ReportUtils.get_death_or_fallback(self.database, p) + if death: d = death.get_date_object().get_year() else: d = None @@ -232,16 +230,14 @@ class TimeLine(Report): for p_id in self.plist: p = self.database.get_person_from_handle(p_id) - b_ref = p.get_birth_ref() - if b_ref: - birth = self.database.get_event_from_handle(b_ref.ref) + birth = ReportUtils.get_birth_or_fallback(self.database, p) + if birth: b = birth.get_date_object().get_year() else: b = None - d_ref = p.get_death_ref() - if d_ref: - death = self.database.get_event_from_handle(d_ref.ref) + death = ReportUtils.get_death_or_fallback(self.database, p) + if death: d = death.get_date_object().get_year() else: d = None