Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9033 closed Bug (duplicate)

[Table] vertical split a cell, and then merge down, the result is wrong

Reported by: tengshengbo Owned by:
Priority: Normal Milestone:
Component: Core : Tables Version: 3.6.3
Keywords: Cc:

Description (last modified by Jakub Ś)

Steps:

  1. create a 3rows, 3 columns table
  2. vertical split the first cell in the first row
  3. select the first cell, merge down.

Expected: the table is still 3 rows, 3 columns
Defect: the table is messy.

Change History (4)

comment:1 Changed 8 years ago by tengshengbo

This bug is in "tabletools/plugin.js", mergeCells function. After removing an empty tailTr, all cells in the previous row should be updated with new rowSpan.

My fix:

var newmap = null;

for ( i = count - 1; i >= 0; i-- ) {

var tailTr = trs.getItem( i ); if ( !tailTr.$.cells.length ) {

tailTr.remove();
if (i>0){

if (!newmap){

newmap = CKEDITOR.tools.buildTableMap(table );

}

var cells = cellInRow(newmap, i-1); for (var j = 0;j < cells.length;j++){

if (cells[j].rowSpan>1){ cells[j].rowSpan = cells[j].rowSpan-1; }

}

} count++; continue;

}

}

Version 0, edited 8 years ago by tengshengbo (next)

comment:2 Changed 8 years ago by Jakub Ś

Description: modified (diff)

comment:3 Changed 8 years ago by Jakub Ś

Resolution: duplicate
Status: newclosed

This is a DUP of #8666

@tengshengbo I have copied your proposed fix to that ticket.

comment:4 in reply to:  3 Changed 8 years ago by tengshengbo

Replying to j.swiderski: Thanks.

This is a DUP of #8666

@tengshengbo I have copied your proposed fix to that ticket.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy