Commit 7e0fd049 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

+ к rev.64389

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64397 954022d7-b5bf-4e40-9824-e11837661b57
parent 3e8cf91c
...@@ -3848,7 +3848,7 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){ ...@@ -3848,7 +3848,7 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){
stop = start; stop = start;
History.Create_NewPoint(); History.Create_NewPoint();
var oThis = this, i; var oThis = this, i;
var historyStart = 0, prevStatus = null; var startIndex = start, isAddPrevBlock = false;
var fProcessRow = function(row){ var fProcessRow = function(row){
if(row && bHidden != (0 != (g_nRowFlag_hd & row.flags))) if(row && bHidden != (0 != (g_nRowFlag_hd & row.flags)))
...@@ -3857,32 +3857,25 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){ ...@@ -3857,32 +3857,25 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){
row.flags |= g_nRowFlag_hd; row.flags |= g_nRowFlag_hd;
else else
row.flags &= ~g_nRowFlag_hd; row.flags &= ~g_nRowFlag_hd;
var oNewProps = row.getHeightProp();
var isEqualProp = prevStatus !== null && prevStatus.isEqual(oNewProps) ? true : false; if(row.index === stop)
if(isEqualProp)//если статус не изменяется
{
if(row.index === stop)
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowHide, oThis.getId(), row._getUpdateRange(), new UndoRedoData_FromToRowCol(bHidden, historyStart, row.index));
}
else
{ {
if(prevStatus !== null)//заносим в историю предыдущие строки if(isAddPrevBlock)
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowHide, oThis.getId(), row._getUpdateRange(), new UndoRedoData_FromToRowCol(prevStatus.hd, historyStart, row.index - 1)); History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowHide, oThis.getId(), row._getUpdateRange(), new UndoRedoData_FromToRowCol(bHidden, startIndex, row.index));
else
if(row.index === stop)//если строка последняя, её необходимо добавить в историю {
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowHide, oThis.getId(), row._getUpdateRange(), new UndoRedoData_FromToRowCol(bHidden, row.index, row.index)); History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowHide, oThis.getId(), row._getUpdateRange(), new UndoRedoData_FromToRowCol(bHidden, row.index, row.index));
startIndex = row.index;
//обнуляем индексы }
historyStart = row.index;
} }
prevStatus = oNewProps;
isAddPrevBlock = true;
} }
else else
{ {
if(prevStatus !== null)//заносим предыдущие строки if(isAddPrevBlock)//заносим предыдущие строки
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowHide, oThis.getId(), row._getUpdateRange(), new UndoRedoData_FromToRowCol(prevStatus.hd, historyStart, row.index - 1)); History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowHide, oThis.getId(), row._getUpdateRange(), new UndoRedoData_FromToRowCol(bHidden, startIndex, row.index - 1));
prevStatus = null; isAddPrevBlock = false;
} }
}; };
if(0 == start && gc_nMaxRow0 == stop) if(0 == start && gc_nMaxRow0 == stop)
......
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