gdi32: Make the family replacement point to the family object.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d27a9d77ee
commit
74ea8d8c42
|
@ -517,7 +517,7 @@ struct gdi_font_family *create_family( const WCHAR *name, const WCHAR *second_na
|
|||
}
|
||||
else family->second_name[0] = 0;
|
||||
list_init( &family->faces );
|
||||
family->replacement = &family->faces;
|
||||
family->replacement = NULL;
|
||||
list_add_tail( &font_list, &family->entry );
|
||||
return family;
|
||||
}
|
||||
|
@ -527,6 +527,7 @@ void release_family( struct gdi_font_family *family )
|
|||
if (--family->refcount) return;
|
||||
assert( list_empty( &family->faces ));
|
||||
list_remove( &family->entry );
|
||||
if (family->replacement) release_family( family->replacement );
|
||||
HeapFree( GetProcessHeap(), 0, family );
|
||||
}
|
||||
|
||||
|
@ -564,7 +565,8 @@ static BOOL add_family_replacement( const WCHAR *new_name, const WCHAR *replace
|
|||
}
|
||||
|
||||
if (!(new_family = create_family( new_name, NULL ))) return FALSE;
|
||||
new_family->replacement = &family->faces;
|
||||
new_family->replacement = family;
|
||||
family->refcount++;
|
||||
TRACE( "mapping %s to %s\n", debugstr_w(replace), debugstr_w(new_name) );
|
||||
|
||||
/* also add replacement for vertical font if necessary */
|
||||
|
|
|
@ -662,10 +662,8 @@ static BOOL is_subpixel_rendering_enabled( void )
|
|||
|
||||
static const struct list *get_face_list_from_family(const Family *family)
|
||||
{
|
||||
if (!list_empty(&family->faces))
|
||||
if (family->replacement) return &family->replacement->faces;
|
||||
return &family->faces;
|
||||
else
|
||||
return family->replacement;
|
||||
}
|
||||
|
||||
static Face *find_face_from_filename(const WCHAR *file_name, const WCHAR *face_name)
|
||||
|
|
|
@ -312,7 +312,7 @@ struct gdi_font_family
|
|||
WCHAR family_name[LF_FACESIZE];
|
||||
WCHAR second_name[LF_FACESIZE];
|
||||
struct list faces;
|
||||
struct list *replacement;
|
||||
struct gdi_font_family *replacement;
|
||||
};
|
||||
|
||||
struct bitmap_font_size
|
||||
|
|
Loading…
Reference in New Issue