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
81a3ba9f
Commit
81a3ba9f
authored
Feb 06, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use functionArgumentSeparator dependent on locale for formulas with tables
parent
c259b185
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+10
-2
cell/view/CellEditorView.js
cell/view/CellEditorView.js
+2
-2
common/editorscommon.js
common/editorscommon.js
+9
-5
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
81a3ba9f
...
@@ -1694,13 +1694,21 @@ cStrucTable.prototype.toLocaleString = function () {
...
@@ -1694,13 +1694,21 @@ cStrucTable.prototype.toLocaleString = function () {
var
i
;
var
i
;
for
(
i
=
0
;
i
<
this
.
hdtIndexes
.
length
;
++
i
)
{
for
(
i
=
0
;
i
<
this
.
hdtIndexes
.
length
;
++
i
)
{
if
(
0
!=
i
)
{
if
(
0
!=
i
)
{
tblStr
+=
FormulaSeparators
.
functionArgumentSeparatorDef
;
if
(
isLocal
)
{
tblStr
+=
FormulaSeparators
.
functionArgumentSeparator
;
}
else
{
tblStr
+=
FormulaSeparators
.
functionArgumentSeparatorDef
;
}
}
}
tblStr
+=
"
[
"
+
this
.
_buildLocalTableString
(
this
.
hdtIndexes
[
i
],
isLocal
)
+
"
]
"
;
tblStr
+=
"
[
"
+
this
.
_buildLocalTableString
(
this
.
hdtIndexes
[
i
],
isLocal
)
+
"
]
"
;
}
}
if
(
this
.
hdtcstartIndex
)
{
if
(
this
.
hdtcstartIndex
)
{
if
(
this
.
hdtIndexes
.
length
>
0
)
{
if
(
this
.
hdtIndexes
.
length
>
0
)
{
tblStr
+=
FormulaSeparators
.
functionArgumentSeparatorDef
;
if
(
isLocal
)
{
tblStr
+=
FormulaSeparators
.
functionArgumentSeparator
;
}
else
{
tblStr
+=
FormulaSeparators
.
functionArgumentSeparatorDef
;
}
}
}
var
hdtcstart
=
this
.
hdtcstartIndex
.
name
.
replace
(
/#/g
,
"
'#
"
);
var
hdtcstart
=
this
.
hdtcstartIndex
.
name
.
replace
(
/#/g
,
"
'#
"
);
tblStr
+=
"
[
"
+
hdtcstart
+
"
]
"
;
tblStr
+=
"
[
"
+
hdtcstart
+
"
]
"
;
...
...
cell/view/CellEditorView.js
View file @
81a3ba9f
...
@@ -818,7 +818,7 @@
...
@@ -818,7 +818,7 @@
var
bbox
=
AscCommonExcel
.
g_oRangeCache
.
getActiveRange
(
this
.
options
.
cellName
);
var
bbox
=
AscCommonExcel
.
g_oRangeCache
.
getActiveRange
(
this
.
options
.
cellName
);
this
.
_formula
=
new
AscCommonExcel
.
parserFormula
(
s
.
substr
(
1
),
null
,
ws
);
this
.
_formula
=
new
AscCommonExcel
.
parserFormula
(
s
.
substr
(
1
),
null
,
ws
);
this
.
_formula
.
parse
();
this
.
_formula
.
parse
(
true
,
true
);
var
r
,
offset
,
_e
,
_s
,
wsName
=
null
,
refStr
,
isName
=
false
,
_sColorPos
;
var
r
,
offset
,
_e
,
_s
,
wsName
=
null
,
refStr
,
isName
=
false
,
_sColorPos
;
...
@@ -943,7 +943,7 @@
...
@@ -943,7 +943,7 @@
var
bbox
=
AscCommonExcel
.
g_oRangeCache
.
getActiveRange
(
this
.
options
.
cellName
);
var
bbox
=
AscCommonExcel
.
g_oRangeCache
.
getActiveRange
(
this
.
options
.
cellName
);
this
.
_formula
=
new
AscCommonExcel
.
parserFormula
(
s
.
substr
(
1
),
null
,
ws
);
this
.
_formula
=
new
AscCommonExcel
.
parserFormula
(
s
.
substr
(
1
),
null
,
ws
);
this
.
_formula
.
parse
();
this
.
_formula
.
parse
(
true
,
true
);
if
(
this
.
_formula
.
RefPos
&&
this
.
_formula
.
RefPos
.
length
>
0
)
{
if
(
this
.
_formula
.
RefPos
&&
this
.
_formula
.
RefPos
.
length
>
0
)
{
for
(
var
index
=
0
;
index
<
this
.
_formula
.
RefPos
.
length
;
index
++
)
{
for
(
var
index
=
0
;
index
<
this
.
_formula
.
RefPos
.
length
;
index
++
)
{
...
...
common/editorscommon.js
View file @
81a3ba9f
...
@@ -716,15 +716,18 @@ function build_local_rx(data){
...
@@ -716,15 +716,18 @@ function build_local_rx(data){
function
build_rx_table_local
(
local
){
function
build_rx_table_local
(
local
){
rx_table_local
=
build_rx_table
(
local
);
rx_table_local
=
build_rx_table
(
local
);
}
}
function
build_rx_table
(
local
){
function
build_rx_table
(
local
)
{
cStrucTableLocalColumns
=
(
local
?
local
:
{
"
h
"
:
"
Headers
"
,
"
d
"
:
"
Data
"
,
"
a
"
:
"
All
"
,
"
tr
"
:
"
This row
"
,
"
t
"
:
"
Totals
"
}
);
cStrucTableLocalColumns
=
(
local
?
local
:
{
"
h
"
:
"
Headers
"
,
"
d
"
:
"
Data
"
,
"
a
"
:
"
All
"
,
"
tr
"
:
"
This row
"
,
"
t
"
:
"
Totals
"
}
);
return
build_rx_table_cur
();
}
function
build_rx_table_cur
(){
var
loc_all
=
cStrucTableLocalColumns
[
'
a
'
],
var
loc_all
=
cStrucTableLocalColumns
[
'
a
'
],
loc_headers
=
cStrucTableLocalColumns
[
'
h
'
],
loc_headers
=
cStrucTableLocalColumns
[
'
h
'
],
loc_data
=
cStrucTableLocalColumns
[
'
d
'
],
loc_data
=
cStrucTableLocalColumns
[
'
d
'
],
loc_totals
=
cStrucTableLocalColumns
[
'
t
'
],
loc_totals
=
cStrucTableLocalColumns
[
'
t
'
],
loc_this_row
=
cStrucTableLocalColumns
[
'
tr
'
],
loc_this_row
=
cStrucTableLocalColumns
[
'
tr
'
],
structured_tables_headata
=
new
XRegExp
(
'
(?:
\\
[
\\
#
'
+
loc_headers
+
'
\\
]
\\
,
\\
[
\\
#
'
+
loc_data
+
'
\\
])
'
),
structured_tables_headata
=
new
XRegExp
(
'
(?:
\\
[
\\
#
'
+
loc_headers
+
'
\\
]
\\
'
+
FormulaSeparators
.
functionArgumentSeparator
+
'
\\
[
\\
#
'
+
loc_data
+
'
\\
])
'
),
structured_tables_datals
=
new
XRegExp
(
'
(?:
\\
[
\\
#
'
+
loc_data
+
'
\\
]
\\
,
\\
[
\\
#
'
+
loc_totals
+
'
\\
])
'
),
structured_tables_datals
=
new
XRegExp
(
'
(?:
\\
[
\\
#
'
+
loc_data
+
'
\\
]
\\
'
+
FormulaSeparators
.
functionArgumentSeparator
+
'
\\
[
\\
#
'
+
loc_totals
+
'
\\
])
'
),
structured_tables_userColumn
=
new
XRegExp
(
'
(?:[
'
+
str_namedRanges
+
'
\\
d.]|
\\
u0027[#
\\
[
\\
]
\\
u0027]|
\\
u0020|
\\
u0025)+
'
),
structured_tables_userColumn
=
new
XRegExp
(
'
(?:[
'
+
str_namedRanges
+
'
\\
d.]|
\\
u0027[#
\\
[
\\
]
\\
u0027]|
\\
u0020|
\\
u0025)+
'
),
structured_tables_reservedColumn
=
new
XRegExp
(
'
\\
#(?:
'
+
loc_all
+
'
|
'
+
loc_headers
+
'
|
'
+
loc_totals
+
'
|
'
+
loc_data
+
'
|
'
+
loc_this_row
+
'
)|@
'
);
structured_tables_reservedColumn
=
new
XRegExp
(
'
\\
#(?:
'
+
loc_all
+
'
|
'
+
loc_headers
+
'
|
'
+
loc_totals
+
'
|
'
+
loc_data
+
'
|
'
+
loc_this_row
+
'
)|@
'
);
...
@@ -736,7 +739,7 @@ function build_rx_table(local){
...
@@ -736,7 +739,7 @@ function build_rx_table(local){
"
userColumnRange
"
:
XRegExp
.
build
(
'
\\
[(?<colStart>{{uc}})
\\
]
\\
:
\\
[(?<colEnd>{{uc}})
\\
]
'
,
{
"
userColumnRange
"
:
XRegExp
.
build
(
'
\\
[(?<colStart>{{uc}})
\\
]
\\
:
\\
[(?<colEnd>{{uc}})
\\
]
'
,
{
"
uc
"
:
structured_tables_userColumn
"
uc
"
:
structured_tables_userColumn
}
),
}
),
"
hdtcc
"
:
XRegExp
.
build
(
'
(?<hdt>
\\
[{{rc}}
\\
]|{{hd}}|{{dt}})(?:
\\
,
(?:
\\
[(?<hdtcstart>{{uc}})
\\
])(?:
\\
:(?:
\\
[(?<hdtcend>{{uc}})
\\
]))?)?
'
,
{
"
hdtcc
"
:
XRegExp
.
build
(
'
(?<hdt>
\\
[{{rc}}
\\
]|{{hd}}|{{dt}})(?:
\\
'
+
FormulaSeparators
.
functionArgumentSeparator
+
'
(?:
\\
[(?<hdtcstart>{{uc}})
\\
])(?:
\\
:(?:
\\
[(?<hdtcend>{{uc}})
\\
]))?)?
'
,
{
"
rc
"
:
structured_tables_reservedColumn
,
"
rc
"
:
structured_tables_reservedColumn
,
"
hd
"
:
structured_tables_headata
,
"
hd
"
:
structured_tables_headata
,
"
dt
"
:
structured_tables_datals
,
"
dt
"
:
structured_tables_datals
,
...
@@ -1743,6 +1746,7 @@ parserHelper.prototype.setDigitSeparator = function( sep ){
...
@@ -1743,6 +1746,7 @@ parserHelper.prototype.setDigitSeparator = function( sep ){
// build_rx_array_local( cBoolLocal, digitSeparatorDef, null);
// build_rx_array_local( cBoolLocal, digitSeparatorDef, null);
rx_arraySeparators
=
new
RegExp
(
"
^ *[
"
+
FormulaSeparators
.
arrayRowSeparatorDef
+
"
\\
"
+
FormulaSeparators
.
arrayColSeparatorDef
+
"
] *
"
);
rx_arraySeparators
=
new
RegExp
(
"
^ *[
"
+
FormulaSeparators
.
arrayRowSeparatorDef
+
"
\\
"
+
FormulaSeparators
.
arrayColSeparatorDef
+
"
] *
"
);
}
}
rx_table_local
=
build_rx_table_cur
();
};
};
parserHelper
.
prototype
.
getColumnTypeByName
=
function
(
value
)
{
parserHelper
.
prototype
.
getColumnTypeByName
=
function
(
value
)
{
var
res
;
var
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