Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5726)
+++ /CKEditor/trunk/CHANGES.html	(revision 5727)
@@ -82,4 +82,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/5693">#5693</a> : baseHref detection in the flash dialog now works correctly.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5690">#5690</a> : Table cell's width attribute is now respected properly.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/5819">#5819</a> : Introducing the new removeFormatCleanup event and making sure remove format doesn't break the showborder plugin</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.fckeditor.net/ticket/5962">#5962</a> : German;</li>
Index: /CKEditor/trunk/_source/plugins/removeformat/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/removeformat/plugin.js	(revision 5726)
+++ /CKEditor/trunk/_source/plugins/removeformat/plugin.js	(revision 5727)
@@ -104,5 +104,8 @@
 								currentNode.remove( true );
 							else
+							{
 								currentNode.removeAttributes( removeAttributes );
+								editor.fire( 'removeFormatCleanup', currentNode );
+							}
 						}
 
@@ -171,2 +174,9 @@
  */
 CKEDITOR.config.removeFormatAttributes = 'class,style,lang,width,height,align,hspace,valign';
+
+/**
+ * Fired after an element was cleaned by the removeFormat plugin.
+ * @name CKEDITOR#removeFormatCleanup
+ * @event
+ * @param {Object} data.element The element that was cleaned up.
+ */
Index: /CKEditor/trunk/_source/plugins/showborders/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/showborders/plugin.js	(revision 5726)
+++ /CKEditor/trunk/_source/plugins/showborders/plugin.js	(revision 5727)
@@ -84,4 +84,12 @@
 						command.refresh( editor );
 				});
+
+			editor.on( 'removeFormatCleanup', function( evt )
+				{
+					var element = evt.data;
+					if ( editor.getCommand( 'showborders' ).state == CKEDITOR.TRISTATE_ON &&
+						element.is( 'table' ) && !element.hasAttribute( 'border' ) )
+							element.addClass( showBorderClassName );
+				});
 		},
 
