Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
851cd12a
Commit
851cd12a
authored
Aug 05, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 32866
parent
00ccb924
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
70 deletions
+64
-70
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+36
-36
cell/model/FormulaObjects/statisticalFunctions.js
cell/model/FormulaObjects/statisticalFunctions.js
+28
-34
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
851cd12a
...
@@ -1047,13 +1047,16 @@ cArea.prototype.isValid = function () {
...
@@ -1047,13 +1047,16 @@ cArea.prototype.isValid = function () {
var
r
=
this
.
getRange
();
var
r
=
this
.
getRange
();
return
!!
r
;
return
!!
r
;
};
};
cArea
.
prototype
.
countCells
=
function
()
{
cArea
.
prototype
.
countCells
=
function
()
{
var
r
=
this
.
getRange
(),
bbox
=
r
.
bbox
,
count
=
(
Math
.
abs
(
bbox
.
c1
-
bbox
.
c2
)
+
1
)
*
(
Math
.
abs
(
bbox
.
r1
-
bbox
.
r2
)
+
1
);
var
r
=
this
.
getRange
(),
bbox
=
r
.
bbox
,
count
=
(
Math
.
abs
(
bbox
.
c1
-
bbox
.
c2
)
+
1
)
*
r
.
_foreachNoEmpty
(
function
()
{
(
Math
.
abs
(
bbox
.
r1
-
bbox
.
r2
)
+
1
);
count
--
;
r
.
_foreachNoEmpty
(
function
(
cell
)
{
}
);
if
(
!
cell
||
!
cell
.
isEmptyTextString
())
{
return
new
cNumber
(
count
);
count
--
;
};
}
});
return
new
cNumber
(
count
);
};
cArea
.
prototype
.
foreach
=
function
(
action
)
{
cArea
.
prototype
.
foreach
=
function
(
action
)
{
var
r
=
this
.
getRange
();
var
r
=
this
.
getRange
();
if
(
r
)
{
if
(
r
)
{
...
@@ -1292,36 +1295,33 @@ cArea3D.prototype.isValid = function () {
...
@@ -1292,36 +1295,33 @@ cArea3D.prototype.isValid = function () {
}
}
return
true
;
return
true
;
};
};
cArea3D
.
prototype
.
countCells
=
function
()
{
cArea3D
.
prototype
.
countCells
=
function
()
{
var
_wsA
=
this
.
wsRange
();
var
_wsA
=
this
.
wsRange
();
var
_val
=
[];
var
_val
=
[];
if
(
_wsA
.
length
<
1
)
{
if
(
_wsA
.
length
<
1
)
{
_val
.
push
(
new
cError
(
cErrorType
.
bad_reference
)
);
_val
.
push
(
new
cError
(
cErrorType
.
bad_reference
));
return
_val
;
return
_val
;
}
}
for
(
var
i
=
0
;
i
<
_wsA
.
length
;
i
++
)
{
var
i
;
if
(
!
_wsA
[
i
]
)
{
for
(
i
=
0
;
i
<
_wsA
.
length
;
i
++
)
{
_val
.
push
(
new
cError
(
cErrorType
.
bad_reference
)
);
if
(
!
_wsA
[
i
])
{
return
_val
;
_val
.
push
(
new
cError
(
cErrorType
.
bad_reference
));
}
return
_val
;
}
}
var
_r
=
this
.
range
(
_wsA
),
bbox
=
_r
[
0
].
bbox
,
count
=
(
Math
.
abs
(
bbox
.
c1
-
bbox
.
c2
)
+
1
)
*
(
Math
.
abs
(
bbox
.
r1
-
bbox
.
r2
)
+
1
);
count
=
_r
.
length
*
count
;
for
(
var
i
=
0
;
i
<
_r
.
length
;
i
++
)
{
_r
[
i
].
_foreachNoEmpty
(
function
(
_cell
)
{
if
(
_cell
.
getType
()
===
CellValueType
.
Number
&&
_cell
.
getValueWithoutFormat
()
===
""
)
{
return
null
;
}
count
--
;
}
return
!
null
;
var
_r
=
this
.
range
(
_wsA
),
bbox
=
_r
[
0
].
bbox
,
count
=
(
Math
.
abs
(
bbox
.
c1
-
bbox
.
c2
)
+
1
)
*
}
);
(
Math
.
abs
(
bbox
.
r1
-
bbox
.
r2
)
+
1
);
}
count
=
_r
.
length
*
count
;
return
new
cNumber
(
count
);
for
(
i
=
0
;
i
<
_r
.
length
;
i
++
)
{
};
_r
[
i
].
_foreachNoEmpty
(
function
(
cell
)
{
if
(
!
cell
||
!
cell
.
isEmptyTextString
())
{
count
--
;
}
});
}
return
new
cNumber
(
count
);
};
cArea3D
.
prototype
.
getMatrix
=
function
()
{
cArea3D
.
prototype
.
getMatrix
=
function
()
{
var
arr
=
[],
r
=
this
.
getRange
(),
res
;
var
arr
=
[],
r
=
this
.
getRange
(),
res
;
for
(
var
k
=
0
;
k
<
r
.
length
;
k
++
)
{
for
(
var
k
=
0
;
k
<
r
.
length
;
k
++
)
{
...
...
cell/model/FormulaObjects/statisticalFunctions.js
View file @
851cd12a
...
@@ -1107,43 +1107,37 @@ cCOUNTA.prototype.getInfo = function () {
...
@@ -1107,43 +1107,37 @@ cCOUNTA.prototype.getInfo = function () {
};
};
};
};
function
cCOUNTBLANK
()
{
function
cCOUNTBLANK
()
{
// cBaseFunction.call( this, "COUNTBLANK" );
this
.
name
=
"
COUNTBLANK
"
;
// this.setArgumentsMin( 1 );
this
.
type
=
cElementType
.
func
;
// this.setArgumentsMax( 1 );
this
.
value
=
null
;
// this.setFormat( this.formatType.noneFormat );
this
.
argumentsMin
=
1
;
this
.
argumentsCurrent
=
0
;
this
.
name
=
"
COUNTBLANK
"
;
this
.
argumentsMax
=
1
;
this
.
type
=
cElementType
.
func
;
this
.
formatType
=
{
this
.
value
=
null
;
def
:
-
1
,
//подразумевается формат первой ячейки входящей в формулу.
this
.
argumentsMin
=
1
;
noneFormat
:
-
2
this
.
argumentsCurrent
=
0
;
};
this
.
argumentsMax
=
1
;
this
.
numFormat
=
this
.
formatType
.
noneFormat
;
this
.
formatType
=
{
def
:
-
1
,
//подразумевается формат первой ячейки входящей в формулу.
noneFormat
:
-
2
};
this
.
numFormat
=
this
.
formatType
.
noneFormat
;
}
cCOUNTBLANK
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cCOUNTBLANK
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
arg
[
0
];
if
(
arg0
instanceof
cArea
||
arg0
instanceof
cArea3D
)
return
this
.
value
=
arg0
.
countCells
();
else
if
(
arg0
instanceof
cRef
||
arg0
instanceof
cRef3D
)
{
return
this
.
value
=
new
cNumber
(
1
);
}
}
else
return
this
.
value
=
new
cError
(
cErrorType
.
bad_reference
);
cCOUNTBLANK
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
};
cCOUNTBLANK
.
prototype
.
Calculate
=
function
(
arg
)
{
cCOUNTBLANK
.
prototype
.
getInfo
=
function
()
{
var
arg0
=
arg
[
0
];
return
{
if
(
arg0
instanceof
cArea
||
arg0
instanceof
cArea3D
)
{
name
:
this
.
name
,
return
this
.
value
=
arg0
.
countCells
();
args
:
"
( argument-list )
"
}
else
if
(
arg0
instanceof
cRef
||
arg0
instanceof
cRef3D
)
{
return
this
.
value
=
new
cNumber
(
1
);
}
else
{
return
this
.
value
=
new
cError
(
cErrorType
.
bad_reference
);
}
};
cCOUNTBLANK
.
prototype
.
getInfo
=
function
()
{
return
{
name
:
this
.
name
,
args
:
"
( argument-list )
"
};
};
};
};
function
cCOUNTIF
()
{
function
cCOUNTIF
()
{
this
.
name
=
"
COUNTIF
"
;
this
.
name
=
"
COUNTIF
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment