From 94f6d11e3d067fba855dce83429decd2264039f2 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Wed, 22 Sep 2021 20:21:13 +0800 Subject: [PATCH] [gnc-budget-view] initialize totals_col_list in reverse b2b879211 had modified totals_cols_list from g_list_append to g_list_prepend and g_list_reverse. this assumed that it was already initialized in reverse. this commit fixes it to ensure gnc_budget_view_refresh is processing the reversed totals_col_list. --- gnucash/gnome/gnc-budget-view.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c index 58575115e7..0516ff0542 100644 --- a/gnucash/gnome/gnc-budget-view.c +++ b/gnucash/gnome/gnc-budget-view.c @@ -1581,7 +1581,7 @@ gnc_budget_view_refresh (GncBudgetView *budget_view) num_periods = gnc_budget_get_num_periods (priv->budget); col_list = priv->period_col_list; - totals_col_list = priv->totals_col_list; + totals_col_list = g_list_reverse (priv->totals_col_list); num_periods_visible = g_list_length (col_list); /* Hide any unneeded extra columns */ @@ -1592,9 +1592,9 @@ gnc_budget_view_refresh (GncBudgetView *budget_view) col_list = g_list_delete_link (col_list, g_list_last (col_list)); num_periods_visible = g_list_length (col_list); - col = GTK_TREE_VIEW_COLUMN((g_list_last (totals_col_list))->data); + col = GTK_TREE_VIEW_COLUMN(totals_col_list->data); gtk_tree_view_remove_column (GTK_TREE_VIEW(priv->totals_tree_view), col); - totals_col_list = g_list_delete_link (totals_col_list, g_list_last (totals_col_list)); + totals_col_list = g_list_delete_link (totals_col_list, totals_col_list); } gnc_tree_view_configure_columns (GNC_TREE_VIEW(priv->tree_view));