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
b0742732
Commit
b0742732
authored
Jul 28, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for TEXTJOIN formula
parent
75d54d01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
7 deletions
+43
-7
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+28
-0
cell/model/FormulaObjects/textanddataFunctions.js
cell/model/FormulaObjects/textanddataFunctions.js
+15
-7
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
b0742732
...
...
@@ -2468,6 +2468,34 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
}
return
null
;
};
cBaseFunction
.
prototype
.
_getOneDimensionalArray
=
function
(
arg
,
type
)
{
var
res
=
[];
var
getValue
=
function
(
curArg
){
if
(
undefined
===
type
||
cElementType
.
string
===
type
){
return
curArg
.
tocString
().
getValue
();
}
else
if
(
cElementType
.
number
===
type
){
return
curArg
.
tocNumber
().
getValue
();
}
};
if
(
cElementType
.
cellsRange
===
arg
.
type
||
cElementType
.
cellsRange3D
===
arg
.
type
)
{
arg
=
arg
.
getMatrix
();
for
(
var
i
=
0
;
i
<
arg
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
arg
[
i
].
length
;
j
++
)
{
res
.
push
(
getValue
(
arg
[
i
][
j
]));
}
}
}
else
if
(
cElementType
.
array
===
arg
.
type
){
arg
.
foreach
(
function
(
elem
)
{
res
.
push
(
getValue
(
elem
));
})
}
else
{
res
.
push
(
getValue
(
arg
));
}
return
res
;
};
/** @constructor */
function
parentLeft
()
{
...
...
cell/model/FormulaObjects/textanddataFunctions.js
View file @
b0742732
...
...
@@ -1806,26 +1806,34 @@
cTEXTJOIN
.
prototype
.
isXLFN
=
true
;
cTEXTJOIN
.
prototype
.
Calculate
=
function
(
arg
)
{
var
oArguments
=
this
.
_prepareArguments
([
arg
[
0
],
arg
[
1
]],
arguments
[
1
],
true
);
var
argClone
=
oArguments
.
args
;
argClone
[
0
]
=
argClone
[
0
].
tocString
();
argClone
[
1
]
=
argClone
[
1
].
tocBool
();
var
argClone
=
[
arg
[
0
],
arg
[
1
]];
argClone
[
1
]
=
arg
[
1
].
tocBool
();
var
argError
;
if
(
argError
=
this
.
_checkErrorArg
(
argClone
))
{
return
this
.
value
=
argError
;
}
var
delimiter
=
argClone
[
0
].
toString
();
var
ignore_empty
=
argClone
[
1
].
toBool
();
var
delimiter
=
argClone
[
0
];
var
delimiterArr
=
this
.
_getOneDimensionalArray
(
delimiter
);
var
delimiterIter
=
0
;
var
concatString
=
function
(
string1
,
string2
){
var
res
=
string1
;
var
delimeterStr
=
string1
===
""
?
""
:
delimiter
;
if
(
""
===
string2
&&
ignore_empty
){
return
res
;
}
var
isStartStr
=
string1
===
""
;
var
delimeterStr
=
isStartStr
?
""
:
delimiterArr
[
delimiterIter
];
if
(
undefined
===
delimeterStr
){
delimiterIter
=
0
;
delimeterStr
=
delimiterArr
[
delimiterIter
];
}
if
(
!
isStartStr
){
delimiterIter
++
;
}
res
+=
delimeterStr
+
string2
;
return
res
;
};
...
...
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