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

дополнительно для 64770.

fix: Bug 30390 - [NamedRanges] Ошибка в консоли при попытке вычисления формулы, использующей именованный диапазон, в XLSX книге(http://bugzserver/show_bug.cgi?id=30390)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64783 954022d7-b5bf-4e40-9824-e11837661b57
parent f90d7980
......@@ -774,7 +774,7 @@ var str_namedRanges = "A-Za-z\u005F\u0080-\u0081\u0083\u0085-\u0087\u0089-\u008A
rx_Gt = /^ *> */,
rx_Ge = /^ *>= */,
rx_Ne = /^ *<> */,
rg = new XRegExp( "^([\\p{L}\\d.]+ *)[-+*/^&%<=>:;\\(\\)]" ),
rg = new XRegExp( "^((?:_xlfn.)?[\\p{L}\\d.]+ *)[-+*/^&%<=>:;\\(\\)]" ),
// rg = /^([\w\d.]+ *)[-+*\/^&%<=>:;\(\)]/,
rgRange = /^\$?[A-Za-z]+\$?\d+:\$?[A-Za-z]+\$?\d+/,
rgCols = /^\$?[A-Za-z]+:\$?[A-Za-z]+/,
......@@ -818,7 +818,8 @@ var str_namedRanges = "A-Za-z\u005F\u0080-\u0081\u0083\u0085-\u0087\u0089-\u008A
rx_numberDef = /^ *[+-]?\d*(\d|\.)\d*([eE][+-]?\d+)?/,
rx_CommaDef = /^ *[,;] */,
rx_arrayDef = /^\{(([+-]?\d*(\d|\.)\d*([eE][+-]?\d+)?)?(\"((\"\"|[^\"])*)\")?(#NULL!|#DIV\/0!|#VALUE!|#REF!|#NAME\?|#NUM!|#UNSUPPORTED_FUNCTION!|#N\/A|#GETTING_DATA|FALSE|TRUE)?[,;]?)*\}/i,
rx_
rx_ControlSymbols = /^ *[\u0000-\u001F\u007F-\u009F] */,
rx_sFuncPref = /_xlfn\./i;
/**
......@@ -833,6 +834,19 @@ parserHelper.prototype._reset = function () {
this.operand_str = null;
this.pCurrPos = null;
};
parserHelper.prototype.isControlSymbols = function ( formula, start_pos, digitDelim ) {
if ( this instanceof parserHelper ) {
this._reset();
}
var match = (formula.substring( start_pos )).match( rx_ControlSymbols );
if (match != null) {
this.operand_str = match[0];
this.pCurrPos += match[0].length;
return true;
}
return false;
};
parserHelper.prototype.isOperator = function ( formula, start_pos ) {
if (this instanceof parserHelper) {
this._reset();
......
......@@ -1331,14 +1331,13 @@ cName.prototype.addDefinedNameNode = function ( nameReParse ) {
if ( !this.defName || !this.defName.Ref ) {
return this.wb.dependencyFormulas.addDefinedNameNode( this.value, null );
// return this.wb.dependencyFormulas.addDefinedNameNode( this.defName.Name, null );
}
var dN = this.wb.getDefinesNames( this.defName.Name, this.ws.getId() );
// dN = dN.getAscCDefName();
var node/* = this.wb.dependencyFormulas.addDefinedNameNode( dN.Name, dN.LocalSheetId, dN.Ref, dN.Hidden )*/,
wsR, ref, nTo;
node = dN;
var node = this.wb.getDefinesNames( this.defName.Name, this.ws.getId() ), wsR, ref, nTo;
if(!this.defName.parsedRef){
this.defName.parsedRef = new parserFormula( this.defName.Ref, "", this.ws );
this.defName.parsedRef.parse();
}
for ( var i = 0; i < this.defName.parsedRef.outStack.length; i++ ) {
ref = this.defName.parsedRef.outStack[i];
......@@ -1723,7 +1722,7 @@ cBaseFunction.prototype = {
return new cString( localeName + "(" + str + ")" );
},
toString:function () {
return this.name.replace(/_xlfn\./i,"_xlfn.");
return this.name.replace(rx_sFuncPref,"_xlfn.");
},
setCA:function ( arg, ca, numFormat ) {
this.value = arg;
......
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