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

Дополнение к Revision: 51206

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51226 954022d7-b5bf-4e40-9824-e11837661b57
parent 61e2a5b8
...@@ -3305,7 +3305,6 @@ UndoRedoWoorksheet.prototype = { ...@@ -3305,7 +3305,6 @@ UndoRedoWoorksheet.prototype = {
from = to; from = to;
to = temp; to = temp;
} }
var data = 1;
if(null != from && null != from.r1 && null != from.c1 && null != from.r2 && null != from.c2) if(null != from && null != from.r1 && null != from.c1 && null != from.r2 && null != from.c2)
{ {
var aMerged = ws.mergeManager.get(from); var aMerged = ws.mergeManager.get(from);
...@@ -3314,14 +3313,14 @@ UndoRedoWoorksheet.prototype = { ...@@ -3314,14 +3313,14 @@ UndoRedoWoorksheet.prototype = {
var merged = aMerged.inner[i]; var merged = aMerged.inner[i];
if(merged.bbox.isEqual(from)) if(merged.bbox.isEqual(from))
{ {
var elem = new RangeDataManagerElem(from, data); ws.mergeManager.remove(merged.bbox, merged);
ws.mergeManager.remove(elem.bbox, elem, false);
break; break;
} }
} }
} }
var data = 1;
if(null != to && null != to.r1 && null != to.c1 && null != to.r2 && null != to.c2) if(null != to && null != to.r1 && null != to.c1 && null != to.r2 && null != to.c2)
ws.mergeManager.add(to, data, false); ws.mergeManager.add(to, data);
} }
else if(historyitem_Worksheet_ChangeHyperlink === Type){ else if(historyitem_Worksheet_ChangeHyperlink === Type){
var from = null; var from = null;
...@@ -3337,7 +3336,7 @@ UndoRedoWoorksheet.prototype = { ...@@ -3337,7 +3336,7 @@ UndoRedoWoorksheet.prototype = {
to = temp; to = temp;
} }
//не делаем clone потому что предполагаем, что здесь могут быть только операции изменения рзмеров, перемещение или удаления одной ссылки //не делаем clone потому что предполагаем, что здесь могут быть только операции изменения рзмеров, перемещение или удаления одной ссылки
var data = Data.hyperlink; var data = null;
if(null != from && null != from.r1 && null != from.c1 && null != from.r2 && null != from.c2) if(null != from && null != from.r1 && null != from.c1 && null != from.r2 && null != from.c2)
{ {
var aHyperlinks = ws.hyperlinkManager.get(from); var aHyperlinks = ws.hyperlinkManager.get(from);
...@@ -3346,16 +3345,18 @@ UndoRedoWoorksheet.prototype = { ...@@ -3346,16 +3345,18 @@ UndoRedoWoorksheet.prototype = {
var hyp = aHyperlinks.inner[i]; var hyp = aHyperlinks.inner[i];
if(hyp.bbox.isEqual(from)) if(hyp.bbox.isEqual(from))
{ {
var elem = new RangeDataManagerElem(from, data); data = hyp.data;
ws.hyperlinkManager.remove(elem.bbox, elem, false); ws.hyperlinkManager.remove(hyp.bbox, hyp);
break; break;
} }
} }
} }
if(null != to && null != to.r1 && null != to.c1 && null != to.r2 && null != to.c2) if(null == data)
data = Data.hyperlink;
if(null != data && null != to && null != to.r1 && null != to.c1 && null != to.r2 && null != to.c2)
{ {
data.Ref = ws.getRange3(to.r1, to.c1, to.r2, to.c2); data.Ref = ws.getRange3(to.r1, to.c1, to.r2, to.c2);
ws.hyperlinkManager.add(to, data, false); ws.hyperlinkManager.add(to, data);
} }
} }
} }
......
This diff is collapsed.
...@@ -3332,7 +3332,7 @@ function RangeDataManager(bAllowIntersect, fChange) ...@@ -3332,7 +3332,7 @@ function RangeDataManager(bAllowIntersect, fChange)
this.fChange = fChange; this.fChange = fChange;
} }
RangeDataManager.prototype = { RangeDataManager.prototype = {
add : function(bbox, data, bTriggerEvent) add : function(bbox, data)
{ {
var oNewElem = new RangeDataManagerElem(new Asc.Range(bbox.c1, bbox.r1, bbox.c2, bbox.r2), data); var oNewElem = new RangeDataManagerElem(new Asc.Range(bbox.c1, bbox.r1, bbox.c2, bbox.r2), data);
oNewElem.id = this.idGen++; oNewElem.id = this.idGen++;
...@@ -3409,7 +3409,7 @@ RangeDataManager.prototype = { ...@@ -3409,7 +3409,7 @@ RangeDataManager.prototype = {
} }
this.oElements[this._getBBoxIndex(bbox)] = oNewElem; this.oElements[this._getBBoxIndex(bbox)] = oNewElem;
this._recalculate(); this._recalculate();
if(false != bTriggerEvent) if(null != this.fChange)
this.fChange.call(this, oNewElem.data, null, oNewElem.bbox); this.fChange.call(this, oNewElem.data, null, oNewElem.bbox);
}, },
_getExecElem : function(elem, oFindElems) _getExecElem : function(elem, oFindElems)
...@@ -3652,7 +3652,7 @@ RangeDataManager.prototype = { ...@@ -3652,7 +3652,7 @@ RangeDataManager.prototype = {
} }
return container; return container;
}, },
remove : function(bbox, elemToDelete, bTriggerEvent) remove : function(bbox, elemToDelete)
{ {
if(null != elemToDelete) if(null != elemToDelete)
{ {
...@@ -3683,7 +3683,7 @@ RangeDataManager.prototype = { ...@@ -3683,7 +3683,7 @@ RangeDataManager.prototype = {
this.oAll = this._removeExecElem(this.oAll, null, elemToDelete); this.oAll = this._removeExecElem(this.oAll, null, elemToDelete);
delete this.oElements[this._getBBoxIndex(elemToDelete.bbox)]; delete this.oElements[this._getBBoxIndex(elemToDelete.bbox)];
this._recalculate(); this._recalculate();
if(false != bTriggerEvent) if(null != this.fChange)
this.fChange.call(this, elemToDelete.data, elemToDelete.bbox, null); this.fChange.call(this, elemToDelete.data, elemToDelete.bbox, null);
} }
else else
...@@ -3693,7 +3693,7 @@ RangeDataManager.prototype = { ...@@ -3693,7 +3693,7 @@ RangeDataManager.prototype = {
for(var i = 0, length = aElems.all.length; i < length; ++i) for(var i = 0, length = aElems.all.length; i < length; ++i)
{ {
var elem = aElems.all[i]; var elem = aElems.all[i];
this.remove(elem.bbox, elem, bTriggerEvent); this.remove(elem.bbox, elem);
} }
this.startRecalculate(); this.startRecalculate();
} }
...@@ -3812,11 +3812,7 @@ RangeDataManager.prototype = { ...@@ -3812,11 +3812,7 @@ RangeDataManager.prototype = {
{ {
var item = aToChange[i]; var item = aToChange[i];
var elem = item.elem; var elem = item.elem;
var from = elem.bbox; this.remove(elem.bbox, elem);
var to = item.to;
if(null != this.fChange)
this.fChange.call(this, elem.data, from, to);
this.remove(elem.bbox, elem, false);
} }
//добавляем измененные ячейки //добавляем измененные ячейки
for(var i = 0, length = aToChange.length; i < length; ++i) for(var i = 0, length = aToChange.length; i < length; ++i)
......
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