Ticket #1865: 1865.patch

File 1865.patch, 2.9 KB (added by Alfonso Martínez de Lizarrondo, 13 years ago)

Proposed SVN patch

  • editor/_source/internals/fcktablehandler.js

     
    298298
    299299        this._MarkCells( cells, '_CellSelected' ) ;
    300300
    301         var tableMap = this._CreateTableMap( cells[0].parentNode.parentNode ) ;
     301        var tableMap = this._CreateTableMap( cells[0] ) ;
    302302        var rowIdx = cells[0].parentNode.rowIndex ;
    303303        var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, cells[0] ) ;
    304304
     
    357357        // Assume the selected cells are already in a rectangular geometry.
    358358        // Because the checking is already done by FCKTableCommand.
    359359        var refCell = cells[0] ;
    360         var tableMap = this._CreateTableMap( refCell.parentNode.parentNode ) ;
     360        var tableMap = this._CreateTableMap( refCell ) ;
    361361        var rowIdx = refCell.parentNode.rowIndex ;
    362362        var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
    363363
     
    450450                return ;
    451451
    452452        var refCell = cells[0] ;
    453         var tableMap = this._CreateTableMap( refCell.parentNode.parentNode ) ;
     453        var tableMap = this._CreateTableMap( refCell ) ;
    454454        var rowIdx = refCell.parentNode.rowIndex ;
    455455        var colIdx = FCKTableHandler._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
    456456        var cellSpan = isNaN( refCell.colSpan ) ? 1 : refCell.colSpan ;
     
    514514                return ;
    515515
    516516        var currentCell = cells[0] ;
    517         var tableMap = this._CreateTableMap( currentCell.parentNode.parentNode ) ;
     517        var tableMap = this._CreateTableMap( currentCell ) ;
    518518        var cellIndex = FCKTableHandler._GetCellIndexSpan( tableMap, currentCell.parentNode.rowIndex, currentCell ) ;
    519519        var currentRowSpan = currentCell.rowSpan ;
    520520        var currentRowIndex = currentCell.parentNode.rowIndex ;
     
    629629// will produce a bi-dimensional matrix with the following values (representing the cells):
    630630//              Cell1, Cell2, Cell2, Cell 3
    631631//              Cell4, Cell2, Cell2, Cell 5
    632 FCKTableHandler._CreateTableMap = function( table )
     632FCKTableHandler._CreateTableMap = function( refCell )
    633633{
     634        var table = refCell.parentNode.parentNode.parentNode ;
     635
    634636        var aRows = table.rows ;
    635637
    636638        // Row and Column counters.
     
    805807                return null ;
    806808
    807809        var refCell = cells[0] ;
    808         var tableMap = this._CreateTableMap( refCell.parentNode.parentNode ) ;
     810        var tableMap = this._CreateTableMap( refCell ) ;
    809811        var rowIdx = refCell.parentNode.rowIndex ;
    810812        var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
    811813        var nextColIdx = colIdx + ( isNaN( refCell.colSpan ) ? 1 : refCell.colSpan ) ;
     
    833835                return null ;
    834836
    835837        var refCell = cells[0] ;
    836         var tableMap = this._CreateTableMap( refCell.parentNode.parentNode ) ;
     838        var tableMap = this._CreateTableMap( refCell ) ;
    837839        var rowIdx = refCell.parentNode.rowIndex ;
    838840        var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
    839841        var newRowIdx = rowIdx + ( isNaN( refCell.rowSpan ) ? 1 : refCell.rowSpan ) ;
© 2003 – 2021 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy