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

при moveRange в диапазоне, в который вставляем удаляем только нужные range

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50159 954022d7-b5bf-4e40-9824-e11837661b57
parent cd92c409
...@@ -3428,10 +3428,7 @@ Woorksheet.prototype._moveCellVer=function(nRow, nCol, dif){ ...@@ -3428,10 +3428,7 @@ Woorksheet.prototype._moveCellVer=function(nRow, nCol, dif){
this.helperRebuildFormulas(cell,lastName,cell.getName()); this.helperRebuildFormulas(cell,lastName,cell.getName());
} }
}; };
Woorksheet.prototype._prepareMoveRange=function(oBBoxFrom, oBBoxTo){ Woorksheet.prototype._prepareMoveRangeGetCleanRanges=function(oBBoxFrom, oBBoxTo){
var res = 0;
if(oBBoxFrom.isEqual(oBBoxTo))
return res;
var intersection = oBBoxFrom.intersectionSimple(oBBoxTo); var intersection = oBBoxFrom.intersectionSimple(oBBoxTo);
var aRangesToCheck = []; var aRangesToCheck = [];
if(null != intersection) if(null != intersection)
...@@ -3465,6 +3462,13 @@ Woorksheet.prototype._prepareMoveRange=function(oBBoxFrom, oBBoxTo){ ...@@ -3465,6 +3462,13 @@ Woorksheet.prototype._prepareMoveRange=function(oBBoxFrom, oBBoxTo){
} }
else else
aRangesToCheck.push(this.getRange3(oBBoxTo.r1, oBBoxTo.c1, oBBoxTo.r2, oBBoxTo.c2)); aRangesToCheck.push(this.getRange3(oBBoxTo.r1, oBBoxTo.c1, oBBoxTo.r2, oBBoxTo.c2));
return aRangesToCheck;
}
Woorksheet.prototype._prepareMoveRange=function(oBBoxFrom, oBBoxTo){
var res = 0;
if(oBBoxFrom.isEqual(oBBoxTo))
return res;
var aRangesToCheck = this._prepareMoveRangeGetCleanRanges(oBBoxFrom, oBBoxTo);
for(var i = 0, length = aRangesToCheck.length; i < length; i++) for(var i = 0, length = aRangesToCheck.length; i < length; i++)
{ {
var range = aRangesToCheck[i]; var range = aRangesToCheck[i];
...@@ -3560,8 +3564,9 @@ Woorksheet.prototype._moveRange=function(oBBoxFrom, oBBoxTo){ ...@@ -3560,8 +3564,9 @@ Woorksheet.prototype._moveRange=function(oBBoxFrom, oBBoxTo){
} }
} }
//удаляем to через историю, для undo //удаляем to через историю, для undo
var oRangeTo = this.getRange3(oBBoxTo.r1, oBBoxTo.c1, oBBoxTo.r2, oBBoxTo.c2); var aRangesToCheck = this._prepareMoveRangeGetCleanRanges(oBBoxFrom, oBBoxTo);
oRangeTo.cleanAll(); for(var i = 0, length = aRangesToCheck.length; i < length; i++)
aRangesToCheck[i].cleanAll();
//перемещаем без истории //перемещаем без истории
History.TurnOff(); History.TurnOff();
//удаляем from без истории, потому что эти данные не терются а перемещаются //удаляем from без истории, потому что эти данные не терются а перемещаются
...@@ -3569,7 +3574,7 @@ Woorksheet.prototype._moveRange=function(oBBoxFrom, oBBoxTo){ ...@@ -3569,7 +3574,7 @@ Woorksheet.prototype._moveRange=function(oBBoxFrom, oBBoxTo){
oRangeFrom._setPropertyNoEmpty(null, null, function(cell, nRow0, nCol0, nRowStart, nColStart){ oRangeFrom._setPropertyNoEmpty(null, null, function(cell, nRow0, nCol0, nRowStart, nColStart){
var row = oThis._getRowNoEmpty(nRow0); var row = oThis._getRowNoEmpty(nRow0);
if(null != row) if(null != row)
delete row.c[nCol0] delete row.c[nCol0];
}); });
//lockDraw(this.workbook); //lockDraw(this.workbook);
for(var i in aTempObj.cells) for(var i in aTempObj.cells)
......
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