Minor bugs in GtkTable



I think there's 2 minor bugs in gtktable.c - 

gtk_table_attach():

There's no need to call expand_rows/cols() unless the new widget's
right/bottom attach is greater than ncols/rows.

  if (right_attach >= table->ncols)
	  gtk_table_expand_cols (table, right_attach);

  if (bottom_attach >= table->nrows)
	  gtk_table_expand_rows (table, bottom_attach);

should be?:

  if (right_attach > table->ncols)
	  gtk_table_expand_cols (table, right_attach);

  if (bottom_attach > table->nrows)
	  gtk_table_expand_rows (table, bottom_attach);

Though this doesn't cause any problems at present - its just redundant.



gtk_table_set_row_spacings() & gtk_table_set_col_spacings()

  for (row = 0; row < table->nrows - 1; row++)

should be?:

  for (row = 0; row < table->nrows; row++)

otherwise you don't set the last row. If the table is then expanded, the
spacing of this row/col will be incorrect (as happened to me in my font
selector widget on the filters page - before the 'Registry' column).


Damon

PS. The patch from 1.0.3 to 1.0.4 didn't work for me. I had 1.0.3 in
/usr/local/src/gtk+-1.0.3, did 'cd /usr/local/src' and
'patch < patch-1_0_3-1_0_4' and it left lots of files in /usr/local/src:
(I've got patch v2.1, the patch from 1.0.2 to 1.0.3 works OK)

-rw-r--r--   1 damon    users      169270 Jun  6 12:42 Makefile
-rw-r--r--   1 damon    users         944 Jun  6 12:42 libglib.la
-rw-r--r--   1 damon    users        2074 Jun  6 12:42 glibconfig.h
-rw-r--r--   1 damon    users       76554 Jun  6 12:42 libtool
-rw-r--r--   1 damon    users           0 Jun  6 12:42 libtool.orig
-rw-r--r--   1 damon    users          10 Jun  6 12:42 stamp-h
-rw-r--r--   1 damon    users           0 Jun  6 12:42 stamp-h.orig
-rw-r--r--   1 damon    users        2972 Jun  6 12:42 testglib
-rw-r--r--   1 damon    users           0 Jun  6 12:42 testglib.orig
-rw-r--r--   1 damon    users         932 Jun  6 12:42 libgtk.la
-rw-r--r--   1 damon    users         466 Jun  6 12:42 libgtk.la.orig
-rw-r--r--   1 damon    users        3242 Jun  6 12:42 simple
-rw-r--r--   1 damon    users           0 Jun  6 12:42 simple.orig
-rw-r--r--   1 damon    users        3248 Jun  6 12:42 testgtk
-rw-r--r--   1 damon    users           0 Jun  6 12:42 testgtk.orig
-rw-r--r--   1 damon    users        3260 Jun  6 12:42 testinput
-rw-r--r--   1 damon    users           0 Jun  6 12:42 testinput.orig
-rw-r--r--   1 damon    users        3284 Jun  6 12:42 testselection
-rw-r--r--   1 damon    users           0 Jun  6 12:42 testselection.orig
-rw-r--r--   1 damon    users      152073 Jun  6 12:42 Makefile.orig
-rw-r--r--   1 damon    users         992 Jun  6 12:42 libgdk.la
-rw-r--r--   1 damon    users         496 Jun  6 12:42 libgdk.la.orig
-rw-r--r--   1 damon    users         472 Jun  6 12:42 libglib.la.orig
-rw-r--r--   1 damon    users        4802 Jun  6 12:42 config.log
-rw-r--r--   1 damon    users           0 Jun  6 12:42 config.log.orig
-rw-r--r--   1 damon    users       12592 Jun  6 12:42 config.status
-rw-r--r--   1 damon    users           0 Jun  6 12:42 config.status.orig
-rw-r--r--   1 damon    users           0 Jun  6 12:42 glibconfig.h.orig





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