Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
f956912a
Commit
f956912a
authored
Jan 17, 2017
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE] FormatSettingsDialog: Use asc_getCurrencySymbols
parent
05e60468
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
18 deletions
+35
-18
apps/spreadsheeteditor/main/app/controller/Toolbar.js
apps/spreadsheeteditor/main/app/controller/Toolbar.js
+5
-2
apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js
apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js
+30
-16
No files found.
apps/spreadsheeteditor/main/app/controller/Toolbar.js
View file @
f956912a
...
...
@@ -889,7 +889,10 @@ define([
if
(
this
.
api
)
this
.
api
.
asc_setCellFormat
(
record
.
format
);
}
else
{
var
me
=
this
;
var
me
=
this
,
value
=
Common
.
localStorage
.
getItem
(
"
sse-settings-reg-settings
"
);
value
=
(
value
!==
null
)
?
parseInt
(
value
)
:
((
me
.
toolbar
.
mode
.
lang
)
?
parseInt
(
Common
.
util
.
LanguageInfo
.
getLocalLanguageCode
(
me
.
toolbar
.
mode
.
lang
))
:
0x0409
);
(
new
SSE
.
Views
.
FormatSettingsDialog
({
api
:
me
.
api
,
handler
:
function
(
result
,
settings
)
{
...
...
@@ -898,7 +901,7 @@ define([
}
Common
.
NotificationCenter
.
trigger
(
'
edit:complete
'
,
me
.
toolbar
);
},
props
:
{
formatType
:
me
.
_state
.
numformattype
}
props
:
{
formatType
:
me
.
_state
.
numformattype
,
langId
:
value
}
})).
show
();
}
Common
.
NotificationCenter
.
trigger
(
'
edit:complete
'
,
this
.
toolbar
);
...
...
apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js
View file @
f956912a
...
...
@@ -81,6 +81,9 @@ define([
{
displayValue
:
this
.
txtAs100
,
value
:
"
# ??/100
"
}
];
me
.
CurrencySymbolsData
=
null
;
me
.
langId
=
0x0409
;
_
.
extend
(
this
.
options
,
{
title
:
this
.
textTitle
,
template
:
[
...
...
@@ -201,17 +204,11 @@ define([
this
.
cmbSymbols
=
new
Common
.
UI
.
ComboBox
({
el
:
$
(
'
#format-settings-combo-symbols
'
),
cls
:
'
input-group-nr
'
,
menuStyle
:
'
min-width: 140px
'
,
menuStyle
:
'
min-width: 140px
;max-height:210px;
'
,
editable
:
false
,
data
:
[
{
displayValue
:
this
.
txtDollar
,
value
:
0
},
{
displayValue
:
this
.
txtEuro
,
value
:
1
},
{
displayValue
:
this
.
txtPound
,
value
:
2
},
{
displayValue
:
this
.
txtRouble
,
value
:
3
},
{
displayValue
:
this
.
txtYen
,
value
:
4
}
]
data
:
[],
scrollAlwaysVisible
:
true
});
this
.
cmbSymbols
.
setValue
(
0
);
this
.
cmbSymbols
.
on
(
'
selected
'
,
_
.
bind
(
this
.
onSymbolsSelect
,
this
));
this
.
cmbType
=
new
Common
.
UI
.
ComboBox
({
...
...
@@ -256,7 +253,10 @@ define([
_setDefaults
:
function
(
props
)
{
if
(
props
)
{
if
(
this
.
langId
)
this
.
langId
=
props
.
langId
;
this
.
cmbFormat
.
setValue
(
props
.
formatType
,
this
.
txtCustom
);
this
.
onFormatSelect
(
this
.
cmbFormat
,
this
.
cmbFormat
.
getSelectedRecord
());
// for fraction - if props.format not in cmbType - setValue(this.txtCustom)
// for date/time - if props.format not in cmbType - setValue(this.api.asc_getLocaleExample2(props.format, 37973))
...
...
@@ -298,7 +298,7 @@ define([
var
format
=
this
.
api
.
asc_getFormatCells
(
info
),
data
=
[];
format
.
forEach
(
function
(
item
)
{
data
.
push
({
value
:
item
,
displayValue
:
me
.
api
.
asc_getLocaleExample2
(
item
,
1234.12345678901234567890
)});
data
.
push
({
value
:
item
,
displayValue
:
me
.
api
.
asc_getLocaleExample2
(
item
,
-
1234.12345678901234567890
)});
});
this
.
cmbNegative
.
setData
(
data
);
this
.
cmbNegative
.
selectRecord
(
this
.
cmbNegative
.
store
.
at
(
0
));
...
...
@@ -320,7 +320,7 @@ define([
if
(
this
.
FormatType
==
Asc
.
c_oAscNumFormatType
.
Number
||
this
.
FormatType
==
Asc
.
c_oAscNumFormatType
.
Currency
||
this
.
FormatType
==
Asc
.
c_oAscNumFormatType
.
Accounting
)
{
var
data
=
[];
format
.
forEach
(
function
(
item
)
{
data
.
push
({
value
:
item
,
displayValue
:
me
.
api
.
asc_getLocaleExample2
(
item
,
1234.12345678901234567890
)});
data
.
push
({
value
:
item
,
displayValue
:
me
.
api
.
asc_getLocaleExample2
(
item
,
-
1234.12345678901234567890
)});
});
this
.
cmbNegative
.
setData
(
data
);
this
.
cmbNegative
.
selectRecord
(
this
.
cmbNegative
.
store
.
at
(
0
));
...
...
@@ -343,7 +343,7 @@ define([
var
format
=
this
.
api
.
asc_getFormatCells
(
info
),
data
=
[];
format
.
forEach
(
function
(
item
)
{
data
.
push
({
value
:
item
,
displayValue
:
me
.
api
.
asc_getLocaleExample2
(
item
,
1234.12345678901234567890
)});
data
.
push
({
value
:
item
,
displayValue
:
me
.
api
.
asc_getLocaleExample2
(
item
,
-
1234.12345678901234567890
)});
});
this
.
cmbNegative
.
setData
(
data
);
this
.
cmbNegative
.
selectRecord
(
this
.
cmbNegative
.
store
.
at
(
0
));
...
...
@@ -374,20 +374,34 @@ define([
hasSeparator
=
(
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Number
),
hasType
=
(
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Date
||
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Time
||
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Fraction
),
hasSymbols
=
(
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Accounting
||
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Currency
),
hasCode
=
(
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Custom
);
hasCode
=
(
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Custom
),
me
=
this
;
if
(
record
.
value
!==
Asc
.
c_oAscNumFormatType
.
Custom
)
{
var
info
=
new
Asc
.
asc_CFormatCellsInfo
();
info
.
asc_setType
(
record
.
value
);
info
.
asc_setDecimalPlaces
(
hasDecimal
?
this
.
spnDecimal
.
getNumberValue
()
:
0
);
info
.
asc_setSeparator
(
hasSeparator
?
this
.
chSeparator
.
getValue
()
==
'
checked
'
:
false
);
info
.
asc_setSymbol
(
hasSymbols
?
this
.
cmbSymbols
.
getValue
()
:
false
);
if
(
hasNegative
||
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Date
||
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Time
)
{
if
(
hasSymbols
)
{
if
(
!
me
.
CurrencySymbolsData
)
{
me
.
CurrencySymbolsData
=
[];
var
symbolssarr
=
this
.
api
.
asc_getCurrencySymbols
();
for
(
var
code
in
symbolssarr
)
{
if
(
symbolssarr
.
hasOwnProperty
(
code
))
{
me
.
CurrencySymbolsData
.
push
({
value
:
parseInt
(
code
),
displayValue
:
symbolssarr
[
code
]
+
'
'
+
Common
.
util
.
LanguageInfo
.
getLocalLanguageName
(
code
)[
1
]});
}
}
this
.
cmbSymbols
.
setData
(
this
.
CurrencySymbolsData
);
this
.
cmbSymbols
.
setValue
(
this
.
langId
);
}
info
.
asc_setSymbol
(
this
.
cmbSymbols
.
getValue
());
}
var
formatsarr
=
this
.
api
.
asc_getFormatCells
(
info
),
data
=
[],
exampleVal
=
(
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Date
)
?
37973
:
((
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Time
)
?
0.123
:
parseFloat
(
"
1234.12345678901234567890
"
)),
me
=
this
;
exampleVal
=
(
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Date
)
?
37973
:
((
record
.
value
==
Asc
.
c_oAscNumFormatType
.
Time
)
?
0.123
:
parseFloat
(
"
-1234.12345678901234567890
"
));
formatsarr
.
forEach
(
function
(
item
)
{
data
.
push
({
value
:
item
,
displayValue
:
me
.
api
.
asc_getLocaleExample2
(
item
,
exampleVal
)});
});
...
...
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