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
74e22264
Commit
74e22264
authored
Jun 17, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 31609
parent
382fdf45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+24
-19
No files found.
cell/view/WorksheetView.js
View file @
74e22264
...
...
@@ -7175,44 +7175,49 @@
WorksheetView
.
prototype
.
getSelectionMathInfo
=
function
()
{
var
ar
=
this
.
activeRange
;
var
range
=
this
.
model
.
getRange3
(
ar
.
r1
,
ar
.
c1
,
ar
.
r2
,
ar
.
c2
);
var
range
=
this
.
model
.
getRange3
(
ar
.
r1
,
ar
.
c1
,
ar
.
r2
,
ar
.
c2
);
var
tmp
;
var
oSelectionMathInfo
=
new
asc_CSelectionMathInfo
();
var
sum
=
0
;
range
.
_setPropertyNoEmpty
(
null
,
null
,
function
(
c
)
{
if
(
false
===
c
.
isEmptyTextString
()
)
{
var
t
=
this
;
range
.
_setPropertyNoEmpty
(
null
,
null
,
function
(
cell
,
r
)
{
if
(
!
cell
.
isEmptyTextString
()
&&
t
.
height_1px
<=
t
.
rows
[
r
].
height
)
{
++
oSelectionMathInfo
.
count
;
if
(
CellValueType
.
Number
===
c
.
getType
()
)
{
tmp
=
parseFloat
(
c
.
getValueWithoutFormat
()
);
if
(
isNaN
(
tmp
)
)
{
if
(
CellValueType
.
Number
===
cell
.
getType
()
)
{
tmp
=
parseFloat
(
cell
.
getValueWithoutFormat
()
);
if
(
isNaN
(
tmp
)
)
{
return
;
}
if
(
0
===
oSelectionMathInfo
.
countNumbers
)
{
if
(
0
===
oSelectionMathInfo
.
countNumbers
)
{
oSelectionMathInfo
.
min
=
oSelectionMathInfo
.
max
=
tmp
;
}
else
{
oSelectionMathInfo
.
min
=
Math
.
min
(
oSelectionMathInfo
.
min
,
tmp
);
oSelectionMathInfo
.
max
=
Math
.
max
(
oSelectionMathInfo
.
max
,
tmp
);
}
else
{
oSelectionMathInfo
.
min
=
Math
.
min
(
oSelectionMathInfo
.
min
,
tmp
);
oSelectionMathInfo
.
max
=
Math
.
max
(
oSelectionMathInfo
.
max
,
tmp
);
}
++
oSelectionMathInfo
.
countNumbers
;
sum
+=
tmp
;
}
}
}
);
});
// Показываем только данные для 2-х или более ячеек (http://bugzserver/show_bug.cgi?id=24115)
if
(
1
<
oSelectionMathInfo
.
countNumbers
)
{
if
(
1
<
oSelectionMathInfo
.
countNumbers
)
{
// Мы должны отдавать в формате активной ячейки
var
numFormat
=
range
.
getNumFormat
();
if
(
Asc
.
c_oAscNumFormatType
.
Time
===
numFormat
.
getType
()
)
{
if
(
Asc
.
c_oAscNumFormatType
.
Time
===
numFormat
.
getType
()
)
{
// Для времени нужно отдавать в формате [h]:mm:ss (http://bugzserver/show_bug.cgi?id=26271)
numFormat
=
AscCommon
.
oNumFormatCache
.
get
(
'
[h]:mm:ss
'
);
numFormat
=
AscCommon
.
oNumFormatCache
.
get
(
'
[h]:mm:ss
'
);
}
oSelectionMathInfo
.
sum
=
numFormat
.
formatToMathInfo
(
sum
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
oSelectionMathInfo
.
average
=
numFormat
.
formatToMathInfo
(
sum
/
oSelectionMathInfo
.
countNumbers
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
oSelectionMathInfo
.
sum
=
numFormat
.
formatToMathInfo
(
sum
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
oSelectionMathInfo
.
average
=
numFormat
.
formatToMathInfo
(
sum
/
oSelectionMathInfo
.
countNumbers
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
oSelectionMathInfo
.
min
=
numFormat
.
formatToMathInfo
(
oSelectionMathInfo
.
min
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
oSelectionMathInfo
.
max
=
numFormat
.
formatToMathInfo
(
oSelectionMathInfo
.
max
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
oSelectionMathInfo
.
min
=
numFormat
.
formatToMathInfo
(
oSelectionMathInfo
.
min
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
oSelectionMathInfo
.
max
=
numFormat
.
formatToMathInfo
(
oSelectionMathInfo
.
max
,
CellValueType
.
Number
,
this
.
settings
.
mathMaxDigCount
);
}
return
oSelectionMathInfo
;
};
...
...
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