Commit 011a47f7 authored by Sergey.Konovalov's avatar Sergey.Konovalov

Сохраняем в историю свойства удаленных строк/колонок

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49767 954022d7-b5bf-4e40-9824-e11837661b57
parent d5b98bf9
...@@ -2587,6 +2587,7 @@ Woorksheet.prototype._removeRows=function(start, stop){ ...@@ -2587,6 +2587,7 @@ Woorksheet.prototype._removeRows=function(start, stop){
} }
//По возрастанию //По возрастанию
aIndexes.sort(fSortAscending); aIndexes.sort(fSortAscending);
var oDefRowPr = new UndoRedoData_RowProp();
for(var i = 0, length = aIndexes.length; i < length; ++i) for(var i = 0, length = aIndexes.length; i < length; ++i)
{ {
var nIndex = aIndexes[i]; var nIndex = aIndexes[i];
...@@ -2603,6 +2604,10 @@ Woorksheet.prototype._removeRows=function(start, stop){ ...@@ -2603,6 +2604,10 @@ Woorksheet.prototype._removeRows=function(start, stop){
} }
else else
{ {
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));
row.setStyle(null);
for(var j in row.c) for(var j in row.c)
{ {
var nColIndex = j - 0; var nColIndex = j - 0;
...@@ -2729,6 +2734,18 @@ Woorksheet.prototype._removeCols=function(start, stop){ ...@@ -2729,6 +2734,18 @@ Woorksheet.prototype._removeCols=function(start, stop){
buildRecalc(this.workbook); buildRecalc(this.workbook);
unLockDraw(this.workbook); unLockDraw(this.workbook);
var oDefColPr = new UndoRedoData_ColProp();
for(var i = start; i <= stop; ++i)
{
var col = this.aCols[i];
if(null != col)
{
var oOldProps = col.getWidthProp();
if(false == Asc.isEqual(oOldProps, oDefColPr))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ColProp, this.getId(), new Asc.Range(0, 0, gc_nMaxCol0, gc_nMaxRow0), new UndoRedoData_IndexSimpleProp(i, false, oOldProps, oDefColPr));
col.setStyle(null);
}
}
this.aCols.splice(start, stop - start + 1); this.aCols.splice(start, stop - start + 1);
for(var i = start, length = this.aCols.length; i < length; ++i) for(var i = start, length = this.aCols.length; i < length; ++i)
{ {
......
...@@ -1992,6 +1992,8 @@ Col.prototype = ...@@ -1992,6 +1992,8 @@ Col.prototype =
return new UndoRedoData_ColProp(this); return new UndoRedoData_ColProp(this);
}, },
setWidthProp : function(prop) setWidthProp : function(prop)
{
if(null != prop)
{ {
if(null != prop.width) if(null != prop.width)
this.width = prop.width; this.width = prop.width;
...@@ -2009,6 +2011,7 @@ Col.prototype = ...@@ -2009,6 +2011,7 @@ Col.prototype =
this.BestFit = prop.BestFit; this.BestFit = prop.BestFit;
else else
this.BestFit = null; this.BestFit = null;
}
}, },
getMerged : function() getMerged : function()
{ {
...@@ -2257,6 +2260,8 @@ Row.prototype = ...@@ -2257,6 +2260,8 @@ Row.prototype =
return new UndoRedoData_RowProp(this); return new UndoRedoData_RowProp(this);
}, },
setHeightProp : function(prop) setHeightProp : function(prop)
{
if(null != prop)
{ {
if(null != prop.h) if(null != prop.h)
this.h = prop.h; this.h = prop.h;
...@@ -2270,6 +2275,7 @@ Row.prototype = ...@@ -2270,6 +2275,7 @@ Row.prototype =
this.CustomHeight = prop.CustomHeight; this.CustomHeight = prop.CustomHeight;
else else
this.CustomHeight = null; this.CustomHeight = null;
}
}, },
copyProperty : function(otherRow) copyProperty : function(otherRow)
{ {
......
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