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
44d7103d
Commit
44d7103d
authored
May 11, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Bug #32335
parent
329b80a4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
13 deletions
+93
-13
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+74
-2
cell/model/autofilters.js
cell/model/autofilters.js
+19
-11
No files found.
cell/model/WorkbookElems.js
View file @
44d7103d
...
...
@@ -4557,8 +4557,11 @@ TablePart.prototype.changeRef = function(col, row, bIsFirst) {
ref
.
setOffsetLast
({
offsetCol
:
col
?
col
:
0
,
offsetRow
:
row
?
row
:
0
});
this
.
Ref
=
ref
;
//event
this
.
handlers
.
trigger
(
"
changeRefTablePart
"
,
this
.
DisplayName
,
this
.
Ref
);
var
endRow
=
this
.
TotalsRowCount
&&
this
.
TotalsRowCount
>=
1
?
this
.
Ref
.
r2
-
1
:
this
.
Ref
.
r2
;
var
refNamedRanges
=
Asc
.
Range
(
this
.
Ref
.
c1
,
this
.
Ref
.
r1
,
this
.
Ref
.
c2
,
endRow
);
this
.
handlers
.
trigger
(
"
changeRefTablePart
"
,
this
.
DisplayName
,
refNamedRanges
);
if
(
this
.
AutoFilter
)
this
.
AutoFilter
.
changeRef
(
col
,
row
,
bIsFirst
);
...
...
@@ -4743,7 +4746,10 @@ TablePart.prototype.getTableRangeForFormula = function(objectParam)
if
(
endCol
===
null
)
endCol
=
startCol
;
res
=
new
Asc
.
Range
(
this
.
Ref
.
c1
+
startCol
,
this
.
Ref
.
r1
+
1
,
this
.
Ref
.
c1
+
endCol
,
this
.
Ref
.
r2
);
var
startRow
=
this
.
HeaderRowCount
===
null
?
this
.
Ref
.
r1
+
1
:
this
.
Ref
.
r1
;
var
endRow
=
this
.
TotalsRowCount
>
0
?
this
.
Ref
.
r2
-
1
:
this
.
Ref
.
r2
;
res
=
new
Asc
.
Range
(
this
.
Ref
.
c1
+
startCol
,
startRow
,
this
.
Ref
.
c1
+
endCol
,
endRow
);
break
;
}
}
...
...
@@ -4831,6 +4837,7 @@ TablePart.prototype.generateTotalsRowLabel = function()
}
this
.
TableColumns
[
0
].
generateTotalsRowLabel
();
this
.
TableColumns
[
this
.
TableColumns
.
length
-
1
].
generateTotalsRowFunction
();
};
TablePart
.
prototype
.
changeDisplayName
=
function
(
newName
)
...
...
@@ -5055,6 +5062,71 @@ TableColumn.prototype.generateTotalsRowLabel = function(){
this
.
TotalsRowLabel
=
"
Summary
"
;
}
};
TableColumn
.
prototype
.
generateTotalsRowFunction
=
function
(){
//TODO добавить в перевод
if
(
this
.
TotalsRowFunction
===
null
)
{
this
.
TotalsRowFunction
=
Asc
.
ETotalsRowFunction
.
totalrowfunctionSum
;
}
};
TableColumn
.
prototype
.
getTotalRowFormula
=
function
(
tablePart
){
var
res
=
null
;
if
(
null
!==
this
.
TotalsRowFunction
)
{
switch
(
this
.
TotalsRowFunction
)
{
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionAverage
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionCount
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionCountNums
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionCustom
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionMax
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionMin
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionNone
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionStdDev
:
{
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionSum
:
{
res
=
"
=SUBTOTAL(109;
"
+
tablePart
.
DisplayName
+
"
[
"
+
this
.
Name
+
"
]
"
;
break
;
}
case
Asc
.
ETotalsRowFunction
.
totalrowfunctionVar
:
{
break
;
}
}
}
else
if
(
null
!==
this
.
TotalsRowFormula
)
{
res
=
this
.
TotalsRowFormula
;
}
return
res
;
};
/** @constructor */
function
TableStyleInfo
()
{
...
...
cell/model/autofilters.js
View file @
44d7103d
...
...
@@ -2162,9 +2162,9 @@
{
var
clearRange
=
new
AscCommonExcel
.
Range
(
worksheet
,
tablePart
.
Ref
.
r2
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
,
tablePart
.
Ref
.
c2
);
this
.
_clearRange
(
clearRange
,
true
);
tablePart
.
changeRef
(
null
,
-
1
);
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
tablePart
.
changeRef
(
null
,
-
1
);
}
else
{
...
...
@@ -2172,19 +2172,19 @@
var
rangeUpTable
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
);
if
(
this
.
_isEmptyCurrentRange
(
rangeUpTable
)
&&
this
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
)
{
tablePart
.
changeRef
(
null
,
1
);
isSetValue
=
true
;
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
tablePart
.
changeRef
(
null
,
1
);
}
else
{
worksheet
.
getRange3
(
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
).
addCellsShiftBottom
();
tablePart
.
changeRef
(
null
,
1
);
isSetValue
=
true
;
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
tablePart
.
changeRef
(
null
,
1
);
}
if
(
val
===
true
)
...
...
@@ -2201,9 +2201,9 @@
{
var
clearRange
=
new
AscCommonExcel
.
Range
(
worksheet
,
tablePart
.
Ref
.
r1
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
,
tablePart
.
Ref
.
c2
);
this
.
_clearRange
(
clearRange
,
true
);
tablePart
.
changeRef
(
null
,
1
,
true
);
tablePart
.
HeaderRowCount
=
tablePart
.
HeaderRowCount
===
null
?
0
:
null
;
tablePart
.
changeRef
(
null
,
1
,
true
);
}
else
{
...
...
@@ -2211,21 +2211,20 @@
var
rangeUpTable
=
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
-
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r1
-
1
);
if
(
this
.
_isEmptyCurrentRange
(
rangeUpTable
)
&&
this
.
searchRangeInTableParts
(
rangeUpTable
)
===
-
1
)
{
tablePart
.
changeRef
(
null
,
-
1
,
true
);
isSetValue
=
true
;
tablePart
.
HeaderRowCount
=
tablePart
.
HeaderRowCount
===
null
?
0
:
null
;
tablePart
.
changeRef
(
null
,
-
1
,
true
);
}
else
{
worksheet
.
getRange3
(
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r2
+
1
,
tablePart
.
Ref
.
c2
).
addCellsShiftBottom
();
worksheet
.
_moveRange
(
tablePart
.
Ref
,
new
Asc
.
Range
(
tablePart
.
Ref
.
c1
,
tablePart
.
Ref
.
r1
+
1
,
tablePart
.
Ref
.
c2
,
tablePart
.
Ref
.
r2
+
1
));
tablePart
.
changeRef
(
null
,
-
1
,
true
);
isSetValue
=
true
;
tablePart
.
HeaderRowCount
=
tablePart
.
HeaderRowCount
===
null
?
0
:
null
;
tablePart
.
changeRef
(
null
,
-
1
,
true
);
}
}
...
...
@@ -3920,12 +3919,21 @@
range
.
setType
(
CellValueType
.
String
);
}
if
(
tableColumn
!==
null
&&
t
ableColumn
.
TotalsRowLabel
!==
null
&&
t
otalsRowCount
>
0
)
if
(
tableColumn
!==
null
&&
totalsRowCount
>
0
)
{
range
=
worksheet
.
getCell3
(
bbox
.
r2
,
ncol
);
if
(
null
!==
tableColumn
.
TotalsRowLabel
)
{
range
.
setValue
(
tableColumn
.
TotalsRowLabel
);
range
.
setType
(
CellValueType
.
String
);
//TODO + далее необходимо добавлять формулу
}
var
formula
=
tableColumn
.
getTotalRowFormula
(
options
);
if
(
null
!==
formula
)
{
range
.
setValue
(
formula
);
}
}
}
}
...
...
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