[Gtk2] About bug 11523: analysis and proper fix(es)
Mattias Gaertner
nc-gaertnma at netcologne.de
Sun Jul 13 11:25:07 CEST 2008
On Sat, 12 Jul 2008 12:37:17 -0300
Luiz Americo Pereira Camara <luizmed at oi.com.br> wrote:
> The problem occurs because each device context instance has a text
> cache while the layout is shared between all device contexts that
> have the same font.
> [...]
> I implemented in three ways (see the patches):
>
> 1) Stores the OldFont (Pangolayout) and compare the Old/New strings
> using strcomp*
>
> Than i noticed that is not necessary to store the old font and comes
> with the 2nd implementation. There's also no more need to be a method
> of TGtk2DeviceContext.
>
> 2) Just compare the two strings using StrComp*
>
> * Is better to use StrLComp instead of StrComp
>
> But i lost the shortcut evaluation of length that prevents a string
> comparation. So...
>
> 3) Stores the old length in the layout object using a gquark* and
> compare both strings with comparebytes (i know that both strings are
> the same size)
>
> ** The old length can be also stored in a field of font GdiObject
I committed 2 in r15758.
Mattias
More information about the Gtk2
mailing list