Commit e1625ffc authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

Сдвигаем индексы колонок при вставке/удалении столбцов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49740 954022d7-b5bf-4e40-9824-e11837661b57
parent 9981eb94
...@@ -2730,6 +2730,12 @@ Woorksheet.prototype._removeCols=function(start, stop){ ...@@ -2730,6 +2730,12 @@ Woorksheet.prototype._removeCols=function(start, stop){
unLockDraw(this.workbook); unLockDraw(this.workbook);
this.aCols.splice(start, stop - start + 1); this.aCols.splice(start, stop - start + 1);
for(var i = start, length = this.aCols.length; i < length; ++i)
{
var elem = this.aCols[i];
if(null != elem)
elem.moveHor(nDif);
}
// for(var id in res) // for(var id in res)
// History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RemoveCell, this.getId(), new Asc.Range(0, res[id].nRow, gc_nMaxCol0, res[id].nRow), new UndoRedoData_CellSimpleData(res[id].nRow, res[id].nCol, res[id].data, null)); // History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RemoveCell, this.getId(), new Asc.Range(0, res[id].nRow, gc_nMaxCol0, res[id].nRow), new UndoRedoData_CellSimpleData(res[id].nRow, res[id].nCol, res[id].data, null));
...@@ -2789,6 +2795,12 @@ Woorksheet.prototype._insertColsBefore=function(index, count){ ...@@ -2789,6 +2795,12 @@ Woorksheet.prototype._insertColsBefore=function(index, count){
} }
this.aCols.splice(index, 0, oNewCol); this.aCols.splice(index, 0, oNewCol);
} }
for(var i = index + count, length = this.aCols.length; i < length; ++i)
{
var elem = this.aCols[i];
if(null != elem)
elem.moveHor(count);
}
this.nColsCount += count; this.nColsCount += count;
// for(var id in res) // for(var id in res)
......
...@@ -1923,6 +1923,10 @@ Col.prototype = ...@@ -1923,6 +1923,10 @@ Col.prototype =
{ {
return this.id; return this.id;
}, },
moveHor : function(nDif)
{
this.index += nDif;
},
isEqual : function(obj) isEqual : function(obj)
{ {
var bRes = this.BestFit == obj.BestFit && this.hd == obj.hd && this.width == obj.width && this.CustomWidth == obj.CustomWidth && this.merged == obj.merged && this.hyperlinks.length == obj.hyperlinks.length; var bRes = this.BestFit == obj.BestFit && this.hd == obj.hd && this.width == obj.width && this.CustomWidth == obj.CustomWidth && this.merged == obj.merged && this.hyperlinks.length == obj.hyperlinks.length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment