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
0f8631d5
Commit
0f8631d5
authored
Oct 05, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add convert area to array
parent
46ecdc40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
12 deletions
+46
-12
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+46
-12
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
0f8631d5
...
...
@@ -2364,6 +2364,22 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
}
return
new
cString
(
str
);
};
cBaseOperator
.
prototype
.
_convertAreaToArray
=
function
(
areaArr
)
{
var
res
=
[];
for
(
var
i
=
0
;
i
<
areaArr
.
length
;
i
++
){
var
elem
=
areaArr
[
i
];
if
(
elem
instanceof
cArea
||
elem
instanceof
cArea3D
){
elem
=
convertAreaToArray
(
elem
);
}
res
.
push
(
elem
);
}
if
(
!
res
.
length
){
res
=
areaArr
;
}
return
res
;
};
/** @constructor */
function
cBaseFunction
(
name
)
{
...
...
@@ -2817,8 +2833,15 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
cAddOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cAddOperator
.
prototype
.
constructor
=
cAddOperator
;
cAddOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
cAddOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
if
(
bIsSpecialFunction
){
var
convertArgs
=
this
.
_convertAreaToArray
([
arg0
,
arg1
]);
arg0
=
convertArgs
[
0
];
arg1
=
convertArgs
[
1
];
}
if
(
arg0
instanceof
cArea
)
{
arg0
=
arg0
.
cross
(
arguments
[
1
]);
}
else
if
(
arg0
instanceof
cArea3D
)
{
...
...
@@ -2952,8 +2975,15 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
cMultOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cMultOperator
.
prototype
.
numFormat
=
cNumFormatNone
;
cMultOperator
.
prototype
.
constructor
=
cMultOperator
;
cMultOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
cMultOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
if
(
bIsSpecialFunction
){
var
convertArgs
=
this
.
_convertAreaToArray
([
arg0
,
arg1
]);
arg0
=
convertArgs
[
0
];
arg1
=
convertArgs
[
1
];
}
if
(
arg0
instanceof
cArea
)
{
arg0
=
arg0
.
cross
(
arguments
[
1
]);
}
else
if
(
arg0
instanceof
cArea3D
)
{
...
...
@@ -3203,20 +3233,12 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
return
this
.
value
=
_func
[
arg0
.
type
][
arg1
.
type
](
arg0
,
arg1
,
"
>=
"
,
arguments
[
1
]);
};
/**
* @constructor
* @extends {cBaseOperator}
*/
function
cSpecialOperandStart
()
{
}
cSpecialOperandStart
.
prototype
.
constructor
=
cSpecialOperandStart
;
cSpecialOperandStart
.
prototype
.
type
=
cElementType
.
specialFunctionStart
;
/**
* @constructor
* @extends {cBaseOperator}
*/
function
cSpecialOperandEnd
()
{
}
...
...
@@ -4721,7 +4743,7 @@ parserFormula.prototype.setFormula = function(formula) {
if
(
startSumproduct
){
counterSumproduct
++
;
if
(
1
===
counterSumproduct
){
//
t.outStack.push(new cSpecialOperandStart());
t
.
outStack
.
push
(
new
cSpecialOperandStart
());
}
}
};
...
...
@@ -4806,7 +4828,7 @@ parserFormula.prototype.setFormula = function(formula) {
counterSumproduct
--
;
if
(
counterSumproduct
<
1
){
startSumproduct
=
false
;
//
t.outStack.push(new cSpecialOperandEnd());
t
.
outStack
.
push
(
new
cSpecialOperandEnd
());
}
}
...
...
@@ -6194,6 +6216,18 @@ function rtl_math_erfc( x ) {
return
fErfc
;
}
function
convertAreaToArray
(
area
){
var
retArr
=
new
cArray
(),
_arg0
;
area
=
area
.
getMatrix
();
for
(
var
iRow
=
0
;
iRow
<
area
.
length
;
iRow
++
)
{
for
(
var
iCol
=
0
;
iCol
<
area
[
iRow
].
length
;
iCol
++
)
{
_arg0
=
area
[
iRow
][
iCol
];
retArr
.
addElement
(
_arg0
);
}
}
return
retArr
;
}
//----------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
window
[
'
AscCommonExcel
'
].
cElementType
=
cElementType
;
...
...
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