From a22f2fd5a75659ad123de61cb2feea3027d017ba Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 2 Nov 2006 03:34:16 +0000 Subject: [PATCH] 2006-11-01 Don Allingham * src/plugins/DescendReport.py: handle exceeding the max generations svn: r7538 --- gramps2/ChangeLog | 3 +++ gramps2/src/plugins/DescendReport.py | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index d86116e34..49c12083a 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2006-11-01 Don Allingham + * src/plugins/DescendReport.py: handle exceeding the max generations + 2006-11-01 Martin Hawlisch * src/ScratchPad.py: Fix signal connection and dbstate vs. db confusion; Add more checks for is_valid; This should now remove stale objects on diff --git a/gramps2/src/plugins/DescendReport.py b/gramps2/src/plugins/DescendReport.py index cca2f591a..5ad571a85 100644 --- a/gramps2/src/plugins/DescendReport.py +++ b/gramps2/src/plugins/DescendReport.py @@ -158,7 +158,7 @@ class DescendantReport(Report): def dump(self,level,person): - self.doc.start_paragraph("DR-Level%d" % level,"%d." % level) + self.doc.start_paragraph("DR-Level%d" % min(level,32),"%d." % level) mark = ReportUtils.get_person_mark(self.database,person) self.doc.write_text(NameDisplay.displayer.display(person),mark) self.dump_dates(person) @@ -174,7 +174,7 @@ class DescendantReport(Report): if spouse_handle: spouse = self.database.get_person_from_handle(spouse_handle) mark = ReportUtils.get_person_mark(self.database,person) - self.doc.start_paragraph("DR-Spouse%d" % level) + self.doc.start_paragraph("DR-Spouse%d" % min(level,32)) name = NameDisplay.displayer.display(spouse) self.doc.write_text(_("sp. %(spouse)s") % {'spouse':name},mark) self.dump_dates(spouse) @@ -224,7 +224,7 @@ class DescendantOptions(ReportOptions): f = BaseDoc.FontStyle() f.set_size(10) - for i in range(1,32): + for i in range(1,33): p = BaseDoc.ParagraphStyle() p.set_font(f) p.set_top_margin(ReportUtils.pt2cm(f.get_size()*0.125)) @@ -233,7 +233,7 @@ class DescendantOptions(ReportOptions): p.set_left_margin(min(10.0,float(i-0.5))) p.set_description(_("The style used for the " "level %d display.") % i) - default_style.add_style("DR-Level%d" % i,p) + default_style.add_style("DR-Level%d" % min(i,32), p) p = BaseDoc.ParagraphStyle() p.set_font(f) @@ -242,7 +242,7 @@ class DescendantOptions(ReportOptions): p.set_left_margin(min(10.0,float(i-0.5))) p.set_description(_("The style used for the " "spouse level %d display.") % i) - default_style.add_style("DR-Spouse%d" % i,p) + default_style.add_style("DR-Spouse%d" % min(i,32), p) #------------------------------------------------------------------------ #