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

Bug 26070 - Примененные в XLSX книге границы отменяются не полностью после Undo.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57908 954022d7-b5bf-4e40-9824-e11837661b57
parent baff7363
......@@ -5246,8 +5246,7 @@
if(gc_nMaxCol == oLast.Max)
{
oAllCol = oLast;
oWorksheet.oAllCol = new Col(oWorksheet, 0);
fInitCol(oAllCol, oWorksheet.oAllCol);
fInitCol(oAllCol, oWorksheet.getAllCol());
}
}
for(var i = 0, length = aTempCols.length; i < length; ++i)
......
......@@ -7,6 +7,7 @@ var gc_dDefaultRowHeightAttribute;//определяется в WorksheetView.js
var g_sNewSheetNamePattern = "Sheet";
var g_nSheetNameMaxLength = 31;
var g_nAllColIndex = -1;
var g_nAllRowIndex = -1;
var History;
var aStandartNumFormats;
var aStandartNumFormatsId;
......@@ -2450,7 +2451,7 @@ Woorksheet.prototype._removeRows=function(start, stop){
{
var oOldProps = row.getHeightProp();
if(false == Asc.isEqual(oOldProps, oDefRowPr))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, this.getId(), new Asc.Range(0, nIndex, gc_nMaxCol0, nIndex), new UndoRedoData_IndexSimpleProp(nIndex, true, oOldProps, oDefRowPr));
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, this.getId(), row._getUpdateRange(), new UndoRedoData_IndexSimpleProp(nIndex, true, oOldProps, oDefRowPr));
row.setStyle(null);
for(var j in row.c)
{
......@@ -2911,7 +2912,7 @@ Woorksheet.prototype.setRowHeight=function(height, start, stop){
row.hd = null;
var oNewProps = row.getHeightProp();
if(false == Asc.isEqual(oOldProps, oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps));
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), row._getUpdateRange(), new UndoRedoData_IndexSimpleProp(row.index, true, oOldProps, oNewProps));
}
};
if(0 == start && gc_nMaxRow0 == stop)
......@@ -2949,7 +2950,7 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){
row.hd = null;
var oNewProps = row.getHeightProp();
if(false == Asc.isEqual(oOldProps, oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps));
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), row._getUpdateRange(), new UndoRedoData_IndexSimpleProp(row.index, true, oOldProps, oNewProps));
}
};
if(0 == start && gc_nMaxRow0 == stop)
......@@ -2997,7 +2998,7 @@ Woorksheet.prototype.setRowBestFit=function(bBestFit, height, start, stop){
row.height = height;
var oNewProps = row.getHeightProp();
if(false == Asc.isEqual(oOldProps, oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps));
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), row._getUpdateRange(), new UndoRedoData_IndexSimpleProp(row.index, true, oOldProps, oNewProps));
}
};
if(0 == start && gc_nMaxRow0 == stop)
......@@ -3171,17 +3172,22 @@ Woorksheet.prototype._getColNoEmptyWithAll=function(col){
};
Woorksheet.prototype._getRow=function(row){
//0-based
var oCurRow = this.aGCells[row];
if(!oCurRow){
if(null != this.oSheetFormatPr.oAllRow)
var oCurRow = null;
if (g_nAllRowIndex == row)
oCurRow = this.getAllRow();
else {
oCurRow = this.aGCells[row];
if (!oCurRow) {
if (null != this.oSheetFormatPr.oAllRow)
oCurRow = this.oSheetFormatPr.oAllRow.clone(this);
else
oCurRow = new Row(this);
oCurRow.create(row + 1);
this.aGCells[row] = oCurRow;
this.nRowsCount = row > this.nRowsCount ? row : this.nRowsCount ;
this.nRowsCount = row > this.nRowsCount ? row : this.nRowsCount;
//History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_CreateRow, this.getId(), null, new UndoRedoData_SingleProperty(row));
}
}
return oCurRow;
};
Woorksheet.prototype._removeRow=function(index){
......@@ -3886,8 +3892,10 @@ Woorksheet.prototype.getAllCol = function(){
return this.oAllCol;
};
Woorksheet.prototype.getAllRow = function(){
if(null == this.oSheetFormatPr.oAllRow)
if (null == this.oSheetFormatPr.oAllRow) {
this.oSheetFormatPr.oAllRow = new Row(this);
this.oSheetFormatPr.oAllRow.create(g_nAllRowIndex + 1);
}
return this.oSheetFormatPr.oAllRow;
};
Woorksheet.prototype.getHyperlinkByCell = function(row, col){
......@@ -7506,7 +7514,7 @@ Range.prototype._promoteFromTo=function(from, to, bIsPromote, oCanPromote, bCtrl
var oOldProps = row.getHeightProp();
if (false == Asc.isEqual(oOldProps, oNewProps)) {
row.setHeightProp(oNewProps);
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, this.worksheet.getId(), new Asc.Range(0, nCurIndex, gc_nMaxCol0, nCurIndex), new UndoRedoData_IndexSimpleProp(nCurIndex, true, oOldProps, oNewProps));
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, this.worksheet.getId(), row._getUpdateRange(), new UndoRedoData_IndexSimpleProp(nCurIndex, true, oOldProps, oNewProps));
}
}
}
......
......@@ -2510,6 +2510,12 @@ Row.prototype =
{
return this.xfs;
},
_getUpdateRange: function () {
if (g_nAllRowIndex == this.index)
return new Asc.Range(0, 0, gc_nMaxCol0, gc_nMaxRow0);
else
return new Asc.Range(0, this.index, gc_nMaxCol0, this.index);
},
setStyle : function(xfs)
{
var oldVal = this.xfs;
......@@ -2526,7 +2532,7 @@ Row.prototype =
oldVal = oldVal.clone();
if(null != newVal)
newVal = newVal.clone();
History.Add(g_oUndoRedoRow, historyitem_RowCol_SetStyle, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oldVal, newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_SetStyle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oldVal, newVal));
}
},
setCellStyle : function(val)
......@@ -2535,7 +2541,7 @@ Row.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_oUndoRedoRow, historyitem_RowCol_SetCellStyle, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oldStyleName, val));
History.Add(g_oUndoRedoRow, historyitem_RowCol_SetCellStyle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oldStyleName, val));
// Выставляем стиль
var oStyle = this.cs.getStyleByXfId(oRes.newVal);
......@@ -2553,7 +2559,7 @@ Row.prototype =
{
var oRes = this.sm.setNumFormat(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoRow, historyitem_RowCol_NumFormat, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_NumFormat, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
},
setFont : function(val)
{
......@@ -2566,74 +2572,74 @@ Row.prototype =
var newVal = null;
if(null != oRes.newVal)
newVal = oRes.newVal.clone();
History.Add(g_oUndoRedoRow, historyitem_RowCol_SetFont, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oldVal, newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_SetFont, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oldVal, newVal));
}
},
setFontname : function(val)
{
var oRes = this.sm.setFontname(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoRow, historyitem_RowCol_Fontname, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Fontname, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Fontsize, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Fontsize, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Fontcolor, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Fontcolor, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Bold, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Bold, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Italic, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Italic, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Underline, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Underline, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Strikeout, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Strikeout, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_FontAlign, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_FontAlign, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_AlignVertical, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_AlignVertical, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_AlignHorizontal, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_AlignHorizontal, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Fill, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Fill, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
},
setBorder : function(val)
{
......@@ -2646,32 +2652,32 @@ Row.prototype =
var newVal = null;
if(null != oRes.newVal)
newVal = oRes.newVal.clone();
History.Add(g_oUndoRedoRow, historyitem_RowCol_Border, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oldVal, newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Border, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oldVal, newVal));
}
},
setShrinkToFit : function(val)
{
var oRes = this.sm.setShrinkToFit(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoRow, historyitem_RowCol_ShrinkToFit, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_ShrinkToFit, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Wrap, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Wrap, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
},
setAngle: function(val)
{
var oRes = this.sm.setFontname(this, val);
if(History.Is_On() && oRes.oldVal != oRes.newVal)
History.Add(g_oUndoRedoRow, historyitem_RowCol_Angle, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Angle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, 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_oUndoRedoRow, historyitem_RowCol_Angle, this.ws.getId(), new Asc.Range(0, this.index, gc_nMaxCol0, this.index), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
History.Add(g_oUndoRedoRow, historyitem_RowCol_Angle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, true, oRes.oldVal, oRes.newVal));
}
};
function CCellValueMultiText()
......
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