aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/gui/print.c18
2 files changed, 18 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index e404f89c47..cfb76d99b3 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2004-02-04 Yong Sun <Yong.Sun@sun.com>
+
+ * gui/print.c: Fix a bug in evolution/calendar/gui/print.c:
+ bound_text(). It does not break lines with the correct boundary of UTF-8
+ characters. So, for non-latin locales, it will cause printing issues.
+
2004-02-03 Dan Winship <danw@ximian.com>
* gui/tasks-component.h: Fix location of e-activity-handler.h
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index f83cb473b5..3c32ef1448 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -743,11 +743,15 @@ bound_text(GnomePrintContext *pc, GnomeFont *font, const char *text,
*o++=c;
if (c==' ')
wordstart = o;
- width+=gnome_font_get_glyph_width(font, gnome_font_lookup_default (font, c));
- if (width>maxwidth)
- dump=1;
- else
- dump=0;
+
+ dump=0;
+ if (g_utf8_validate (p, strlen(p), NULL)) {
+ width+=gnome_font_get_glyph_width(font, gnome_font_lookup_default (font, c));
+ if (width>maxwidth) {
+ o--;
+ dump=1;
+ }
+ }
}
if (dump) {
if (wordstart==outbuffer)
@@ -772,8 +776,9 @@ bound_text(GnomePrintContext *pc, GnomeFont *font, const char *text,
maxwidth -= indent;
first=0;
}
+ } else {
+ p++;
}
- p++;
}
if (dump==0) {
*o=0;
@@ -782,6 +787,7 @@ bound_text(GnomePrintContext *pc, GnomeFont *font, const char *text,
top -= gnome_font_get_size (font);
}
g_free(outbuffer);
+
return top;
}