2956: Errors with GTKPrint on Ubuntu 9.04

svn: r12545
This commit is contained in:
Benny Malengier 2009-05-19 08:59:31 +00:00
parent 75787c8478
commit 71a93fe08e

View File

@ -595,8 +595,14 @@ class GtkPrint(CairoDoc):
# give a dummy cairo context to gtk.PrintContext,
# PrintPreview will update it with the real one
width = int(round(context.get_width()))
height = int(round(context.get_height()))
try:
width = int(round(context.get_width()))
except ValueError:
width = 0
try:
height = int(round(context.get_height()))
except ValueError:
height = 0
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
cr = cairo.Context(surface)
context.set_cairo_context(cr, PRINTER_DPI, PRINTER_DPI)