Commit f178e15e authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fix: Bug 30230 - [XLSX] Ошибка в консоли "Maximum call stack size exceeded"...

fix: Bug 30230 - [XLSX] Ошибка в консоли "Maximum call stack size exceeded" при открытии таблицы (http://bugzserver/show_bug.cgi?id=30230)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64749 954022d7-b5bf-4e40-9824-e11837661b57
parent 16560c81
...@@ -1258,17 +1258,17 @@ function cName( val, wb, ws ) { ...@@ -1258,17 +1258,17 @@ function cName( val, wb, ws ) {
this.wb = wb; this.wb = wb;
this.ws = ws; this.ws = ws;
this.defName = this.wb.getDefinesNames( this.value, this.ws ? this.ws.getId() : null ); this.defName = this.wb.getDefinesNames( this.value, this.ws ? this.ws.getId() : null );
if ( this.defName && this.defName.Ref ) { /*if ( this.defName && this.defName.Ref ) {
this.ref = new parserFormula( this.defName.Ref, "", this.ws ); this.ref = new parserFormula( this.defName.Ref, "", this.ws );
this.ref.parse(); this.ref.parse();
} }*/
} }
cName.prototype = Object.create( cBaseType.prototype ); cName.prototype = Object.create( cBaseType.prototype );
cName.prototype.reInit = function () { cName.prototype.reInit = function () {
this.defName = this.wb.getDefinesNames( this.value, this.ws.getId() ); this.defName = this.wb.getDefinesNames( this.value, this.ws.getId() );
this.ref = new parserFormula( this.defName.Ref, "", this.ws ); this.defName.parsedRef = new parserFormula( this.defName.Ref, "", this.ws );
this.ref.parse(); this.defName.parsedRef.parse();
}; };
cName.prototype.toRef = function () { cName.prototype.toRef = function () {
...@@ -1309,7 +1309,7 @@ cName.prototype.getValue = function () { ...@@ -1309,7 +1309,7 @@ cName.prototype.getValue = function () {
return new cError( "#NAME?" ); return new cError( "#NAME?" );
} }
return this.ref.calculate(); return this.defName.parsedRef.calculate();
}; };
cName.prototype.getRef = function () { cName.prototype.getRef = function () {
...@@ -1317,11 +1317,11 @@ cName.prototype.getRef = function () { ...@@ -1317,11 +1317,11 @@ cName.prototype.getRef = function () {
cName.prototype.reParse = function () { cName.prototype.reParse = function () {
var dN = this.wb.getDefinesNames( this.defName.Name, this.ws.getId() ); var dN = this.wb.getDefinesNames( this.defName.Name, this.ws.getId() );
if ( dN ) { if ( dN ) {
this.ref = new parserFormula( dN.Ref, "", this.ws ); this.defName.parsedRef = new parserFormula( dN.Ref, "", this.ws );
this.ref.parse(); this.defName.parsedRef.parse();
} }
else { else {
this.ref = null; this.defName.parsedRef = null;
} }
}; };
cName.prototype.addDefinedNameNode = function ( nameReParse ) { cName.prototype.addDefinedNameNode = function ( nameReParse ) {
...@@ -1335,11 +1335,12 @@ cName.prototype.addDefinedNameNode = function ( nameReParse ) { ...@@ -1335,11 +1335,12 @@ cName.prototype.addDefinedNameNode = function ( nameReParse ) {
} }
var dN = this.wb.getDefinesNames( this.defName.Name, this.ws.getId() ); var dN = this.wb.getDefinesNames( this.defName.Name, this.ws.getId() );
dN = dN.getAscCDefName(); // dN = dN.getAscCDefName();
var node = this.wb.dependencyFormulas.addDefinedNameNode( dN.Name, dN.LocalSheetId, dN.Ref, dN.Hidden ), var node/* = this.wb.dependencyFormulas.addDefinedNameNode( dN.Name, dN.LocalSheetId, dN.Ref, dN.Hidden )*/,
wsR, ref, nTo; wsR, ref, nTo;
for ( var i = 0; i < this.ref.outStack.length; i++ ) { node = dN;
ref = this.ref.outStack[i]; for ( var i = 0; i < this.defName.parsedRef.outStack.length; i++ ) {
ref = this.defName.parsedRef.outStack[i];
if ( (ref instanceof cRef || ref instanceof cRef3D || ref instanceof cArea) && ref.isValid() ) { if ( (ref instanceof cRef || ref instanceof cRef3D || ref instanceof cArea) && ref.isValid() ) {
nTo = this.wb.dependencyFormulas.addNode( ref.getWsId(), ref._cells.replace( this.regSpace, "" ) ); nTo = this.wb.dependencyFormulas.addNode( ref.getWsId(), ref._cells.replace( this.regSpace, "" ) );
...@@ -1352,6 +1353,9 @@ cName.prototype.addDefinedNameNode = function ( nameReParse ) { ...@@ -1352,6 +1353,9 @@ cName.prototype.addDefinedNameNode = function ( nameReParse ) {
this.wb.dependencyFormulas.addEdge2( node, nTo ); this.wb.dependencyFormulas.addEdge2( node, nTo );
} }
} }
else if ( ref instanceof cName ){
this.wb.dependencyFormulas.addEdge2( node, this.defName );
}
} }
return node; return node;
}; };
...@@ -3286,6 +3290,11 @@ parserFormula.prototype = { ...@@ -3286,6 +3290,11 @@ parserFormula.prototype = {
found_operand = null, _3DRefTmp = null; found_operand = null, _3DRefTmp = null;
var cFormulaList = (local && cFormulaFunctionLocalized) ? cFormulaFunctionLocalized : cFormulaFunction; var cFormulaList = (local && cFormulaFunctionLocalized) ? cFormulaFunctionLocalized : cFormulaFunction;
while ( this.pCurrPos < this.Formula.length ) { while ( this.pCurrPos < this.Formula.length ) {
/*if ( parserHelp.isControlSymbols.call( this, this.Formula, this.pCurrPos )){
continue;
}*/
/* Operators*/ /* Operators*/
if ( parserHelp.isOperator.call( this, this.Formula, this.pCurrPos )/* || isNextPtg(this.formula,this.pCurrPos) */ ) { if ( parserHelp.isOperator.call( this, this.Formula, this.pCurrPos )/* || isNextPtg(this.formula,this.pCurrPos) */ ) {
wasLeftParentheses = false; wasLeftParentheses = false;
......
...@@ -924,6 +924,8 @@ DependencyGraph.prototype = { ...@@ -924,6 +924,8 @@ DependencyGraph.prototype = {
} }
if( !oRes.isTable ){ if( !oRes.isTable ){
oRes.parsedRef = new parserFormula(oRes.Ref, "", oRes.wb.getWorksheet(0));
oRes.parsedRef.parse();
oRes.parsedRef.buildDependencies(null,oRes); oRes.parsedRef.buildDependencies(null,oRes);
} }
...@@ -1418,13 +1420,13 @@ function DefNameVertex( scope, defName, defRef, defHidden, wb, isTable ) { ...@@ -1418,13 +1420,13 @@ function DefNameVertex( scope, defName, defRef, defHidden, wb, isTable ) {
this.nodeId = getDefNameVertexId( this.sheetId, defName ); this.nodeId = getDefNameVertexId( this.sheetId, defName );
this.wb = wb; this.wb = wb;
if(!isTable){ /*if(!isTable){
this.parsedRef = new parserFormula(this.Ref, "", this.wb.getWorksheet(0)); this.parsedRef = new parserFormula(this.Ref, "", this.wb.getWorksheet(0));
if( this.Ref ){ if( this.Ref ){
this.parsedRef.parse(); this.parsedRef.parse();
// this.parsedRef.buildDependencies(); // this.parsedRef.buildDependencies();
} }
} }*/
/*else{ /*else{
this.sheetTableId = wb.getActiveWs().getId(); this.sheetTableId = wb.getActiveWs().getId();
}*/ }*/
......
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