Kaydet (Commit) cc3661c5 authored tarafından Caolán McNamara's avatar Caolán McNamara

gtk takes care of the ordering itself

Change-Id: I5d77a3dddeb5524bfef13a4871ffc5bb6be6cae0
Reviewed-on: https://gerrit.libreoffice.org/64902
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 080fa0aa
...@@ -4703,17 +4703,14 @@ namespace ...@@ -4703,17 +4703,14 @@ namespace
gchar* pName2; gchar* pName2;
GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(pModel); GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(pModel);
gint sort_column_id(0); gint sort_column_id(0);
GtkSortType order(GTK_SORT_ASCENDING); gtk_tree_sortable_get_sort_column_id(pSortable, &sort_column_id, nullptr);
gtk_tree_sortable_get_sort_column_id(pSortable, &sort_column_id, &order);
gtk_tree_model_get(pModel, a, sort_column_id, &pName1, -1); gtk_tree_model_get(pModel, a, sort_column_id, &pName1, -1);
gtk_tree_model_get(pModel, b, sort_column_id, &pName2, -1); gtk_tree_model_get(pModel, b, sort_column_id, &pName2, -1);
gint ret = pSorter->compare(OUString(pName1, strlen(pName1), RTL_TEXTENCODING_UTF8), gint ret = pSorter->compare(OUString(pName1, strlen(pName1), RTL_TEXTENCODING_UTF8),
OUString(pName2, strlen(pName2), RTL_TEXTENCODING_UTF8)); OUString(pName2, strlen(pName2), RTL_TEXTENCODING_UTF8));
g_free(pName1); g_free(pName1);
g_free(pName2); g_free(pName2);
if (ret == 0) return ret;
return ret;
return order == GTK_SORT_ASCENDING ? ret : -ret;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment