2956: Errors with GTKPrint on Ubuntu 9.04

svn: r12546
This commit is contained in:
Benny Malengier 2009-05-19 08:59:41 +00:00
parent 45561e1596
commit ce44bc6b8d

View File

@ -606,8 +606,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)