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
3b514ca3
Commit
3b514ca3
authored
Jul 28, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ previous
parent
8ecfbee5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
35 deletions
+31
-35
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+10
-15
cell/model/FormulaObjects/textanddataFunctions.js
cell/model/FormulaObjects/textanddataFunctions.js
+21
-20
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
3b514ca3
...
...
@@ -2479,31 +2479,26 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
}
};
if
(
cElementType
.
cellsRange
===
arg
.
type
||
cElementType
.
cellsRange3D
===
arg
.
type
)
{
if
(
cElementType
.
cellsRange
===
arg
.
type
||
cElementType
.
cellsRange3D
===
arg
.
type
||
cElementType
.
array
===
arg
.
type
)
{
if
(
cElementType
.
cellsRange
===
arg
.
type
||
cElementType
.
array
===
arg
.
type
)
{
arg
=
arg
.
getMatrix
();
}
else
if
(
cElementType
.
cellsRange3D
===
arg
.
type
)
{
arg
=
arg
.
getMatrix
()[
0
];
}
for
(
var
i
=
0
;
i
<
arg
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
arg
[
i
].
length
;
j
++
)
{
if
(
cElementType
.
error
===
arg
[
i
][
j
].
type
){
res
=
arg
[
i
][
j
];
break
;
return
arg
[
i
][
j
];
}
else
{
res
.
push
(
getValue
(
arg
[
i
][
j
]));
}
}
}
}
else
if
(
cElementType
.
array
===
arg
.
type
){
arg
.
foreach
(
function
(
elem
)
{
if
(
cElementType
.
error
===
elem
.
type
){
res
=
elem
;
return
;
}
else
{
res
.
push
(
getValue
(
elem
));
}
})
}
else
{
if
(
cElementType
.
error
===
arg
.
type
){
res
=
elem
;
return
;
return
arg
;
}
else
{
res
.
push
(
getValue
(
arg
));
}
...
...
cell/model/FormulaObjects/textanddataFunctions.js
View file @
3b514ca3
...
...
@@ -1802,6 +1802,7 @@
cTEXTJOIN
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cTEXTJOIN
.
prototype
.
constructor
=
cTEXTJOIN
;
cTEXTJOIN
.
prototype
.
argumentsMin
=
3
;
cTEXTJOIN
.
prototype
.
argumentsMax
=
255
;
cTEXTJOIN
.
prototype
.
numFormat
=
AscCommonExcel
.
cNumFormatNone
;
cTEXTJOIN
.
prototype
.
isXLFN
=
true
;
cTEXTJOIN
.
prototype
.
Calculate
=
function
(
arg
)
{
...
...
@@ -1817,7 +1818,9 @@
var
ignore_empty
=
argClone
[
1
].
toBool
();
var
delimiter
=
argClone
[
0
];
var
delimiterIter
=
0
;
//разделитель может быть в виде массива, где используются все его элементы
var
delimiterArr
=
this
.
_getOneDimensionalArray
(
delimiter
);
//если хотя бы один элемент ошибка, то возвращаем ошибку
if
(
delimiterArr
instanceof
cError
){
return
this
.
value
=
delimiterArr
;
}
...
...
@@ -1828,16 +1831,17 @@
return
res
;
}
var
isStartStr
=
string1
===
""
;
var
delimeterStr
=
isStartStr
?
""
:
delimiterArr
[
delimiterIter
];
if
(
undefined
===
delimeterStr
){
//выбираем разделитель из массива по порядку
var
delimiterStr
=
isStartStr
?
""
:
delimiterArr
[
delimiterIter
];
if
(
undefined
===
delimiterStr
){
delimiterIter
=
0
;
delim
e
terStr
=
delimiterArr
[
delimiterIter
];
delim
i
terStr
=
delimiterArr
[
delimiterIter
];
}
if
(
!
isStartStr
){
delimiterIter
++
;
}
res
+=
delim
e
terStr
+
string2
;
res
+=
delim
i
terStr
+
string2
;
return
res
;
};
...
...
@@ -1845,30 +1849,27 @@
for
(
var
i
=
2
;
i
<
this
.
argumentsCurrent
;
i
++
)
{
argI
=
arg
[
i
];
if
(
argI
instanceof
cArea
||
argI
instanceof
cArray
||
argI
instanceof
cArea3D
){
if
(
argI
instanceof
cArea
||
argI
instanceof
cArray
)
{
argI
=
argI
.
getMatrix
();
}
else
if
(
argI
instanceof
cArea3D
)
{
argI
=
argI
.
getMatrix
()[
0
];
var
type
=
argI
.
type
;
if
(
cElementType
.
cellsRange
===
type
||
cElementType
.
cellsRange3D
===
type
||
cElementType
.
array
===
type
){
//получаем одномерный массив
argI
=
this
.
_getOneDimensionalArray
(
argI
);
//если хотя бы один элемент с ошибкой, возвращаем ошибку
if
(
argI
instanceof
cError
)
{
return
this
.
value
=
argI
;
}
for
(
var
n
=
0
;
n
<
argI
.
length
;
n
++
)
{
for
(
var
j
=
0
;
j
<
argI
[
n
].
length
;
j
++
)
{
if
(
cElementType
.
error
===
argI
[
n
][
j
].
type
){
return
this
.
value
=
argI
[
n
][
j
];
}
else
{
arg0
=
new
cString
(
concatString
(
arg0
.
toString
(),
argI
[
n
][
j
].
toString
()));
}
}
arg0
=
new
cString
(
concatString
(
arg0
.
toString
(),
argI
[
n
].
toString
()));
}
}
else
{
argI
=
argI
.
tocString
();
if
(
arg0
instanceof
cError
)
{
return
this
.
value
=
arg0
;
}
else
{
arg0
=
new
cString
(
concatString
(
arg0
.
toString
(),
argI
.
toString
()));
if
(
argI
instanceof
cError
)
{
return
this
.
value
=
argI
;
}
arg0
=
new
cString
(
concatString
(
arg0
.
toString
(),
argI
.
toString
()));
}
}
...
...
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