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

fix: Bug 19794 - Формула COUNTA считается некорректно если в значениях присутствует текст

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49123 954022d7-b5bf-4e40-9824-e11837661b57
parent 36218259
......@@ -775,7 +775,7 @@ var rx_operators = new RegExp( "^ *[-+*/^&%<=>:] *" ),
rgRange = new RegExp( "^\\$?[A-Za-z]+\\$?\\d+:\\$?[A-Za-z]+\\$?\\d+" ),
rgCols = new RegExp( "^\\$?[A-Za-z]+:\\$?[A-Za-z]+" ),
rgRows = new RegExp( "^\\$?\\d+:\\$?\\d+" ),
rx_ref = new RegExp( "^(\\$?[A-Za-z]{1,3}\\$?(\\d{1,7}))([-+*/^&%<=>: ;),]|$)" ),
rx_ref = new RegExp( "^ *(\\$?[A-Za-z]{1,3}\\$?(\\d{1,7}))([-+*/^&%<=>: ;),]|$)" ),
rx_refAll = new RegExp( "^(\\$?[A-Za-z]+\\$?(\\d+))([-+*/^&%<=>: ;),]|$)" ),
rx_ref3D_non_quoted = new XRegExp( "^(?<name_from>[\\p{L}\\d.]+)(:(?<name_to>[\\p{L}\\d.]+))?!" ),
rx_ref3D_quoted = new XRegExp( "^'(?<name_from>(?:''|[^\\[\\]'\\/*?:])*)(?::(?<name_to>(?:''|[^\\[\\]'\\/*?:])*))?'!" ),
......@@ -866,9 +866,8 @@ parserHelper.prototype = {
if ( match != null || match != undefined ) {
if ( match.length >= 3 &&
g_oCellAddressUtils.colstrToColnum( match[1].substr( 0, (match[1].length - match[2].length) ) ) <= g_oCellAddressUtils.colstrToColnum( "XFD" ) &&
parseInt( match[2] ) <= 1048576
) {
this.pCurrPos += match[1].length;
parseInt( match[2] ) <= 1048576 ) {
this.pCurrPos += match[0].indexOf(" ")>-1 ? match[0].length-1 : match[1].length;
this.operand_str = match[1];
return true;
}
......
......@@ -596,21 +596,21 @@ cFormulaFunction.Statistical = {
var _arg = arg[i];
if ( _arg instanceof cRef || _arg instanceof cRef3D ) {
var _argV = _arg.getValue();
if ( _argV instanceof cNumber || _argV instanceof cBool || _argV instanceof cError ) {
if ( !(_argV instanceof cEmpty) ) {
count++;
}
}
else if ( _arg instanceof cArea || _arg instanceof cArea3D ) {
var _argAreaValue = _arg.getValue();
for ( var j = 0; j < _argAreaValue.length; j++ ) {
if ( _argAreaValue[j] instanceof cNumber || _argAreaValue[j] instanceof cBool || _argAreaValue[j] instanceof cError ) {
if ( !(_argAreaValue[j] instanceof cEmpty) ) {
count++;
}
}
}
else if ( _arg instanceof cArray ) {
_arg.foreach( function ( elem ) {
if ( elem instanceof cNumber || elem instanceof cBool || elem instanceof cError ) {
if ( !(elem instanceof cEmpty) ) {
count++;
}
} )
......
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