mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-19 18:00:09 +00:00
Fixed GtkCellRendererText invalid pointer access.
Fixed get_desired_size() to not access parameters when NULL and also not to access priv->object if it hasnt yet been assigned.
This commit is contained in:
parent
0fbdb3c73f
commit
894e887370
@ -1946,25 +1946,43 @@ gtk_cell_renderer_text_extended_layout_get_desired_size (GtkExtendedLayout *layo
|
|||||||
|
|
||||||
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (layout);
|
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (layout);
|
||||||
|
|
||||||
if (minimal_size)
|
if (priv->owner)
|
||||||
{
|
{
|
||||||
get_size (GTK_CELL_RENDERER (layout),
|
|
||||||
priv->owner, NULL, NULL, NULL, NULL,
|
if (minimal_size)
|
||||||
&minimal_size->width, &minimal_size->height);
|
{
|
||||||
|
get_size (GTK_CELL_RENDERER (layout),
|
||||||
|
priv->owner, NULL, NULL, NULL, NULL,
|
||||||
|
&minimal_size->width, &minimal_size->height);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (desired_size)
|
||||||
|
{
|
||||||
|
PangoEllipsizeMode ellipsize;
|
||||||
|
|
||||||
|
ellipsize = priv->ellipsize;
|
||||||
|
priv->ellipsize = PANGO_ELLIPSIZE_NONE;
|
||||||
|
|
||||||
|
get_size (GTK_CELL_RENDERER (layout),
|
||||||
|
priv->owner, NULL, NULL, NULL, NULL,
|
||||||
|
&desired_size->width, &desired_size->height);
|
||||||
|
|
||||||
|
priv->ellipsize = ellipsize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (desired_size)
|
|
||||||
{
|
{
|
||||||
PangoEllipsizeMode ellipsize;
|
if (minimal_size)
|
||||||
|
{
|
||||||
|
minimal_size->height = 0;
|
||||||
|
minimal_size->width = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ellipsize = priv->ellipsize;
|
if (desired_size)
|
||||||
priv->ellipsize = PANGO_ELLIPSIZE_NONE;
|
{
|
||||||
|
desired_size->height = 0;
|
||||||
get_size (GTK_CELL_RENDERER (layout),
|
desired_size->width = 0;
|
||||||
priv->owner, NULL, NULL, NULL, NULL,
|
}
|
||||||
&desired_size->width, &desired_size->height);
|
|
||||||
|
|
||||||
priv->ellipsize = ellipsize;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user