Commit 129dd172 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

оптимизация для открытия файлов с большим количеством замерженых ячеек или гиперссылок.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50553 954022d7-b5bf-4e40-9824-e11837661b57
parent b5cacb36
......@@ -4930,6 +4930,9 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
this.aMerged = new Array();
this.aHyperlinks = new Array();
var oNewWorksheet = new Woorksheet(this.wb, wb.aWorksheets.length, false);
//отключаем пересчет на открытие, потому что может быть много обьектов
oNewWorksheet.mergeManager.stopRecalculate();
oNewWorksheet.hyperlinkManager.stopRecalculate();
res = this.bcr.Read1(length, function(t,l){
return oThis.ReadWorksheet(t,l, oNewWorksheet);
});
......
......@@ -2419,6 +2419,8 @@ Woorksheet.prototype.init=function(){
}
};
Woorksheet.prototype.initPostOpen = function(){
this.mergeManager.startRecalculate();
this.hyperlinkManager.startRecalculate();
//chart
if(null != this.Drawings)
{
......
......@@ -3640,15 +3640,14 @@ RangeDataManager.prototype = {
}
else
{
this.nStopRecalculate++;
this.stopRecalculate();
var aElems = this.get(bbox);
for(var i = 0, length = aElems.all.length; i < length; ++i)
{
var elem = aElems.all[i];
this.remove(elem.bbox, elem, bTriggerEvent);
}
this.nStopRecalculate--;
this._recalculate();
this.startRecalculate();
}
},
shiftGet : function(bbox, bHor)
......@@ -3662,7 +3661,7 @@ RangeDataManager.prototype = {
},
shift : function(bbox, bAdd, bHor, oGetRes)
{
this.nStopRecalculate++;
this.stopRecalculate();
if(null == oGetRes)
oGetRes = this.shiftGet(bbox, bHor);
var aToChange = [];
......@@ -3778,8 +3777,7 @@ RangeDataManager.prototype = {
if(null != item.to)
this.add(item.to, item.elem.data);
}
this.nStopRecalculate--;
this._recalculate();
this.startRecalculate();
},
getAll : function()
{
......@@ -3789,6 +3787,19 @@ RangeDataManager.prototype = {
{
this.oDependenceManager = oDependenceManager;
},
stopRecalculate : function()
{
this.nStopRecalculate++;
},
startRecalculate : function()
{
this.nStopRecalculate--;
if(this.nStopRecalculate <= 0)
{
this.nStopRecalculate = 0;
this._recalculate();
}
},
_getBBoxIndex : function(bbox)
{
return bbox.r1 + "-" + bbox.c1 + "-" + bbox.r2 + "-" + bbox.c2;
......
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