Commit 88b9ff1b authored by GoshaZotov's avatar GoshaZotov

_waitRecalFormulasAfterTableRowHidden -> lockRecal/unlockRecal

parent de5df82f
......@@ -3970,8 +3970,7 @@
{
this.getRange3(start,0,stop, 0)._foreachRow(fProcessRow);
}
//todo возможно стоит вызывать эту функцию только в случае открытия строк
this.autoFilters.recalFormulasAfterTableRowHidden(start, stop);
this.workbook.dependencyFormulas.calcTree();
};
Worksheet.prototype.getRowHidden=function(index){
var res;
......@@ -4026,7 +4025,7 @@
History.Add(AscCommonExcel.g_oUndoRedoWorksheet, AscCH.historyitem_Worksheet_RowHide, oThis.getId(),updateRange, new UndoRedoData_FromToRowCol(bHidden, startIndex, endIndex));
}
}
this.autoFilters.recalFormulasAfterTableRowHidden(start, stop);
this.workbook.dependencyFormulas.calcTree();
};
Worksheet.prototype.setRowBestFit=function(bBestFit, height, start, stop){
//start, stop 0 based
......@@ -4060,6 +4059,7 @@
range._foreachRow(fProcessRow);
}
}
this.workbook.dependencyFormulas.calcTree();
};
Worksheet.prototype.getCell=function(oCellAdd){
return this.getRange(oCellAdd, oCellAdd);
......
......@@ -370,9 +370,6 @@
this.worksheet = currentSheet;
this.changeFilters = null;
this.needRecalcFormulas = false;
this.doNotRecalcFormulas = false;
this.m_oColor = new AscCommon.CColor(120, 120, 120);
return this;
}
......@@ -601,7 +598,7 @@
if(filterObj.filter === null)
return;
this._waitRecalFormulasAfterTableRowHidden(true);
worksheet.workbook.dependencyFormulas.lockRecal();
//if apply a/f from context menu
if(autoFiltersObject && null === autoFiltersObject.automaticRowCount && currentFilter.isAutoFilter() && currentFilter.isApplyAutoFilter() === false)
......@@ -764,7 +761,7 @@
{
this._resetTablePartStyle();
}
this._waitRecalFormulasAfterTableRowHidden(false);
worksheet.workbook.dependencyFormulas.unlockRecal();
return {minChangeRow: minChangeRow, rangeOldFilter: rangeOldFilter, nOpenRowsCount: nOpenRowsCount, nAllRowsCount: nAllRowsCount};
},
......@@ -776,7 +773,7 @@
var bRedoChanges = worksheet.workbook.bRedoChanges;
var minChangeRow;
this._waitRecalFormulasAfterTableRowHidden(true);
worksheet.workbook.dependencyFormulas.lockRecal();
//**get filter**
var filter = this._getFilterByDisplayName(displayName);
......@@ -819,7 +816,7 @@
History.EndTransaction();
this._waitRecalFormulasAfterTableRowHidden(false);
worksheet.workbook.dependencyFormulas.unlockRecal();
return {minChangeRow: minChangeRow, updateRange: filter.Ref, filter: filter};
},
......@@ -1294,7 +1291,7 @@
return bRes;
};
this._waitRecalFormulasAfterTableRowHidden(true);
worksheet.workbook.dependencyFormulas.lockRecal();
if(worksheet.AutoFilter && !bNotDeleteAutoFilter)
{
......@@ -1309,7 +1306,7 @@
}
}
this._waitRecalFormulasAfterTableRowHidden(false);
worksheet.workbook.dependencyFormulas.unlockRecal();
t._setStyleTablePartsAfterOpenRows(activeCells);
History.EndTransaction();
......@@ -1370,40 +1367,6 @@
return false;
},
recalFormulasAfterTableRowHidden: function (start, stop) {
var worksheet = this.worksheet;
var tableParts = worksheet.TableParts;
var tablePart;
for (var i = 0; i < tableParts.length; i++) {
tablePart = tableParts[i];
if (tablePart && tablePart.isTotalsRow() && start >= tablePart.Ref.r1 && stop <= tablePart.Ref.r2) {
if(this.doNotRecalcFormulas){
this.needRecalcFormulas = true;
}else{
this._recalcFormulas();
}
break;
}
}
},
_waitRecalFormulasAfterTableRowHidden: function(bWait){
if(bWait){
this.doNotRecalcFormulas = true;
} else {
if(this.needRecalcFormulas){
this._recalcFormulas();
}
this.needRecalcFormulas = false;
this.doNotRecalcFormulas = false;
}
},
_recalcFormulas: function(){
this.worksheet.workbook.dependencyFormulas.calcTree();
},
_cleanStylesTables: function(redrawTablesArr) {
for(var i = 0; i < redrawTablesArr.length; i++) {
this._cleanStyleTable(redrawTablesArr[i].oldfilterRef);
......@@ -2131,7 +2094,7 @@
var bUndoChanges = worksheet.workbook.bUndoChanges;
var bRedoChanges = worksheet.workbook.bRedoChanges;
this._waitRecalFormulasAfterTableRowHidden(true);
worksheet.workbook.dependencyFormulas.lockRecal();
if(arnTo == null && arnFrom == null && data)
{
......@@ -2233,7 +2196,7 @@
}
}
this._waitRecalFormulasAfterTableRowHidden(false);
worksheet.workbook.dependencyFormulas.unlockRecal();
return isUpdate ? range : null;
},
......@@ -4066,7 +4029,7 @@
if(isOpenHiddenRows)
{
this._waitRecalFormulasAfterTableRowHidden(true);
worksheet.workbook.dependencyFormulas.lockRecal();
}
var maxFilterRow = ref.r2;
......@@ -4169,7 +4132,7 @@
if(isOpenHiddenRows)
{
this._waitRecalFormulasAfterTableRowHidden(false);
worksheet.workbook.dependencyFormulas.unlockRecal();
}
return {values: this._sortArrayMinMax(values), automaticRowCount: automaticRowCount};
},
......@@ -4273,7 +4236,7 @@
if(colId === null)
return;
this._waitRecalFormulasAfterTableRowHidden(true);
worksheet.workbook.dependencyFormulas.lockRecal();
for(var i = ref.r1 + 1; i <= ref.r2; i++)
{
if(worksheet.getRowHidden(i) === false)
......@@ -4284,7 +4247,7 @@
worksheet.setRowHidden(false, i, i);
}
}
this._waitRecalFormulasAfterTableRowHidden(false);
worksheet.workbook.dependencyFormulas.unlockRecal();
},
_openAllHiddenRowsByFilter: function(filter)
......
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