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
adb0c220
Commit
adb0c220
authored
May 26, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 32502 - Строка итогов всегда вычисляет функцию в формате General
parent
27010068
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
2 deletions
+82
-2
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+25
-0
cell/model/autofilters.js
cell/model/autofilters.js
+57
-2
No files found.
cell/model/WorkbookElems.js
View file @
adb0c220
...
@@ -5009,6 +5009,31 @@ TablePart.prototype.getRangeWithoutHeaderFooter = function()
...
@@ -5009,6 +5009,31 @@ TablePart.prototype.getRangeWithoutHeaderFooter = function()
return
Asc
.
Range
(
this
.
Ref
.
c1
,
startRow
,
this
.
Ref
.
c2
,
endRow
);
return
Asc
.
Range
(
this
.
Ref
.
c1
,
startRow
,
this
.
Ref
.
c2
,
endRow
);
};
};
TablePart
.
prototype
.
getRangeTableColumnByName
=
function
(
columnName
,
bWithoutHeaderTotal
)
{
var
res
=
null
;
for
(
var
i
=
0
;
i
<
this
.
TableColumns
.
length
;
i
++
)
{
if
(
columnName
===
this
.
TableColumns
[
i
].
Name
)
{
var
startRow
=
this
.
Ref
.
r1
;
var
endRow
=
this
.
Ref
.
r2
;
var
col
=
this
.
Ref
.
c1
+
i
;
if
(
bWithoutHeaderTotal
)
{
startRow
=
this
.
HeaderRowCount
===
null
?
this
.
Ref
.
r1
+
1
:
this
.
Ref
.
r1
;
endRow
=
this
.
TotalsRowCount
?
this
.
Ref
.
r2
-
1
:
this
.
Ref
.
r2
;
}
res
=
Asc
.
Range
(
col
,
startRow
,
col
,
endRow
);
break
;
}
}
return
res
;
};
/** @constructor */
/** @constructor */
function
AutoFilter
()
{
function
AutoFilter
()
{
...
...
cell/model/autofilters.js
View file @
adb0c220
...
@@ -2290,6 +2290,7 @@
...
@@ -2290,6 +2290,7 @@
{
{
var
worksheet
=
this
.
worksheet
;
var
worksheet
=
this
.
worksheet
;
var
isSetValue
=
false
;
var
isSetValue
=
false
;
var
isSetType
=
false
;
var
tablePart
=
this
.
_getFilterByDisplayName
(
tableName
);
var
tablePart
=
this
.
_getFilterByDisplayName
(
tableName
);
...
@@ -2343,6 +2344,7 @@
...
@@ -2343,6 +2344,7 @@
if
(
this
.
_isEmptyCurrentRange
(
rangeUpTable
)
&&
this
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
)
if
(
this
.
_isEmptyCurrentRange
(
rangeUpTable
)
&&
this
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
)
{
{
isSetValue
=
true
;
isSetValue
=
true
;
isSetType
=
true
;
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
tablePart
.
changeRef
(
null
,
1
);
tablePart
.
changeRef
(
null
,
1
);
...
@@ -2352,6 +2354,7 @@
...
@@ -2352,6 +2354,7 @@
worksheet
.
getRange3
(
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
).
addCellsShiftBottom
();
worksheet
.
getRange3
(
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
).
addCellsShiftBottom
();
isSetValue
=
true
;
isSetValue
=
true
;
isSetType
=
true
;
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
tablePart
.
changeRef
(
null
,
1
);
tablePart
.
changeRef
(
null
,
1
);
...
@@ -2415,7 +2418,7 @@
...
@@ -2415,7 +2418,7 @@
{
activeCells
:
tablePart
.
Ref
.
clone
(),
type
:
optionType
,
val
:
val
,
displayName
:
tableName
});
{
activeCells
:
tablePart
.
Ref
.
clone
(),
type
:
optionType
,
val
:
val
,
displayName
:
tableName
});
this
.
_cleanStyleTable
(
tablePart
.
Ref
);
this
.
_cleanStyleTable
(
tablePart
.
Ref
);
this
.
_setColorStyleTable
(
tablePart
.
Ref
,
tablePart
,
null
,
isSetValue
);
this
.
_setColorStyleTable
(
tablePart
.
Ref
,
tablePart
,
null
,
isSetValue
,
isSetType
);
History
.
EndTransaction
();
History
.
EndTransaction
();
return
tablePart
.
Ref
.
clone
();
return
tablePart
.
Ref
.
clone
();
...
@@ -4108,7 +4111,7 @@
...
@@ -4108,7 +4111,7 @@
}
}
},
},
//TODO убрать начеркивание
//TODO убрать начеркивание
_setColorStyleTable
:
function
(
range
,
options
,
isOpenFilter
,
isSetVal
)
_setColorStyleTable
:
function
(
range
,
options
,
isOpenFilter
,
isSetVal
,
isSetTotalRowType
)
{
{
var
worksheet
=
this
.
worksheet
;
var
worksheet
=
this
.
worksheet
;
var
bRedoChanges
=
worksheet
.
workbook
.
bRedoChanges
;
var
bRedoChanges
=
worksheet
.
workbook
.
bRedoChanges
;
...
@@ -4161,6 +4164,14 @@
...
@@ -4161,6 +4164,14 @@
if
(
null
!==
formula
)
if
(
null
!==
formula
)
{
{
range
.
setValue
(
formula
);
range
.
setValue
(
formula
);
if
(
isSetTotalRowType
)
{
var
numFormatType
=
this
.
_getFormatTableColumnRange
(
options
,
tableColumn
.
Name
);
if
(
null
!==
numFormatType
)
{
range
.
setNumFormat
(
numFormatType
);
}
}
}
}
}
}
}
}
...
@@ -4216,6 +4227,50 @@
...
@@ -4216,6 +4227,50 @@
}
}
},
},
_getFormatTableColumnRange
:
function
(
table
,
columnName
)
{
var
worksheet
=
this
.
worksheet
;
var
arrFormat
=
[];
var
res
=
null
;
var
tableRange
=
table
.
getRangeTableColumnByName
(
columnName
,
true
);
if
(
null
!==
tableRange
)
{
for
(
var
i
=
tableRange
.
r1
;
i
<=
tableRange
.
r2
;
i
++
)
{
var
cell
=
worksheet
.
getCell3
(
i
,
tableRange
.
c1
);
var
format
=
cell
.
getNumFormat
();
var
sFromatString
=
format
.
sFormat
;
var
type
=
format
?
format
.
getType
:
null
;
if
(
null
!==
type
)
{
res
=
true
;
if
(
!
arrFormat
[
sFromatString
])
{
arrFormat
[
sFromatString
]
=
0
;
}
arrFormat
[
sFromatString
]
++
;
}
}
}
if
(
res
)
{
var
maxCount
=
0
;
for
(
var
i
in
arrFormat
)
{
if
(
arrFormat
[
i
]
>
maxCount
)
{
maxCount
=
arrFormat
[
i
];
res
=
i
;
}
}
}
return
res
;
},
_cleanStyleTable
:
function
(
sRef
)
_cleanStyleTable
:
function
(
sRef
)
{
{
var
oRange
=
new
AscCommonExcel
.
Range
(
this
.
worksheet
,
sRef
.
r1
,
sRef
.
c1
,
sRef
.
r2
,
sRef
.
c2
);
var
oRange
=
new
AscCommonExcel
.
Range
(
this
.
worksheet
,
sRef
.
r1
,
sRef
.
c1
,
sRef
.
r2
,
sRef
.
c2
);
...
...
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