Merged wxRichTextAttr and wxTextAttrEx into wxTextAttr, and added a font table
to wxRichTextBuffer to reduce wxFont consumption and increase performance. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,8 +55,21 @@ static void wxGtkTextInsert(GtkWidget *text,
|
||||
const char *txt,
|
||||
size_t len)
|
||||
{
|
||||
GdkFont *font = attr.HasFont() ? attr.GetFont().GetInternalFont()
|
||||
: NULL;
|
||||
wxFont tmpFont;
|
||||
GdkFont *font;
|
||||
if (attr.HasFont())
|
||||
{
|
||||
tmpFont = attr.GetFont();
|
||||
|
||||
// FIXME: if this crashes because tmpFont goes out of scope and the GdkFont is
|
||||
// deleted, then we need to call gdk_font_ref on font.
|
||||
// This is because attr.GetFont() now returns a temporary font since wxTextAttr
|
||||
// no longer stores a wxFont object, for efficiency.
|
||||
|
||||
font = tmpFont.GetInternalFont();
|
||||
}
|
||||
else
|
||||
font = NULL;
|
||||
|
||||
GdkColor *colFg = attr.HasTextColour() ? attr.GetTextColour().GetColor()
|
||||
: NULL;
|
||||
|
Reference in New Issue
Block a user