Commit 209bd0fe authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

не добавляем формулу открывшуюся с ошибкой в кеш для оптимизации parseFormula.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55525 954022d7-b5bf-4e40-9824-e11837661b57
parent 59bc8be4
...@@ -3418,6 +3418,7 @@ Woorksheet.prototype._BuildDependencies=function(cellRange){ ...@@ -3418,6 +3418,7 @@ Woorksheet.prototype._BuildDependencies=function(cellRange){
var elem = oNewFormula.outStack[pos.index]; var elem = oNewFormula.outStack[pos.index];
if(elem) if(elem)
{ {
//todo случай ,если ref число или именованный диапазон
var ref = aRefs[k]; var ref = aRefs[k];
var range = Asc.g_oRangeCache.getAscRange(ref); var range = Asc.g_oRangeCache.getAscRange(ref);
if(null != range) if(null != range)
...@@ -3468,7 +3469,9 @@ Woorksheet.prototype._BuildDependencies=function(cellRange){ ...@@ -3468,7 +3469,9 @@ Woorksheet.prototype._BuildDependencies=function(cellRange){
c.formulaParsed = new parserFormula( c.sFormula, c.oId.getID(), this ); c.formulaParsed = new parserFormula( c.sFormula, c.oId.getID(), this );
c.formulaParsed.parse(); c.formulaParsed.parse();
c.formulaParsed.buildDependencies(); c.formulaParsed.buildDependencies();
aCache.push(c); //error не добавляем в кеш у них не распознались RefPos, их бессмысленно сравнивать.Это только добавит торозов
if(0 == c.formulaParsed.error.length)
aCache.push(c);
} }
} }
} }
...@@ -3480,11 +3483,13 @@ function inCache(aCache, sFormula, aRefs) ...@@ -3480,11 +3483,13 @@ function inCache(aCache, sFormula, aRefs)
{ {
var cache = aCache[i]; var cache = aCache[i];
var sCurFormula = cache.sFormula; var sCurFormula = cache.sFormula;
var RefPos = cache.formulaParsed.RefPos; if(null != cache.formulaParsed){
if(inCacheStrcmp(sCurFormula, sFormula, RefPos, aRefs)) var RefPos = cache.formulaParsed.RefPos;
{ //todo свое сравнение для error
oRes = cache; if(0 == cache.formulaParsed.error.length && inCacheStrcmp(sCurFormula, sFormula, RefPos, aRefs)){
break; oRes = cache;
break;
}
} }
} }
return oRes; return oRes;
......
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