From 1a3a101420afd6f461e3e4e3fcb3d9c1696556eb Mon Sep 17 00:00:00 2001 From: "Craig J. Anderson" Date: Thu, 24 Feb 2011 17:11:35 +0000 Subject: [PATCH] Fixed issue 4670. 'one_page' option in the Ancestor/Descendant graphical repororts did not change the page type to 'custom'. also landscape orientation did not switch the page.height and page.width properties which made items print outside the page and give infinate loop errors. svn: r16708 --- src/plugins/docgen/GtkPrint.py | 8 ++++++-- src/plugins/lib/libtreebase.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/docgen/GtkPrint.py b/src/plugins/docgen/GtkPrint.py index b59325a58..9acd34043 100644 --- a/src/plugins/docgen/GtkPrint.py +++ b/src/plugins/docgen/GtkPrint.py @@ -136,8 +136,12 @@ def paperstyle_to_pagesetup(paper_style): paper_size = gtk.PaperSize(gramps_to_gtk[gramps_paper_name]) log.debug("Selected paper size: %s" % gramps_to_gtk[gramps_paper_name]) else: - paper_width = gramps_paper_size.get_width() * 10 - paper_height = gramps_paper_size.get_height() * 10 + if paper_style.get_orientation() == PAPER_PORTRAIT: + paper_width = gramps_paper_size.get_width() * 10 + paper_height = gramps_paper_size.get_height() * 10 + else: + paper_width = gramps_paper_size.get_height() * 10 + paper_height = gramps_paper_size.get_width() * 10 paper_size = gtk.paper_size_new_custom("custom", "Custom Size", paper_width, diff --git a/src/plugins/lib/libtreebase.py b/src/plugins/lib/libtreebase.py index 4ce3fbcef..800214e00 100644 --- a/src/plugins/lib/libtreebase.py +++ b/src/plugins/lib/libtreebase.py @@ -338,6 +338,7 @@ class Canvas(Page): #user wants PAGE to be the size of the report. size = self.doc.paper.get_size() + size.name = 'custom' max_width, max_height = \ self.canvas.get_report_height_width()