diff --git a/src/docgen/CairoDoc.py b/src/docgen/CairoDoc.py index 73732f72a..7b36238d4 100644 --- a/src/docgen/CairoDoc.py +++ b/src/docgen/CairoDoc.py @@ -1301,6 +1301,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/DescendTree.py b/src/plugins/DescendTree.py index 976bb7202..6c3a1258d 100644 --- a/src/plugins/DescendTree.py +++ b/src/plugins/DescendTree.py @@ -227,7 +227,10 @@ class DescendTree(Report): def write_report(self): (maxy,maxx) = self.genchart.dimensions() - maxx = (maxx-1)*2 + if maxx <> 1: + maxx = (maxx-1)*2 + else: + maxx = 1 maxh = int((self.uh-0.75)/(self.box_height*1.25)) if self.force_fit: