sizerequest: Only check reported baselines if requested

If the passed-in store locations for the baselines are NULL anyway, we
don't need to check the reported baselines for correctness.
This commit is contained in:
Timm Bäder 2018-07-15 17:56:11 +02:00
parent 392b4d9ac5
commit cf7fa931d3

View File

@ -129,6 +129,7 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
gint *minimum_baseline,
gint *natural_baseline)
{
const gboolean baselines_requested = (minimum_baseline != NULL || natural_baseline != NULL);
SizeRequestCache *cache;
gint min_size = 0;
gint nat_size = 0;
@ -291,7 +292,7 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
nat_size = adjusted_natural;
}
if (min_baseline != -1 || nat_baseline != -1)
if (baselines_requested && (min_baseline != -1 || nat_baseline != -1))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{