Re: Getting patches looked at



On Thu, 2006-11-09 at 14:25 +0100, Tom Parker wrote:
> Hiya,

> 2) http://bugzilla.gnome.org/show_bug.cgi?id=345025 Truncating over-long 
> location button names

You can't just cut off a string like that. Its a utf8 string, and doing
that might cause invalid utf8 (and crashes). It also means you cut of at
MAX_SHORTNAME_LENGTH bytes, not chars. It might be far less characters,
if the char are more than 1 bytes each. Also, i'm pretty sure that it
does things even more wrong in complication scripts like arabic which is
right-to-left.

What you want to do is use the ellipsize functions in pango (like
pango_layout_set_ellipsize) that do all the complicated work for you.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a fiendish one-eyed dwarf on a mission from God. She's a radical gypsy 
lawyer with someone else's memories. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]