diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-02-21 10:12:02 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-02-21 10:12:02 +0000 |
commit | 64691f1398152413f91ebe6906806eb9eb8801b1 (patch) | |
tree | 31b205b6594685a7b24de8acb7b23d4b94f7a48b /pango/pango-layout.c | |
parent | a8f4e10b37a927543dfebe1a37a4d33463a209fc (diff) | |
download | pango-64691f1398152413f91ebe6906806eb9eb8801b1.tar.gz |
Change g_critical to g_warning. We already handle them gracefully.
2006-02-21 Behdad Esfahbod <behdad@gnome.org>
* pango/fonts.c, pango/glyphstring.c, pango/pango-fontmap.c,
pango/pango-ot-buffer.c, pango/pangocairo-font.c, pango/pangoft2.c,
pango/pangoxft-font.c, pango/shape.c: Change g_critical to g_warning.
We already handle them gracefully.
Bug 331994 – --disable-debug removes G_DISABLE_CAST_CHECKS
Patch from charlet@act-europe.fr
* configure.in: Do not lose PANGO_DEBUG_FLAGS when reassigning.
Bug 331995 – pango_layout_set_text optimization
Patch from charlet@act-europe.fr
* pango/pango-layout.c: Do not validate input text if asserts are
disabled. Moreover, do not truncate input text on invalid sequence.
Bug 331996 – avoid crashes in win32 font handling
Patch from charlet@act-europe.fr
* pango/pangofc-fontmap.c, pango/pangowin32-fontmap.c,
pango/pangowin32.c: if (!font) return NULL in a number of places.
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index f6e69edf..b7a0e3eb 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -819,7 +819,6 @@ pango_layout_set_text (PangoLayout *layout, const char *text, int length) { - const char *end; char *old_text; g_return_if_fail (layout != NULL); @@ -827,16 +826,20 @@ pango_layout_set_text (PangoLayout *layout, old_text = layout->text; + if (length < 0) + length = strlen (text); + +#ifndef G_DISABLE_ASSERT if (length != 0) { + const char *end; if (!g_utf8_validate (text, length, &end)) - g_warning ("Invalid UTF-8 string passed to pango_layout_set_text()"); - - while (end - text > G_MAXINT) - end = g_utf8_prev_char (end); - - length = end - text; + { + /* TODO: Write out the beginning excerpt of text? */ + g_warning ("Invalid UTF-8 string passed to pango_layout_set_text()"); + } } +#endif /* NULL-terminate the text for convenience. */ |