Index: /CKEditor/trunk/_source/core/config.js
===================================================================
--- /CKEditor/trunk/_source/core/config.js	(revision 3046)
+++ /CKEditor/trunk/_source/core/config.js	(revision 3047)
@@ -147,5 +147,5 @@
 	 * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
 	 */
-	plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,removeformat,smiley,sourcearea,specialchar,tab,toolbar,wysiwygarea',
+	plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,removeformat,smiley,sourcearea,table,specialchar,tab,toolbar,wysiwygarea',
 
 	/**
Index: /CKEditor/trunk/_source/core/dom/element.js
===================================================================
--- /CKEditor/trunk/_source/core/dom/element.js	(revision 3046)
+++ /CKEditor/trunk/_source/core/dom/element.js	(revision 3047)
@@ -676,10 +676,10 @@
 			if ( toStart )
 			{
-				while ( (child = $.lastChild) )
+				while ( ( child = $.lastChild ) )
 					target.insertBefore( $.removeChild( child ), target.firstChild );
 			}
 			else
 			{
-				while ( (child = $.firstChild) )
+				while ( ( child = $.firstChild ) )
 					target.appendChild( $.removeChild( child ) );
 			}
Index: /CKEditor/trunk/_source/lang/en.js
===================================================================
--- /CKEditor/trunk/_source/lang/en.js	(revision 3046)
+++ /CKEditor/trunk/_source/lang/en.js	(revision 3047)
@@ -199,5 +199,12 @@
 		headersColumn	: 'First column',
 		headersRow		: 'First Row',
-		headersBoth		: 'Both'
+		headersBoth		: 'Both',
+		invalidRows		: 'Number of rows must be an integer greater than 0.',
+		invalidCols		: 'Number of columns must be an integer greater than 0.',
+		invalidBorder	: 'Border size must be a number.',
+		invalidWidth	: 'Table width must be a number.',
+		invalidHeight	: 'Table height must be a number.',
+		invalidCellSpacing	: 'Cell spacing must be a number.',
+		invalidCellPadding	: 'Cell padding must be a number.'
 	},
 
Index: /CKEditor/trunk/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/dialog/plugin.js	(revision 3046)
+++ /CKEditor/trunk/_source/plugins/dialog/plugin.js	(revision 3047)
@@ -817,4 +817,5 @@
 				var selection = new CKEDITOR.dom.selection( this._.editor.document );
 				this._.selectedRanges = selection.getRanges();
+				this._.selectedElement = selection.getSelectedElement();
 			}
 		},
@@ -829,4 +830,17 @@
 		{
 			delete this._.selectedRanges;
+			delete this._.selectedElement;
+		},
+
+		/**
+		 * Gets the saved control selection. Control selections should be retrieved
+		 * with this function instead of from restoreSelection() because
+		 * restoreSelection() does not properly restore control selections.
+		 * @returns {CKEDITOR.dom.element} The element that was selected.
+		 * @example
+		 */
+		getSelectedElement : function()
+		{
+			return this._.selectedElement;
 		},
 
Index: /CKEditor/trunk/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 3046)
+++ /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 3047)
@@ -212,5 +212,5 @@
 		'Subscript', 'Superscript', '-',
 		'SelectAll', 'RemoveFormat', '-',
-		'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak'
+		'Table', 'Smiley', 'HorizontalRule', 'SpecialChar', 'PageBreak'
 	]
 ];
Index: /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 3046)
+++ /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 3047)
@@ -96,7 +96,11 @@
 				clone = element.clone( true );
 
-				// If the new node is a block element, split the current block.
+				// If the new node is a block element, split the current block (if any).
 				if ( this.config.enterMode != 'br' && isBlock )
-					range.splitBlock();
+				{
+					var startPath = new CKEDITOR.dom.elementPath( range.startContainer );
+					if ( startPath.block )
+						range.splitBlock();
+				}
 
 				// Insert the new node.
