Commit 6810a208 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

Bug 23400 - Ошибка "Maximum call stack size exceeded" при открытии файла (Doc)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60217 954022d7-b5bf-4e40-9824-e11837661b57
parent 000158e2
......@@ -4862,6 +4862,23 @@ function BinaryFileReader(doc, openParams)
}
return res;
};
this.PostLoadPrepareCheckStylesRecursion = function(stId, aStylesGrey, styles){
var stylesGrey = aStylesGrey[stId];
if(0 != stylesGrey){
var stObj = styles[stId];
if(stObj){
if(1 == stylesGrey)
stObj.Set_BasedOn(null);
else{
if(null != stObj.BasedOn){
aStylesGrey[stId] = 1;
this.PostLoadPrepareCheckStylesRecursion(stObj.BasedOn, aStylesGrey, styles);
}
aStylesGrey[stId] = 0;
}
}
}
};
this.PostLoadPrepare = function(setting)
{
//списки
......@@ -5084,6 +5101,12 @@ function BinaryFileReader(doc, openParams)
nStId++;
}
this.Document.Styles.Id = nStId;
//проверяем циклы в styles по BasedOn
var aStylesGrey = {};
for(var stId in styles)
{
this.PostLoadPrepareCheckStylesRecursion(stId, aStylesGrey, styles);
}
//DefpPr, DefrPr
//важно чтобы со списками разобрались выше чем этот код
if(null != this.oReadResult.DefpPr)
......
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