Index: src/htmlengine-edit-table.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine-edit-table.c,v
retrieving revision 1.56
diff -u -4 -r1.56 htmlengine-edit-table.c
--- src/htmlengine-edit-table.c	7 Oct 2002 10:02:23 -0000	1.56
+++ src/htmlengine-edit-table.c	13 Dec 2002 05:52:22 -0000
@@ -35,11 +35,11 @@
 #include "htmltablecell.h"
 #include "htmltablepriv.h"
 #include "htmlundo.h"
 
-static void delete_table_column (HTMLEngine *e, HTMLUndoDirection dir);
+static gboolean delete_table_column (HTMLEngine *e, HTMLUndoDirection dir);
 static void insert_table_column (HTMLEngine *e, gboolean after, HTMLTableCell **column_cells, HTMLUndoDirection dir);
-static void delete_table_row    (HTMLEngine *e, HTMLUndoDirection dir);
+static gboolean delete_table_row    (HTMLEngine *e, HTMLUndoDirection dir);
 static void insert_table_row    (HTMLEngine *e, gboolean after, HTMLTableCell **row_cells, HTMLUndoDirection dir);
 
 HTMLTable *
 html_engine_get_table (HTMLEngine *e)
@@ -235,16 +235,18 @@
  *
  * Inserts new column into table after/before current column.
  **/
 
-void
+gboolean
 html_engine_insert_table_column (HTMLEngine *e, gboolean after)
 {
 	HTMLObject *cell;
 
 	cell = html_object_nth_parent (e->cursor->object, 2);
-	if (cell && HTML_IS_TABLE_CELL (cell))
+	if (cell && HTML_IS_TABLE_CELL (cell)) {
 		insert_table_column (e, HTML_TABLE_CELL (cell)->col + (after ? 1 : 0), NULL, HTML_UNDO_UNDO);
+		return TRUE;
+	} else return FALSE;
 }
 
 /*
  * Delete column
@@ -304,9 +306,9 @@
 						    html_cursor_get_position (e->cursor),
 						    position_before), dir);
 }
 
-static void
+static gboolean
 delete_table_column (HTMLEngine *e, HTMLUndoDirection dir)
 {
 	HTMLTable *t;
 	HTMLTableCell *cell;
@@ -317,9 +319,9 @@
 	t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
 
 	/* this command is valid only in table and when this table has > 1 column */
 	if (!t || !HTML_IS_TABLE (HTML_OBJECT (t)) || t->totalCols < 2)
-		return;
+		return FALSE;
 
 	html_engine_freeze (e);
 
 	position_before = e->cursor->position;
@@ -354,8 +356,9 @@
 
 	html_object_change_set (HTML_OBJECT (t), HTML_CHANGE_ALL_CALC);
 	html_engine_queue_draw (e, HTML_OBJECT (t));
 	html_engine_thaw (e);
+	return TRUE;
 }
 
 /**
  * html_engine_delete_table_column:
@@ -363,12 +366,12 @@
  *
  * Deletes current table column.
  **/
 
-void
+gboolean
 html_engine_delete_table_column (HTMLEngine *e)
 {
-	delete_table_column (e, HTML_UNDO_UNDO);
+	return delete_table_column (e, HTML_UNDO_UNDO);
 }
 
 /*
  *  Insert Row
@@ -446,16 +449,18 @@
  *
  * Inserts new row into table after/before current row.
  **/
 
-void
+gboolean
 html_engine_insert_table_row (HTMLEngine *e, gboolean after)
 {
 	HTMLObject *cell;
 
 	cell = html_object_nth_parent (e->cursor->object, 2);
-	if (cell && HTML_IS_TABLE_CELL (cell))
+	if (cell && HTML_IS_TABLE_CELL (cell)) {
 		insert_table_row (e, HTML_TABLE_CELL (cell)->row + (after ? 1 : 0), NULL, HTML_UNDO_UNDO);
+		return TRUE;
+	} else return FALSE;
 }
 
 /*
  * Delete row
@@ -480,9 +485,9 @@
 						    html_cursor_get_position (e->cursor),
 						    position_before), dir);
 }
 
-static void
+static gboolean
 delete_table_row (HTMLEngine *e, HTMLUndoDirection dir)
 {
 	HTMLTable *t;
 	HTMLTableCell *cell;
@@ -493,9 +498,9 @@
 	t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
 
 	/* this command is valid only in table and when this table has > 1 row */
 	if (!t || !HTML_IS_TABLE (HTML_OBJECT (t)) || t->totalRows < 2)
-		return;
+		return FALSE;
 
 	html_engine_freeze (e);
 
 	position_before = e->cursor->position;
@@ -530,8 +535,9 @@
 	delete_row_setup_undo (e, row_cells, t->totalCols, position_before, row, dir);
 	html_object_change_set (HTML_OBJECT (t), HTML_CHANGE_ALL_CALC);
 	html_engine_queue_draw (e, HTML_OBJECT (t));
 	html_engine_thaw (e);
+	return TRUE;
 }
 
 /**
  * html_engine_delete_table_row:
@@ -539,12 +545,12 @@
  *
  * Deletes current table row.
  **/
 
-void
+gboolean
 html_engine_delete_table_row (HTMLEngine *e)
 {
-	delete_table_row (e, HTML_UNDO_UNDO);
+	return delete_table_row (e, HTML_UNDO_UNDO);
 }
 
 typedef enum {
 	HTML_TABLE_BORDER,
@@ -1069,13 +1075,13 @@
 
 	if (table->totalCols < cols) {
 		html_engine_table_goto_col (e, table->totalCols - 1);
 		while (table->totalCols < cols)
-			html_engine_insert_table_column (e, TRUE);
+			if (!html_engine_insert_table_column (e, TRUE)) break;
 	} else {
 		html_engine_table_goto_col (e, table->totalCols - 1);
 		while (table->totalCols > cols)
-			html_engine_delete_table_column (e);
+			if (!html_engine_delete_table_column (e)) break;
 	}
 
 	/*
 	  FIXME: jump to some well defined position (like the same position as before
@@ -1100,13 +1106,13 @@
 
 	if (table->totalRows < rows) {
 		html_engine_table_goto_row (e, table->totalRows - 1);
 		while (table->totalRows < rows)
-			html_engine_insert_table_row (e, TRUE);
+			if (!html_engine_insert_table_row (e, TRUE)) break;
 	} else {
 		html_engine_table_goto_row (e, table->totalRows - 1);
 		while (table->totalRows > rows)
-			html_engine_delete_table_row (e);
+			if(!html_engine_delete_table_row (e)) break;
 	}
 
 	/*
 	  FIXME: like set_cols
Index: src/htmlengine-edit-table.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine-edit-table.h,v
retrieving revision 1.20
diff -u -4 -r1.20 htmlengine-edit-table.h
--- src/htmlengine-edit-table.h	16 Oct 2001 21:19:04 -0000	1.20
+++ src/htmlengine-edit-table.h	13 Dec 2002 05:52:22 -0000
@@ -35,14 +35,14 @@
 						    gint            padding,
 						    gint            spacing,
 						    gint            border);
 void           html_engine_insert_table_1_1        (HTMLEngine     *e);
-void           html_engine_insert_table_column     (HTMLEngine     *e,
+gboolean           html_engine_insert_table_column     (HTMLEngine     *e,
 						    gboolean        after);
-void           html_engine_delete_table_column     (HTMLEngine     *e);
-void           html_engine_insert_table_row        (HTMLEngine     *e,
+gboolean           html_engine_delete_table_column     (HTMLEngine     *e);
+gboolean           html_engine_insert_table_row        (HTMLEngine     *e,
 						    gboolean        after);
-void           html_engine_delete_table_row        (HTMLEngine     *e);
+gboolean           html_engine_delete_table_row        (HTMLEngine     *e);
 void           html_engine_table_set_border_width  (HTMLEngine     *e,
 						    HTMLTable      *t,
 						    gint            border_width,
 						    gboolean        relative);
