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
e50971d8
Commit
e50971d8
authored
Jun 06, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add CONCAT formula
parent
981d1afc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
1 deletion
+63
-1
cell/model/FormulaObjects/textanddataFunctions.js
cell/model/FormulaObjects/textanddataFunctions.js
+63
-1
No files found.
cell/model/FormulaObjects/textanddataFunctions.js
View file @
e50971d8
...
...
@@ -38,6 +38,7 @@
*/
function
(
window
,
undefined
)
{
// Import
var
cElementType
=
AscCommonExcel
.
cElementType
;
var
CellValueType
=
AscCommon
.
CellValueType
;
var
g_oFormatParser
=
AscCommon
.
g_oFormatParser
;
var
oNumFormatCache
=
AscCommon
.
oNumFormatCache
;
...
...
@@ -56,7 +57,7 @@
var
cFormulaFunctionGroup
=
AscCommonExcel
.
cFormulaFunctionGroup
;
cFormulaFunctionGroup
[
'
TextAndData
'
]
=
cFormulaFunctionGroup
[
'
TextAndData
'
]
||
[];
cFormulaFunctionGroup
[
'
TextAndData
'
].
push
(
cASC
,
cBAHTTEXT
,
cCHAR
,
cCLEAN
,
cCODE
,
cCONCATENATE
,
cDOLLAR
,
cEXACT
,
cFormulaFunctionGroup
[
'
TextAndData
'
].
push
(
cASC
,
cBAHTTEXT
,
cCHAR
,
cCLEAN
,
cCODE
,
cCONCATENATE
,
c
CONCAT
,
c
DOLLAR
,
cEXACT
,
cFIND
,
cFINDB
,
cFIXED
,
cJIS
,
cLEFT
,
cLEFTB
,
cLEN
,
cLENB
,
cLOWER
,
cMID
,
cMIDB
,
cPHONETIC
,
cPROPER
,
cREPLACE
,
cREPLACEB
,
cREPT
,
cRIGHT
,
cRIGHTB
,
cSEARCH
,
cSEARCHB
,
cSUBSTITUTE
,
cT
,
cTEXT
,
cTRIM
,
cUPPER
,
cVALUE
);
...
...
@@ -234,6 +235,7 @@
this
.
argumentsCurrent
=
0
;
}
//TODO пересмотреть функцию!!!
cCONCATENATE
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cCONCATENATE
.
prototype
.
constructor
=
cCONCATENATE
;
cCONCATENATE
.
prototype
.
argumentsMin
=
1
;
...
...
@@ -273,6 +275,66 @@
};
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cCONCAT
()
{
this
.
name
=
"
CONCAT
"
;
this
.
value
=
null
;
this
.
argumentsCurrent
=
0
;
}
cCONCAT
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cCONCAT
.
prototype
.
constructor
=
cCONCAT
;
cCONCAT
.
prototype
.
argumentsMin
=
1
;
cCONCAT
.
prototype
.
numFormat
=
AscCommonExcel
.
cNumFormatNone
;
cCONCAT
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
new
cString
(
""
),
argI
;
for
(
var
i
=
0
;
i
<
this
.
argumentsCurrent
;
i
++
)
{
argI
=
arg
[
i
];
if
(
cElementType
.
cellsRange
===
argI
.
type
||
cElementType
.
cellsRange3D
===
argI
.
type
)
{
var
_arrVal
=
argI
.
getValue
(
this
.
checkExclude
,
this
.
excludeHiddenRows
);
for
(
var
j
=
0
;
j
<
_arrVal
.
length
;
j
++
)
{
var
_arrElem
=
_arrVal
[
j
].
tocString
();
if
(
cElementType
.
error
===
_arrElem
.
type
)
{
return
this
.
value
=
arrVal
[
j
];
}
else
{
arg0
=
new
cString
(
arg0
.
toString
().
concat
(
_arrElem
));
}
}
}
else
{
argI
=
argI
.
tocString
();
if
(
cElementType
.
error
===
argI
.
type
)
{
return
this
.
value
=
argI
;
}
else
if
(
cElementType
.
array
===
argI
.
type
)
{
argI
.
foreach
(
function
(
elem
)
{
if
(
cElementType
.
error
===
elem
.
type
)
{
arg0
=
elem
;
return
true
;
}
arg0
=
new
cString
(
arg0
.
toString
().
concat
(
elem
.
toString
()));
});
if
(
cElementType
.
error
===
arg0
.
type
)
{
return
this
.
value
=
arg0
;
}
}
else
{
arg0
=
new
cString
(
arg0
.
toString
().
concat
(
argI
.
toString
()));
}
}
}
return
this
.
value
=
arg0
;
};
cCONCAT
.
prototype
.
getInfo
=
function
()
{
return
{
name
:
this
.
name
,
args
:
"
(text1, text2, ...)
"
};
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
...
...
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