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
176bd907
Commit
176bd907
authored
Sep 27, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 35894
clear grid for pivot tables with outline and compact layout
parent
2ca6fa09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
cell/model/PivotTables.js
cell/model/PivotTables.js
+15
-0
cell/model/Workbook.js
cell/model/Workbook.js
+15
-0
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+16
-0
No files found.
cell/model/PivotTables.js
View file @
176bd907
...
...
@@ -2003,6 +2003,7 @@ function CT_pivotTableDefinition() {
this
.
cacheDefinition
=
null
;
this
.
pageFieldsPositions
=
null
;
this
.
clearGrid
=
false
;
}
CT_pivotTableDefinition
.
prototype
.
readAttributes
=
function
(
attr
,
uq
)
{
if
(
attr
())
{
...
...
@@ -2719,6 +2720,20 @@ CT_pivotTableDefinition.prototype.init = function () {
}
this
.
location
.
setPageCount
(
rowPageCount
,
colPageCount
);
this
.
updatePivotType
();
};
CT_pivotTableDefinition
.
prototype
.
updatePivotType
=
function
()
{
this
.
clearGrid
=
false
;
var
field
;
var
pivotFields
=
this
.
asc_getPivotFields
();
var
rowFields
=
this
.
asc_getRowFields
();
for
(
var
i
=
0
;
i
<
rowFields
.
length
;
++
i
)
{
field
=
pivotFields
[
rowFields
[
i
].
asc_getIndex
()];
if
(
false
!==
field
.
outline
)
{
this
.
clearGrid
=
true
;
break
;
}
}
};
CT_pivotTableDefinition
.
prototype
.
intersection
=
function
(
range
)
{
return
(
this
.
location
&&
this
.
location
.
intersection
(
range
))
||
this
.
pageFieldsIntersection
(
range
);
...
...
cell/model/Workbook.js
View file @
176bd907
...
...
@@ -5486,6 +5486,21 @@
}
return
res
;
};
Worksheet
.
prototype
.
getPivotTablesClearRanges
=
function
(
range
)
{
// For outline and compact pivot tables layout we need clear the grid
var
pivotTable
,
pivotRange
,
intersection
,
res
=
[];
for
(
var
i
=
0
;
i
<
this
.
pivotTables
.
length
;
++
i
)
{
pivotTable
=
this
.
pivotTables
[
i
];
if
(
pivotTable
.
clearGrid
)
{
pivotRange
=
pivotTable
.
getRange
();
if
(
intersection
=
pivotRange
.
intersectionSimple
(
range
))
{
res
.
push
(
intersection
);
res
.
push
(
pivotRange
);
}
}
}
return
res
;
};
Worksheet
.
prototype
.
excludeHiddenRows
=
function
(
bExclude
)
{
this
.
bExcludeHiddenRows
=
bExclude
;
};
...
...
cell/view/WorksheetView.js
View file @
176bd907
...
...
@@ -2384,6 +2384,22 @@
}
ctx
.
stroke
();
// Clear grid for pivot tables with classic and outline layout
var
clearRange
,
pivotRange
,
clearRanges
=
this
.
model
.
getPivotTablesClearRanges
(
range
);
ctx
.
setFillStyle
(
this
.
settings
.
cells
.
defaultState
.
background
);
for
(
i
=
0
;
i
<
clearRanges
.
length
;
i
+=
2
)
{
clearRange
=
clearRanges
[
i
];
pivotRange
=
clearRanges
[
i
+
1
];
x1
=
c
[
clearRange
.
c1
].
left
-
offsetX
+
(
clearRange
.
c1
===
pivotRange
.
c1
?
this
.
width_1px
:
0
);
y1
=
r
[
clearRange
.
r1
].
top
-
offsetY
+
(
clearRange
.
r1
===
pivotRange
.
r1
?
this
.
height_1px
:
0
);
x2
=
Math
.
min
(
c
[
clearRange
.
c2
].
left
-
offsetX
+
c
[
clearRange
.
c2
].
width
-
(
clearRange
.
c2
===
pivotRange
.
c2
?
this
.
width_1px
:
0
),
widthCtx
);
y2
=
Math
.
min
(
r
[
clearRange
.
r2
].
top
-
offsetY
+
r
[
clearRange
.
r2
].
height
-
(
clearRange
.
r2
===
pivotRange
.
r2
?
this
.
height_1px
:
0
),
heightCtx
);
ctx
.
fillRect
(
x1
,
y1
,
x2
-
x1
,
y2
-
y1
);
}
};
WorksheetView
.
prototype
.
_drawCellsAndBorders
=
function
(
drawingCtx
,
range
,
offsetXForDraw
,
offsetYForDraw
)
{
...
...
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