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

Bug 24537 - Ошибка в консоли при Undo/Redo применения Merge & Center после Select All

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56462 954022d7-b5bf-4e40-9824-e11837661b57
parent ee0ef3e0
......@@ -2964,12 +2964,19 @@ UndoRedoWoorksheet.prototype = {
index = Data.index;
if(false != this.wb.bCollaborativeChanges)
{
index = collaborativeEditing.getLockOtherColumn2(nSheetId, index);
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = new Asc.Range(index, 0, index, gc_nMaxRow0);
this.wb.aCollaborativeChangeElements.push(oLockInfo);
var range;
if (g_nAllColIndex == index) {
range = new Asc.Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
}
else {
index = collaborativeEditing.getLockOtherColumn2(nSheetId, index);
range = new Asc.Range(index, 0, index, gc_nMaxRow0);
}
oLockInfo = new Asc.asc_CLockInfo();
oLockInfo["sheetId"] = nSheetId;
oLockInfo["type"] = c_oAscLockTypeElem.Range;
oLockInfo["rangeOrObjectId"] = range;
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
var col = ws._getCol(index);
if(bUndo)
......@@ -3388,8 +3395,13 @@ UndoRedoRowCol.prototype = {
}
else
{
nIndex = collaborativeEditing.getLockOtherColumn2(nSheetId, nIndex);
oLockInfo["rangeOrObjectId"] = new Asc.Range(nIndex, 0, nIndex, gc_nMaxRow0);
if (g_nAllColIndex == nIndex) {
oLockInfo["rangeOrObjectId"] = new Asc.Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
}
else{
nIndex = collaborativeEditing.getLockOtherColumn2(nSheetId, nIndex);
oLockInfo["rangeOrObjectId"] = new Asc.Range(nIndex, 0, nIndex, gc_nMaxRow0);
}
}
this.wb.aCollaborativeChangeElements.push(oLockInfo);
}
......
......@@ -2528,7 +2528,7 @@ Woorksheet.prototype.setColWidth=function(width, start, stop){
var oNewProps = col.getWidthProp();
if(false == oOldProps.isEqual(oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ColProp, oThis.getId(),
new Asc.Range(col.index, 0, col.index, gc_nMaxRow0),
col._getUpdateRange(),
new UndoRedoData_IndexSimpleProp(col.index, false, oOldProps, oNewProps));
}
};
......@@ -2578,7 +2578,7 @@ Woorksheet.prototype.setColHidden=function(bHidden, start, stop){
var oNewProps = col.getWidthProp();
if(false == oOldProps.isEqual(oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ColProp, oThis.getId(),
new Asc.Range(col.index, 0, col.index, gc_nMaxRow0),
col._getUpdateRange(),
new UndoRedoData_IndexSimpleProp(col.index, false, oOldProps, oNewProps));
}
};
......@@ -2630,7 +2630,7 @@ Woorksheet.prototype.setColBestFit=function(bBestFit, width, start, stop){
var oNewProps = col.getWidthProp();
if(false == oOldProps.isEqual(oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ColProp, oThis.getId(),
new Asc.Range(col.index, 0, col.index, gc_nMaxRow0),
col._getUpdateRange(),
new UndoRedoData_IndexSimpleProp(col.index, false, oOldProps, oNewProps));
};
if(0 != start && gc_nMaxCol0 == stop)
......@@ -2979,7 +2979,7 @@ Woorksheet.prototype._removeRow=function(index){
Woorksheet.prototype._getCol=function(index){
//0-based
var oCurCol;
if(-1 == index)
if (g_nAllColIndex == index)
oCurCol = this.getAllCol();
else
{
......
......@@ -2227,6 +2227,12 @@ Col.prototype =
{
return this.xfs;
},
_getUpdateRange: function () {
if (g_nAllColIndex == this.index)
return new Asc.Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
else
return new Asc.Range(this.index, 0, this.index, gc_nMaxRow0);
},
setStyle : function(xfs)
{
var oldVal = this.xfs;
......@@ -2243,7 +2249,7 @@ Col.prototype =
oldVal = oldVal.clone();
if(null != newVal)
newVal = newVal.clone();
History.Add(g_oUndoRedoCol, historyitem_RowCol_SetStyle, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_SetStyle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, newVal));
}
},
setCellStyle : function(val)
......@@ -2252,7 +2258,7 @@ Col.prototype =
var oRes = this.sm.setCellStyle(this, newVal);
if(History.Is_On() && oRes.oldVal != oRes.newVal) {
var oldStyleName = this.cs.getStyleNameByXfId(oRes.oldVal);
History.Add(g_oUndoRedoCol, historyitem_RowCol_SetCellStyle, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oldStyleName, val));
History.Add(g_oUndoRedoCol, historyitem_RowCol_SetCellStyle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oldStyleName, val));
// Выставляем стиль
var oStyle = this.cs.getStyleByXfId(oRes.newVal);
......@@ -2270,7 +2276,7 @@ Col.prototype =
{
var oRes = this.sm.setNumFormat(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_NumFormat, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_NumFormat, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setFont : function(val)
{
......@@ -2283,74 +2289,74 @@ Col.prototype =
var newVal = null;
if(null != oRes.newVal)
newVal = oRes.newVal.clone();
History.Add(g_oUndoRedoCol, historyitem_RowCol_SetFont, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_SetFont, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, newVal));
}
},
setFontname : function(val)
{
var oRes = this.sm.setFontname(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fontname, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fontname, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setFontsize : function(val)
{
var oRes = this.sm.setFontsize(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fontsize, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fontsize, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setFontcolor : function(val)
{
var oRes = this.sm.setFontcolor(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fontcolor, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fontcolor, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setBold : function(val)
{
var oRes = this.sm.setBold(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Bold, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Bold, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setItalic : function(val)
{
var oRes = this.sm.setItalic(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Italic, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Italic, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setUnderline : function(val)
{
var oRes = this.sm.setUnderline(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Underline, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Underline, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setStrikeout : function(val)
{
var oRes = this.sm.setStrikeout(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Strikeout, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Strikeout, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setFontAlign : function(val)
{
var oRes = this.sm.setFontAlign(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_FontAlign, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_FontAlign, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setAlignVertical : function(val)
{
var oRes = this.sm.setAlignVertical(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_AlignVertical, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_AlignVertical, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setAlignHorizontal : function(val)
{
var oRes = this.sm.setAlignHorizontal(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_AlignHorizontal, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_AlignHorizontal, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setFill : function(val)
{
var oRes = this.sm.setFill(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fill, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Fill, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setBorder : function(val)
{
......@@ -2363,32 +2369,32 @@ Col.prototype =
var newVal = null;
if(null != oRes.newVal)
newVal = oRes.newVal.clone();
History.Add(g_oUndoRedoCol, historyitem_RowCol_Border, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Border, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oldVal, newVal));
}
},
setShrinkToFit : function(val)
{
var oRes = this.sm.setShrinkToFit(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_ShrinkToFit, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_ShrinkToFit, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setWrap : function(val)
{
var oRes = this.sm.setShrinkToFit(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Wrap, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Wrap, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setAngle : function(val)
{
var oRes = this.sm.setAngle(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Angle, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Angle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
},
setVerticalText : function(val)
{
var oRes = this.sm.setVerticalText(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoCol, historyitem_RowCol_Angle, this.ws.getId(), new Asc.Range(this.index, 0, this.index, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoCol, historyitem_RowCol_Angle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
}
};
/**
......
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