Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2055 closed Bug (duplicate)

MergeDownCells error

Reported by: wangxiuling Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.5
Keywords: Confirmed Cc:

Description

FCKEditor2.5 IE6.0 MergeDownCells twice Error! if ( tableMap[j-1] && tableMap[j-1][i] == cell )

{

alert("old:"+cell.rowSpan);

cell.rowSpan++ ;

alert("new:"+cell.rowSpan)

} result is old:1 new:1

so I changed it:

Disconnect all the cells in tableMap from their parents, set all colSpan and rowSpan attributes to 1. for ( var i = 0 ; i < tableMap.length ; i++ ) {

for ( var j = 0 ; j < tableMap[i].length ; j++ ) {

var cell = tableMap[i][j] ; if ( cell.parentNode )

cell.parentNode.removeChild( cell ) ;

cell.colSpan = cell.rowSpan = 1 ;

add to count cell.rowSpan:wangxiuling

cell.rowsCount=1;

}

}

Scan by columns and set rowSpan.

for ( var i = 0 ; i <= maxCol ; i++ ) {

for ( var j = 0 ; j < tableMap.length ; j++ ) {

if ( ! tableMap[j] )

continue ;

var cell = tableMap[j][i] ;

if ( ! cell
cell._rowScanned === true )

continue ;

if ( tableMap[j-1] && tableMap[j-1][i] == cell )

{

cell.rowSpan++ ;

add by wangxiuling

cell.rowsCount++;

} if ( ! tableMap[j+1]
tableMap[j+1][i] != cell )

cell._rowScanned = true ;

}

}

Insert physical rows and columns to the table.

for ( var i = 0 ; i < tableMap.length ; i++ ) {

var rowObj = table.ownerDocument.createElement( 'tr' ) ; for ( var j = 0 ; j < tableMap[i].length ; ) {

var cell = tableMap[i][j] ; if ( tableMap[i-1] && tableMap[i-1][j] == cell ) {

j += cell.colSpan ; continue ;

}

add by wangxiuling

cell.rowSpan=cell.rowsCount

rowObj.appendChild( cell ) ; j += cell.colSpan ; if ( cell.colSpan == 1 )

cell.removeAttribute( 'colspan' ) ;

if ( cell.rowSpan == 1 )

cell.removeAttribute( 'rowspan' ) ;

} table.appendChild( rowObj ) ;

}

Change History (3)

comment:1 Changed 16 years ago by Wojciech Olchawa

Keywords: Pending WorksForMe added
Version: FCKeditor 2.5

I was unable to reproduce your bug in 2.5.1 and also in 2.6beta and the SVN version using IE6 and IE7. Could you please see if the bug still occurs in 2.6beta or could you provide us more information about the reproduction of the bug?

Thanks in advance

comment:2 Changed 16 years ago by Martin Kou

Keywords: Confirmed added; Pending WorksForMe removed
Resolution: duplicate
Status: newclosed

This is a dup of #1917. It is reproducible if you try to merge three cells by applying the "Merge Down" command twice.

comment:3 Changed 16 years ago by Julia

I'm interested.

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