diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-04-18 02:40:03 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-04-18 02:40:03 +0000 |
commit | d9e42f0b6958e51d19600fd501e90c5b587aace9 (patch) | |
tree | 49c96cf6cee1af9d85b10dee1bd53824e570e9c5 /src | |
parent | 6b964194e795188c5ae4dd2d6df539e970187ec1 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/printing.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |