Index: components/html-editor/popup.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/popup.c,v
retrieving revision 1.62
diff -u -4 -r1.62 popup.c
--- components/html-editor/popup.c	2 Oct 2002 17:11:34 -0000	1.62
+++ components/html-editor/popup.c	21 Dec 2002 08:49:04 -0000
@@ -230,8 +230,15 @@
 								   rule_properties,
 								   rule_apply_cb,
 								   rule_close_cb);
 			break;
+		case GTK_HTML_EDIT_PROPERTY_TABLE_SELF:
+			gtk_html_edit_properties_dialog_add_entry (cd->properties_dialog,
+								   t, _("Table"),
+								   table_properties_2,
+								   table_apply_cb,
+								   table_close_cb);
+			break;
 		case GTK_HTML_EDIT_PROPERTY_TABLE:
 			gtk_html_edit_properties_dialog_add_entry (cd->properties_dialog,
 								   t, _("Table"),
 								   table_properties,
@@ -496,9 +503,9 @@
 			ADD_PROP (PARAGRAPH);
 			break;
 		case HTML_TYPE_TABLE:
 			ADD_SEP;
-			ADD_PROP (TABLE);
+			ADD_PROP (TABLE_SELF);
 			ADD_ITEM (_("Table..."), prop_dialog, TABLE);
 		default:
 		}
 		if (obj->parent && obj->parent->parent && HTML_IS_TABLE_CELL (obj->parent->parent)) {
Index: components/html-editor/properties.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/properties.h,v
retrieving revision 1.12
diff -u -4 -r1.12 properties.h
--- components/html-editor/properties.h	2 Oct 2002 17:11:34 -0000	1.12
+++ components/html-editor/properties.h	21 Dec 2002 08:49:04 -0000
@@ -38,8 +38,9 @@
 	GTK_HTML_EDIT_PROPERTY_LINK,
 	GTK_HTML_EDIT_PROPERTY_BODY,
 	GTK_HTML_EDIT_PROPERTY_RULE,
 	GTK_HTML_EDIT_PROPERTY_TABLE,
+	GTK_HTML_EDIT_PROPERTY_TABLE_SELF, /* It is a table */
 	GTK_HTML_EDIT_PROPERTY_CELL,
 };
 
 GtkHTMLEditPropertiesDialog * gtk_html_edit_properties_dialog_new          (GtkHTMLControlData *cd,
Index: components/html-editor/table.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/table.c,v
retrieving revision 1.35
diff -u -4 -r1.35 table.c
--- components/html-editor/table.c	16 Oct 2001 21:19:19 -0000	1.35
+++ components/html-editor/table.c	21 Dec 2002 08:49:10 -0000
@@ -96,8 +96,9 @@
 	GtkWidget *option_template;
 
 	gboolean   disable_change;
 	gboolean   insert;
+	gboolean   self;
 } GtkHTMLEditTableProperties;
 
 static void set_insert_ui (GtkHTMLEditTableProperties *d);
 
@@ -711,13 +712,18 @@
 	FILL;
 }
 
 static void
-get_data (GtkHTMLEditTableProperties *d)
+get_data (GtkHTMLEditTableProperties *d, gboolean flag)
 {
-	d->table = html_engine_get_table (d->cd->html->engine);
+	if (flag)
+		d->table = html_engine_get_table_2 (d->cd->html->engine, TRUE);
+	else
+		d->table = html_engine_get_table_2 (d->cd->html->engine, FALSE);
 	g_return_if_fail (d->table);
 
+	if (flag) d->self = TRUE;
+
 	if (d->table->bgColor) {
 		d->has_bg_color = TRUE;
 		d->bg_color     = *d->table->bgColor;
 	}
@@ -756,10 +762,25 @@
 table_properties (GtkHTMLControlData *cd, gpointer *set_data)
 {
 	GtkHTMLEditTableProperties *data = data_new (cd);
 	GtkWidget *rv;
+	gboolean flag;
+
+	get_data (data, FALSE);
+	*set_data = data;
+	rv        = table_widget (data);
+	set_ui (data);
+
+	return rv;
+}
+
+GtkWidget *
+table_properties_2 (GtkHTMLControlData *cd, gpointer *set_data)
+{
+	GtkHTMLEditTableProperties *data = data_new (cd);
+	GtkWidget *rv;
 
-	get_data (data);
+	get_data (data, TRUE);
 	*set_data = data;
 	rv        = table_widget (data);
 	set_ui (data);
 
@@ -833,13 +854,13 @@
 					     d->has_width ? d->width : 0, d->has_width ? d->width_percent : FALSE);
 		d->changed_width = FALSE;
 	}
 	if (d->changed_cols) {
-		html_engine_table_set_cols (d->cd->html->engine, d->cols);
+		html_engine_table_set_cols_2 (d->cd->html->engine, d->cols, d->self);
 		d->changed_cols = FALSE;
 	}
 	if (d->changed_rows) {
-		html_engine_table_set_rows (d->cd->html->engine, d->rows);
+		html_engine_table_set_rows_2 (d->cd->html->engine, d->rows, d->self);
 		d->changed_rows = FALSE;
 	}
 }
 
Index: components/html-editor/table.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/table.h,v
retrieving revision 1.2
diff -u -4 -r1.2 table.h
--- components/html-editor/table.h	15 May 2001 16:53:13 -0000	1.2
+++ components/html-editor/table.h	21 Dec 2002 08:49:10 -0000
@@ -26,8 +26,9 @@
 #include <gnome.h>
 #include "control-data.h"
 
 GtkWidget             * table_properties      (GtkHTMLControlData *cd, gpointer *set_data);
+GtkWidget             * table_properties_2      (GtkHTMLControlData *cd, gpointer *set_data);
 GtkWidget             * table_insert          (GtkHTMLControlData *cd, gpointer *set_data);
 void                    table_insert_cb       (GtkHTMLControlData *cd, gpointer  get_data);
 void                    table_apply_cb        (GtkHTMLControlData *cd, gpointer  get_data);
 void                    table_close_cb        (GtkHTMLControlData *cd, gpointer  get_data);
Index: po/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/po/ChangeLog,v
retrieving revision 1.270.2.2
diff -u -4 -r1.270.2.2 ChangeLog
--- po/ChangeLog	13 Nov 2002 12:38:04 -0000	1.270.2.2
+++ po/ChangeLog	21 Dec 2002 08:49:16 -0000
@@ -1,4 +1,8 @@
+2002-12-13  gettextize  <bug-gnu-utils@gnu.org>
+
+	* Makefile.in.in: Upgrade to gettext-0.10.38.
+
 2002-11-13  Gustavo Maciel Dias Vieira <gdvieira@zaz.com.br>
 
 	* pt_BR.po: Updated Brazilian Portuguese translation done by
 	Gustavo Maciel Dias Vieira <gdvieira@zaz.com.br>.
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	21 Dec 2002 08:49:20 -0000
@@ -35,12 +35,12 @@
 #include "htmltablecell.h"
 #include "htmltablepriv.h"
 #include "htmlundo.h"
 
-static void 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 void insert_table_row    (HTMLEngine *e, gboolean after, HTMLTableCell **row_cells, HTMLUndoDirection dir);
+static void delete_table_column (HTMLEngine *e, HTMLUndoDirection dir, int col,  gboolean self);
+static void insert_table_column (HTMLEngine *e, gboolean after, HTMLTableCell **column_cells, HTMLUndoDirection dir, gboolean self);
+static void delete_table_row    (HTMLEngine *e, HTMLUndoDirection dir, int row, gboolean self);
+static void insert_table_row    (HTMLEngine *e, gboolean after, HTMLTableCell **row_cells, HTMLUndoDirection dir, gboolean self);
 
 HTMLTable *
 html_engine_get_table (HTMLEngine *e)
 {
@@ -55,8 +55,27 @@
 	else
 		return HTML_TABLE (e->cursor->object->parent->parent->parent);
 }
 
+HTMLTable *
+html_engine_get_table_2(HTMLEngine *e, gboolean flag)
+{
+	if (flag) {
+		if (HTML_IS_TABLE (e->cursor->object))
+			return HTML_TABLE (e->cursor->object);
+		return NULL;
+	}
+
+	if (!e->cursor->object->parent
+	         || !e->cursor->object->parent->parent
+		 || !e->cursor->object->parent->parent->parent)
+		return NULL;
+	else if (!HTML_IS_TABLE (e->cursor->object->parent->parent->parent))
+		return NULL;
+	else
+		return HTML_TABLE (e->cursor->object->parent->parent->parent);
+}
+
 HTMLTableCell *
 html_engine_new_cell (HTMLEngine *e, HTMLTable *table)
 {
 	HTMLObject    *cell;
@@ -134,9 +153,9 @@
 
 static void
 insert_column_undo_action (HTMLEngine *e, HTMLUndoData *data, HTMLUndoDirection dir, guint position_after)
 {
-	delete_table_column (e, html_undo_direction_reverse (dir));
+	delete_table_column (e, html_undo_direction_reverse (dir), 0, FALSE);
 }
 
 static void
 insert_column_setup_undo (HTMLEngine *e, guint position_before, HTMLUndoDirection dir)
@@ -179,23 +198,28 @@
 	} while (html_cursor_forward (e->cursor, e));
 }
 
 static void
-insert_table_column (HTMLEngine *e, gint col, HTMLTableCell **column, HTMLUndoDirection dir)
+insert_table_column (HTMLEngine *e, gint col, HTMLTableCell **column, HTMLUndoDirection dir, gboolean self)
 {
 	HTMLTable *t;
 	HTMLTableCell *cell;
 	gint c, r;
 	guint position_before;
 
-	t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
+	if (!self)
+		t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
+	else 
+		t = HTML_TABLE (e->cursor->object);
+
 	if (!t)
 		return;
 
 	html_engine_freeze (e);
 
 	position_before = e->cursor->position;
-	go_table_0 (e, HTML_OBJECT (t));
+	if (!self)
+		go_table_0 (e, HTML_OBJECT (t));
 
 	html_table_alloc_cell (t, 0, t->totalCols);
 	for (r = 0; r < t->totalRows; r ++) {
 		for (c = t->totalCols - 1; c >= col; c --) {
@@ -219,9 +243,11 @@
 			html_table_cell_set_position (t->cells [r][col], r, col);
 		}
 	}
 
-	go_after_col (e, HTML_OBJECT (t), col);
+	/* If the table itself is selected, do need to move cursor. */
+	if (!self)
+		go_after_col (e, HTML_OBJECT (t), col);
 	insert_column_setup_undo (e, position_before, dir);
 	html_object_change_set (HTML_OBJECT (t), HTML_CHANGE_ALL_CALC);
 	html_engine_queue_draw (e, HTML_OBJECT (t));
 	html_engine_thaw (e);
@@ -242,9 +268,15 @@
 	HTMLObject *cell;
 
 	cell = html_object_nth_parent (e->cursor->object, 2);
 	if (cell && HTML_IS_TABLE_CELL (cell))
-		insert_table_column (e, HTML_TABLE_CELL (cell)->col + (after ? 1 : 0), NULL, HTML_UNDO_UNDO);
+		insert_table_column (e, HTML_TABLE_CELL (cell)->col + (after ? 1 : 0), NULL, HTML_UNDO_UNDO, FALSE);
+}
+
+void
+html_engine_insert_table_column_2(HTMLEngine *e, int col, gboolean after)
+{
+	insert_table_column (e, col + (after ? 1 : 0), NULL, HTML_UNDO_UNDO, TRUE);
 }
 
 /*
  * Delete column
@@ -291,9 +323,9 @@
 {
 	DeleteCellsUndo *data = (DeleteCellsUndo *) undo_data;
 
 	g_assert (data->size == HTML_TABLE (html_object_nth_parent (e->cursor->object, 3))->totalRows);
-	insert_table_column (e, data->pos, data->cells, html_undo_direction_reverse (dir));
+	insert_table_column (e, data->pos, data->cells, html_undo_direction_reverse (dir), FALSE);
 }
 
 static void
 delete_column_setup_undo (HTMLEngine *e, HTMLTableCell **column, gint size, guint position_before, gint col, HTMLUndoDirection dir)
@@ -305,30 +337,39 @@
 						    position_before), dir);
 }
 
 static void
-delete_table_column (HTMLEngine *e, HTMLUndoDirection dir)
+delete_table_column (HTMLEngine *e, HTMLUndoDirection dir, int del_col, gboolean self)
 {
 	HTMLTable *t;
 	HTMLTableCell *cell;
 	HTMLTableCell **column;
 	gint r, c, col;
 	guint position_before;
 
-	t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
+	if (self)
+		t = HTML_TABLE(e->cursor->object);
+	else
+		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;
 
 	html_engine_freeze (e);
 
 	position_before = e->cursor->position;
-	cell   = HTML_TABLE_CELL (html_object_nth_parent (e->cursor->object, 2));
-	col    = cell->col;
+	if (!self) {
+		cell = HTML_TABLE_CELL (html_object_nth_parent (e->cursor->object, 2));
+		col = cell->col;
+	} else {
+		col = del_col;
+	}
+
 	column = g_new0 (HTMLTableCell *, t->totalRows);
 
-	go_table_0 (e, HTML_OBJECT (t));
+	if (!self)
+		go_table_0 (e, HTML_OBJECT (t));
 	for (r = 0; r < t->totalRows; r ++) {
 		cell = t->cells [r][col];
 
 		/* remove & keep old one */
@@ -347,9 +388,11 @@
 				t->cells [r][c]     = NULL;
 			}
 		}
 	}
-	go_after_col (e, HTML_OBJECT (t), MIN (col, t->totalCols - 1));
+	
+	if (!self)
+		go_after_col (e, HTML_OBJECT (t), MIN (col, t->totalCols - 1));
 	delete_column_setup_undo (e, column, t->totalRows, position_before, col, dir);
 	t->totalCols --;
 
 	html_object_change_set (HTML_OBJECT (t), HTML_CHANGE_ALL_CALC);
@@ -366,9 +409,15 @@
 
 void
 html_engine_delete_table_column (HTMLEngine *e)
 {
-	delete_table_column (e, HTML_UNDO_UNDO);
+	delete_table_column (e, HTML_UNDO_UNDO, 0 , FALSE);
+}
+
+void
+html_engine_delete_table_column_2 (HTMLEngine *e, int col)
+{
+	delete_table_column (e, HTML_UNDO_UNDO, col, TRUE);
 }
 
 /*
  *  Insert Row
@@ -376,9 +425,9 @@
 
 static void
 insert_row_undo_action (HTMLEngine *e, HTMLUndoData *data, HTMLUndoDirection dir, guint position_after)
 {
-	delete_table_row (e, html_undo_direction_reverse (dir));
+	delete_table_row (e, html_undo_direction_reverse (dir), 0 , FALSE);
 }
 
 static void
 insert_row_setup_undo (HTMLEngine *e, guint position_before, HTMLUndoDirection dir)
@@ -391,22 +440,27 @@
 			      dir);
 }
 
 static void
-insert_table_row (HTMLEngine *e, gint row, HTMLTableCell **row_cells, HTMLUndoDirection dir)
+insert_table_row (HTMLEngine *e, gint row, HTMLTableCell **row_cells, HTMLUndoDirection dir, gboolean self)
 {
 	HTMLTable *t;
 	HTMLTableCell *cell;
 	gint r, c;
 	guint position_before;
 
-	t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
+	if(!self)
+		t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
+	else 
+		t = HTML_TABLE (e->cursor->object);
+
 	if (!t)
 		return;
 
 	html_engine_freeze (e);
 	position_before = e->cursor->position;
-	go_table_0 (e, HTML_OBJECT (t));
+	if (!self)
+		go_table_0 (e, HTML_OBJECT (t));
 
 	html_table_alloc_cell (t, t->totalRows, 0);
 	for (c = 0; c < t->totalCols; c ++) {
 		for (r = t->totalRows; r > row; r --) {
@@ -430,9 +484,10 @@
 			html_table_cell_set_position (t->cells [row][c], row, c);
 		}
 	}
 
-	go_after_row (e, HTML_OBJECT (t), row);
+	if (!self)
+		go_after_row (e, HTML_OBJECT (t), row);
 	insert_row_setup_undo (e, position_before, dir);
 	html_object_change_set (HTML_OBJECT (t), HTML_CHANGE_ALL_CALC);
 	html_engine_queue_draw (e, HTML_OBJECT (t));
 	html_engine_thaw (e);
@@ -453,9 +508,15 @@
 	HTMLObject *cell;
 
 	cell = html_object_nth_parent (e->cursor->object, 2);
 	if (cell && HTML_IS_TABLE_CELL (cell))
-		insert_table_row (e, HTML_TABLE_CELL (cell)->row + (after ? 1 : 0), NULL, HTML_UNDO_UNDO);
+		insert_table_row (e, HTML_TABLE_CELL (cell)->row + (after ? 1 : 0), NULL, HTML_UNDO_UNDO, FALSE);
+}
+
+void
+html_engine_insert_table_row_2 (HTMLEngine *e, int row, gboolean after)
+{
+	insert_table_row (e, row + (after ? 1 : 0), NULL, HTML_UNDO_UNDO, TRUE);
 }
 
 /*
  * Delete row
@@ -466,9 +527,9 @@
 {
 	DeleteCellsUndo *data = (DeleteCellsUndo *) undo_data;
 
 	g_assert (data->size == HTML_TABLE (html_object_nth_parent (e->cursor->object, 3))->totalCols);
-	insert_table_row (e, data->pos, data->cells, html_undo_direction_reverse (dir));
+	insert_table_row (e, data->pos, data->cells, html_undo_direction_reverse (dir), FALSE);
 }
 
 static void
 delete_row_setup_undo (HTMLEngine *e, HTMLTableCell **row_cells, gint size, guint position_before,
@@ -481,30 +542,37 @@
 						    position_before), dir);
 }
 
 static void
-delete_table_row (HTMLEngine *e, HTMLUndoDirection dir)
+delete_table_row (HTMLEngine *e, HTMLUndoDirection dir, int del_row, gboolean self)
 {
 	HTMLTable *t;
 	HTMLTableCell *cell;
 	HTMLTableCell **row_cells;
 	gint r, c, row;
 	guint position_before;
 
-	t = HTML_TABLE (html_object_nth_parent (e->cursor->object, 3));
+	if (self)
+		t = HTML_TABLE (e->cursor->object);
+	else 
+		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;
 
 	html_engine_freeze (e);
 
 	position_before = e->cursor->position;
-	cell      = HTML_TABLE_CELL (html_object_nth_parent (e->cursor->object, 2));
-	row       = cell->row;
+	if (!self) {
+		cell = HTML_TABLE_CELL (html_object_nth_parent (e->cursor->object, 2));
+		row = cell->row;
+	} else 
+		row = del_row;
 	row_cells = g_new0 (HTMLTableCell *, t->totalCols);
 
-	go_table_0 (e, HTML_OBJECT (t));
+	if (!self)
+		go_table_0 (e, HTML_OBJECT (t));
 	for (c = 0; c < t->totalCols; c ++) {
 		cell = t->cells [row][c];
 
 		/* remove & keep old one */
@@ -524,9 +592,10 @@
 			}
 		}
 	}
 
-	go_after_row (e, HTML_OBJECT (t), MIN (row, t->totalCols - 1));
+	if (!self)
+		go_after_row (e, HTML_OBJECT (t), MIN (row, t->totalCols - 1));
 	t->totalRows --;
 	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));
@@ -542,9 +611,15 @@
 
 void
 html_engine_delete_table_row (HTMLEngine *e)
 {
-	delete_table_row (e, HTML_UNDO_UNDO);
+	delete_table_row (e, HTML_UNDO_UNDO, 0, FALSE);
+}
+
+void
+html_engine_delete_table_row_2 (HTMLEngine *e, int row)
+{
+	delete_table_row (e, HTML_UNDO_UNDO, row, TRUE);
 }
 
 typedef enum {
 	HTML_TABLE_BORDER,
@@ -1082,8 +1157,47 @@
 	  or at beginning of 1st new column or to last position in remaining cells
 	*/
 }
 
+void
+html_engine_table_set_cols_2 (HTMLEngine *e, gint cols, gboolean self)
+{
+	HTMLTable *table;
+
+        if (self)
+		table = html_engine_get_table_2 (e, TRUE);
+	else 
+		table = html_engine_get_table_2 (e, FALSE);
+
+	if (!table)
+		return;
+
+	if (table->totalCols == cols)
+		return;
+
+	/* Orignal code actually assume table is the parent, not self. */
+	if (self) {
+		if (table->totalCols < cols) {
+			while (table->totalCols < cols)
+				html_engine_insert_table_column_2 (e, table->totalCols-1, TRUE);
+		} else {
+			while (table->totalCols > cols)
+				html_engine_delete_table_column_2 (e, table->totalCols-1);
+		}
+		return;
+	}
+
+	if (table->totalCols < cols) {
+		html_engine_table_goto_col (e, table->totalCols - 1);
+		while (table->totalCols < cols)
+			html_engine_insert_table_column (e, TRUE);
+	} else {
+		html_engine_table_goto_col (e, table->totalCols - 1);
+		while (table->totalCols > cols)
+			html_engine_delete_table_column (e);
+	}
+}
+
 /*
  * set number of rows in current table
  */
 
@@ -1110,8 +1224,47 @@
 
 	/*
 	  FIXME: like set_cols
 	*/
+}
+
+void
+html_engine_table_set_rows_2 (HTMLEngine *e, gint rows, gboolean self)
+{
+	HTMLTable *table;
+
+        if (self)
+		table = html_engine_get_table_2 (e, TRUE);
+	else 
+		table = html_engine_get_table_2 (e, FALSE);
+
+	if (!table)
+		return;
+
+	if (table->totalRows == rows)
+		return;
+
+	/* Orignal code actually assume table is the parent, not self. */
+	if (self) {
+		if (table->totalRows < rows) {
+			while (table->totalRows < rows)
+				html_engine_insert_table_row_2 (e, table->totalRows-1,  TRUE);
+		} else {
+			while (table->totalRows > rows)
+				html_engine_delete_table_row_2 (e, table->totalRows - 1);
+		}
+		return;
+	}
+
+	if (table->totalRows < rows) {
+		html_engine_table_goto_row (e, table->totalRows - 1);
+		while (table->totalRows < rows)
+			html_engine_insert_table_row (e, TRUE);
+	} else {
+		html_engine_table_goto_row (e, table->totalRows - 1);
+		while (table->totalRows > rows)
+			html_engine_delete_table_row (e);
+	}
 }
 
 void
 html_engine_delete_table (HTMLEngine *e)
