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 () {
var
r
=
this
.
getRange
();
return
!!
r
;
};
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
);
r
.
_foreachNoEmpty
(
function
()
{
count
--
;
}
);
return
new
cNumber
(
count
);
};
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
);
r
.
_foreachNoEmpty
(
function
(
cell
)
{
if
(
!
cell
||
!
cell
.
isEmptyTextString
())
{
count
--
;
}
});
return
new
cNumber
(
count
);
};
cArea
.
prototype
.
foreach
=
function
(
action
)
{
var
r
=
this
.
getRange
();
if
(
r
)
{
...
...
@@ -1292,36 +1295,33 @@ cArea3D.prototype.isValid = function () {
}
return
true
;
};
cArea3D
.
prototype
.
countCells
=
function
()
{
var
_wsA
=
this
.
wsRange
();
var
_val
=
[];
if
(
_wsA
.
length
<
1
)
{
_val
.
push
(
new
cError
(
cErrorType
.
bad_reference
)
);
return
_val
;
}
for
(
var
i
=
0
;
i
<
_wsA
.
length
;
i
++
)
{
if
(
!
_wsA
[
i
]
)
{
_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
;
}
cArea3D
.
prototype
.
countCells
=
function
()
{
var
_wsA
=
this
.
wsRange
();
var
_val
=
[];
if
(
_wsA
.
length
<
1
)
{
_val
.
push
(
new
cError
(
cErrorType
.
bad_reference
));
return
_val
;
}
var
i
;
for
(
i
=
0
;
i
<
_wsA
.
length
;
i
++
)
{
if
(
!
_wsA
[
i
])
{
_val
.
push
(
new
cError
(
cErrorType
.
bad_reference
));
return
_val
;
}
count
--
;
return
!
null
;
}
);
}
return
new
cNumber
(
count
);
};
}
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
(
i
=
0
;
i
<
_r
.
length
;
i
++
)
{
_r
[
i
].
_foreachNoEmpty
(
function
(
cell
)
{
if
(
!
cell
||
!
cell
.
isEmptyTextString
())
{
count
--
;
}
});
}
return
new
cNumber
(
count
);
};
cArea3D
.
prototype
.
getMatrix
=
function
()
{
var
arr
=
[],
r
=
this
.
getRange
(),
res
;
for
(
var
k
=
0
;
k
<
r
.
length
;
k
++
)
{
...
...
cell/model/FormulaObjects/statisticalFunctions.js
View file @
851cd12a
...
...
@@ -1107,43 +1107,37 @@ cCOUNTA.prototype.getInfo = function () {
};
};
function
cCOUNTBLANK
()
{
// cBaseFunction.call( this, "COUNTBLANK" );
// this.setArgumentsMin( 1 );
// this.setArgumentsMax( 1 );
// this.setFormat( this.formatType.noneFormat );
this
.
name
=
"
COUNTBLANK
"
;
this
.
type
=
cElementType
.
func
;
this
.
value
=
null
;
this
.
argumentsMin
=
1
;
this
.
argumentsCurrent
=
0
;
this
.
argumentsMax
=
1
;
this
.
formatType
=
{
def
:
-
1
,
//подразумевается формат первой ячейки входящей в формулу.
noneFormat
:
-
2
};
this
.
numFormat
=
this
.
formatType
.
noneFormat
;
}
function
cCOUNTBLANK
()
{
this
.
name
=
"
COUNTBLANK
"
;
this
.
type
=
cElementType
.
func
;
this
.
value
=
null
;
this
.
argumentsMin
=
1
;
this
.
argumentsCurrent
=
0
;
this
.
argumentsMax
=
1
;
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
.
getInfo
=
function
()
{
return
{
name
:
this
.
name
,
args
:
"
( argument-list )
"
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
.
getInfo
=
function
()
{
return
{
name
:
this
.
name
,
args
:
"
( argument-list )
"
};
};
};
function
cCOUNTIF
()
{
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