From bf305d9251129264cc3331ac862ee4c702aa9218 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sat, 14 Feb 2009 13:45:44 +0000 Subject: [PATCH] 2665: PDF: Paginate error in descendant chart (graphical) on person without descendants svn: r11986 --- src/plugins/docgen/CairoDoc.py | 3 +++ src/plugins/drawreport/DescendTree.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/docgen/CairoDoc.py b/src/plugins/docgen/CairoDoc.py index c92609f5f..b5005083f 100644 --- a/src/plugins/docgen/CairoDoc.py +++ b/src/plugins/docgen/CairoDoc.py @@ -1444,6 +1444,9 @@ class CairoDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc): self._available_height = page_height # try to fit the next element to current page, divide it if needed + if not self._elements_to_paginate: + #this is a self._doc where nothing has been added. Empty page. + return True elem = self._elements_to_paginate.pop(0) (e1, e2), e1_h = elem.divide(layout, page_width, diff --git a/src/plugins/drawreport/DescendTree.py b/src/plugins/drawreport/DescendTree.py index a29039d24..3d4e76820 100644 --- a/src/plugins/drawreport/DescendTree.py +++ b/src/plugins/drawreport/DescendTree.py @@ -268,7 +268,11 @@ class DescendTree(Report): def write_report(self): (maxy,maxx) = self.genchart.dimensions() - maxx = (maxx-1)*2 + if maxx <> 1: + maxx = (maxx-1)*2 + else: + #no descendants + maxx = 1 maxh = int((self.uh-0.75)/(self.box_height*1.25)) if self.force_fit: