From d9e42f0b6958e51d19600fd501e90c5b587aace9 Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 18 Apr 2007 02:40:03 +0000 Subject: printing.c: a workaround for the crach which seems to occur on Fedora Core. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1646 ee746299-78ed-0310-b773-934348b2243d --- src/printing.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/printing.c b/src/printing.c index 3cbb3121..690f86bf 100644 --- a/src/printing.c +++ b/src/printing.c @@ -205,6 +205,10 @@ static gint message_count_page(MsgPrintInfo *mpinfo, GtkPrintContext *context, pango_layout_set_text(layout, "Test", -1); pango_layout_get_size(layout, NULL, &layout_h); + if (layout_h <= 0) { + g_warning("invalid layout_h (%d) ! falling back to default height (%d)\n", layout_h, 12 * PANGO_SCALE); + layout_h = 12 * PANGO_SCALE; + } line_h = (gdouble)layout_h / PANGO_SCALE + SPACING; print_data->line_h = line_h; lines_per_page = (height - line_h) / line_h; -- cgit v1.2.3