Re: [gnome-db] db grid ordering



On Sat, 2003-12-06 at 15:03, Rodrigo Moya wrote:
> > The db grid ordering doesn't work properly for integers, it orders them
> > as they were chars (this is the default behavior of GtkTreeView).
> > I saw that gda knows the field type.
> >
> hmm, sorting is implemented in gnome-db-model.c. So if it doesn't sort
> correctly, it looks like a bug to me.
It is. (libgda 1.1.0 here)
	if (gda_value_isa ((GdaValue *) valuea, GDA_VALUE_TYPE_NULL) &&
	    gda_value_isa ((GdaValue *) valueb, GDA_VALUE_TYPE_NULL))
		retval = 0;
	else if (gda_value_isa ((GdaValue *) valuea, GDA_VALUE_TYPE_BIGINT) &&
		 gda_value_isa ((GdaValue *) valueb, GDA_VALUE_TYPE_BIGINT)) {
		if (gda_value_get_bigint ((GdaValue *) valuea) >
		    gda_value_get_bigint ((GdaValue *) valueb))
			retval = -1;
	}
	else {
		gchar *stra, *strb;

		/* data types don't match, so use strings to sort */
...


it only checks for BIGINT, but I have an INTEGER (tested this in
libgda).
Let's see if I can provide a patch

-- 
Marius Andreiana
Galuna - Solutii Linux in Romania
http://www.galuna.ro




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]