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 = { ...@@ -3293,30 +3293,69 @@ UndoRedoWoorksheet.prototype = {
ws.setSheetViewSettings(bUndo ? Data.from : Data.to); ws.setSheetViewSettings(bUndo ? Data.from : Data.to);
} }
else if(historyitem_Worksheet_ChangeMerge === Type){ 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) if(bUndo)
{ {
var data = 1; var temp = from;
if(null != Data.to) 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 merged = aMerged.inner[i];
var elem = new RangeDataManagerElem(Data.to, data); if(merged.bbox.isEqual(from))
ws.mergeManager.remove(elem.bbox, elem, false); {
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){ 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) if(bUndo)
{ {
var data = Data.hyperlink; var temp = from;
if(null != Data.to) 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 hyp = aHyperlinks.inner[i];
var elem = new RangeDataManagerElem(Data.to, data); if(hyp.bbox.isEqual(from))
ws.hyperlinkManager.remove(elem.bbox, elem, false); {
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) ...@@ -3332,7 +3332,7 @@ function RangeDataManager(bAllowIntersect, fChange)
this.fChange = fChange; this.fChange = fChange;
} }
RangeDataManager.prototype = { 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); 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,6 +3409,8 @@ RangeDataManager.prototype = { ...@@ -3409,6 +3409,8 @@ RangeDataManager.prototype = {
} }
this.oElements[this._getBBoxIndex(bbox)] = oNewElem; this.oElements[this._getBBoxIndex(bbox)] = oNewElem;
this._recalculate(); this._recalculate();
if(false != bTriggerEvent)
this.fChange.call(this, oNewElem.data, null, oNewElem.bbox);
}, },
_getExecElem : function(elem, oFindElems) _getExecElem : function(elem, oFindElems)
{ {
...@@ -3679,10 +3681,10 @@ RangeDataManager.prototype = { ...@@ -3679,10 +3681,10 @@ RangeDataManager.prototype = {
} }
else if(c_oRangeType.All == nRangeType) else if(c_oRangeType.All == nRangeType)
this.oAll = this._removeExecElem(this.oAll, null, elemToDelete); 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)]; delete this.oElements[this._getBBoxIndex(elemToDelete.bbox)];
this._recalculate(); this._recalculate();
if(false != bTriggerEvent)
this.fChange.call(this, elemToDelete.data, elemToDelete.bbox, null);
} }
else 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