Opened 13 years ago

Last modified 9 years ago

#9020 confirmed Bug

"vertical split a cell" works error when the row contains "colpan>1" cells — at Version 2

Reported by: tengshengbo Owned by:
Priority: Normal Milestone:
Component: Core : Tables Version: 3.1
Keywords: HasPatch Support Cc:

Description (last modified by Jakub Ś)

Follow this simple steps:

  1. create a table with 3 rows, 3 columns.
  2. merge the first two cells in the first row.
  3. veritical split the last cell(the cell after the merged cell) in the first row.

The table structure becomes messy after the third step.
The bug is in "tabletools/plugin.js", cellInRow function. Developer should avoid adding duplicate cells, similar with "cellInCol".

Change History (2)

comment:1 Changed 13 years ago by tengshengbo

My fix for this:

	function cellInRow( tableMap, rowIndex, cell )
	{
		var oRow = tableMap[ rowIndex ];
		if ( typeof cell == 'undefined' ){
			var oRowtemp = [];
			for ( var c = 0; c < oRow.length; c++ )
			{
				oRowtemp.push( oRow[ c ] );
				if ( oRow[ c ].colSpan > 1 )
					c += oRow[ c ].colSpan - 1;
			}
			return oRowtemp;
		}
			

		for ( var c = 0 ; oRow && c < oRow.length ; c++ )
		{
			if ( cell.is && oRow[c] == cell.$ )
				return c;
			else if ( c == cell )
				return new CKEDITOR.dom.element( oRow[ c ] );
		}
		return cell.is ? -1 : null;
	}
Last edited 13 years ago by Jakub Ś (previous) (diff)

comment:2 Changed 13 years ago by Jakub Ś

Description: modified (diff)
Keywords: table removed
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy