aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-04-18 02:40:03 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-04-18 02:40:03 +0000
commitd9e42f0b6958e51d19600fd501e90c5b587aace9 (patch)
tree49c96cf6cee1af9d85b10dee1bd53824e570e9c5
parent6b964194e795188c5ae4dd2d6df539e970187ec1 (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
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/printing.c4
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index dd2b0fa7..29e4e3a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-18
+
+ * src/printing.c: message_count_page(): a workaround for the crach
+ which seems to occur on Fedora Core.
+
2007-04-17
* manual/ja/sylpheed.sgml
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 850deb65..75152ba9 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,3 +1,8 @@
+2007-04-18
+
+ * src/printing.c: message_count_page(): Fedora Core で発生すると
+ 思われるクラッシュへの対策。
+
2007-04-17
* manual/ja/sylpheed.sgml
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;