+ return null;\r
+ }\r
+\r
+ function insertRow( selection, insertBefore )\r
+ {\r
+ var cells = getSelectedCells( selection ),\r
+ firstCell = cells[ 0 ],\r
+ table = firstCell.getAscendant( 'table' ),\r
+ doc = firstCell.getDocument(),\r
+ startRow = cells[ 0 ].getParent(),\r
+ startRowIndex = startRow.$.rowIndex,\r
+ lastCell = cells[ cells.length - 1 ],\r
+ endRowIndex = lastCell.getParent().$.rowIndex + lastCell.$.rowSpan - 1,\r
+ endRow = new CKEDITOR.dom.element( table.$.rows[ endRowIndex ] ),\r
+ rowIndex = insertBefore ? startRowIndex : endRowIndex,\r
+ row = insertBefore ? startRow : endRow;\r
+\r
+ var map = CKEDITOR.tools.buildTableMap( table ),\r
+ cloneRow = map[ rowIndex ],\r
+ nextRow = insertBefore ? map[ rowIndex - 1 ] : map[ rowIndex + 1 ],\r
+ width = map[0].length;\r
+\r
+ var newRow = doc.createElement( 'tr' );\r
+ for ( var i = 0; cloneRow[ i ] && i < width; i++ )\r
+ {\r
+ var cell;\r
+ // Check whether there's a spanning row here, do not break it.\r
+ if ( cloneRow[ i ].rowSpan > 1 && nextRow && cloneRow[ i ] == nextRow[ i ] )\r