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

Bug 21722 - [CoEdit] Применение Unmerge к объединенным ячейкам не передается другому пользователю

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51206 954022d7-b5bf-4e40-9824-e11837661b57
parent 94689ceb
......@@ -3293,30 +3293,69 @@ UndoRedoWoorksheet.prototype = {
ws.setSheetViewSettings(bUndo ? Data.from : Data.to);
}
else if(historyitem_Worksheet_ChangeMerge === Type){
var from = null;
if(null != Data.from)
from = new Asc.Range(Data.from.c1, Data.from.r1, Data.from.c2, Data.from.r2);
var to = null;
if(null != Data.to)
to = new Asc.Range(Data.to.c1, Data.to.r1, Data.to.c2, Data.to.r2);
if(bUndo)
{
var data = 1;
if(null != Data.to)
var temp = from;
from = to;
to = temp;
}
var data = 1;
if(null != from && null != from.r1 && null != from.c1 && null != from.r2 && null != from.c2)
{
var aMerged = ws.mergeManager.get(from);
for(var i in aMerged.inner)
{
//todo сделать через get/remove
var elem = new RangeDataManagerElem(Data.to, data);
ws.mergeManager.remove(elem.bbox, elem, false);
var merged = aMerged.inner[i];
if(merged.bbox.isEqual(from))
{
var elem = new RangeDataManagerElem(from, data);
ws.mergeManager.remove(elem.bbox, elem, false);
break;
}
}
ws.mergeManager.add(Data.from, data);
}
if(null != to && null != to.r1 && null != to.c1 && null != to.r2 && null != to.c2)
ws.mergeManager.add(to, data, false);
}
else if(historyitem_Worksheet_ChangeHyperlink === Type){
var from = null;
if(null != Data.from)
from = new Asc.Range(Data.from.c1, Data.from.r1, Data.from.c2, Data.from.r2);
var to = null;
if(null != Data.to)
to = new Asc.Range(Data.to.c1, Data.to.r1, Data.to.c2, Data.to.r2);
if(bUndo)
{
var data = Data.hyperlink;
if(null != Data.to)
var temp = from;
from = to;
to = temp;
}
//не делаем clone потому что предполагаем, что здесь могут быть только операции изменения рзмеров, перемещение или удаления одной ссылки
var data = Data.hyperlink;
if(null != from && null != from.r1 && null != from.c1 && null != from.r2 && null != from.c2)
{
var aHyperlinks = ws.hyperlinkManager.get(from);
for(var i in aHyperlinks.inner)
{
//todo сделать через get/remove
var elem = new RangeDataManagerElem(Data.to, data);
ws.hyperlinkManager.remove(elem.bbox, elem, false);
var hyp = aHyperlinks.inner[i];
if(hyp.bbox.isEqual(from))
{
var elem = new RangeDataManagerElem(from, data);
ws.hyperlinkManager.remove(elem.bbox, elem, false);
break;
}
}
data.Ref = ws.getRange3(Data.from.r1, Data.from.c1, Data.from.r2, Data.from.c2);
ws.hyperlinkManager.add(Data.from, data);
}
if(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);
ws.hyperlinkManager.add(to, data, false);
}
}
}
......
This diff is collapsed.
......@@ -3332,7 +3332,7 @@ function RangeDataManager(bAllowIntersect, fChange)
this.fChange = fChange;
}
RangeDataManager.prototype = {
add : function(bbox, data)
add : function(bbox, data, bTriggerEvent)
{
var oNewElem = new RangeDataManagerElem(new Asc.Range(bbox.c1, bbox.r1, bbox.c2, bbox.r2), data);
oNewElem.id = this.idGen++;
......@@ -3409,6 +3409,8 @@ RangeDataManager.prototype = {
}
this.oElements[this._getBBoxIndex(bbox)] = oNewElem;
this._recalculate();
if(false != bTriggerEvent)
this.fChange.call(this, oNewElem.data, null, oNewElem.bbox);
},
_getExecElem : function(elem, oFindElems)
{
......@@ -3679,10 +3681,10 @@ RangeDataManager.prototype = {
}
else if(c_oRangeType.All == nRangeType)
this.oAll = this._removeExecElem(this.oAll, null, elemToDelete);
if(false != bTriggerEvent)
this.fChange.call(this, elemToDelete.data, elemToDelete.bbox, null);
delete this.oElements[this._getBBoxIndex(elemToDelete.bbox)];
this._recalculate();
if(false != bTriggerEvent)
this.fChange.call(this, elemToDelete.data, elemToDelete.bbox, null);
}
else
{
......
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