Commit f4ab7d93 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix pivot buttons

parent e8ffcec6
...@@ -5333,7 +5333,7 @@ ...@@ -5333,7 +5333,7 @@
}; };
Worksheet.prototype.getPivotTableButtons = function (range) { Worksheet.prototype.getPivotTableButtons = function (range) {
var res = []; var res = [];
var pivotTable, pivotRange, j, pos, countC, countR; var pivotTable, pivotRange, j, pos, countC, countR, cell;
for (var i = 0; i < this.pivotTables.length; ++i) { for (var i = 0; i < this.pivotTables.length; ++i) {
pivotTable = this.pivotTables[i]; pivotTable = this.pivotTables[i];
if (!pivotTable.intersection(range)) { if (!pivotTable.intersection(range)) {
...@@ -5342,7 +5342,10 @@ ...@@ -5342,7 +5342,10 @@
for (j = 0; j < pivotTable.pageFieldsPositions.length; ++j) { for (j = 0; j < pivotTable.pageFieldsPositions.length; ++j) {
pos = pivotTable.pageFieldsPositions[j]; pos = pivotTable.pageFieldsPositions[j];
res.push(new AscCommon.CellBase(pos.row, pos.col + 1)); cell = new AscCommon.CellBase(pos.row, pos.col + 1);
if (range.contains2(cell)) {
res.push(cell);
}
} }
if (false !== pivotTable.showHeaders) { if (false !== pivotTable.showHeaders) {
...@@ -5351,10 +5354,16 @@ ...@@ -5351,10 +5354,16 @@
pivotRange = pivotTable.getRange(); pivotRange = pivotTable.getRange();
if (countR) { if (countR) {
res.push(new AscCommon.CellBase(pivotRange.r1 + countC, pivotRange.c1)); cell = new AscCommon.CellBase(pivotRange.r1 + countC, pivotRange.c1);
if (range.contains2(cell)) {
res.push(cell);
}
} }
if (countC) { if (countC) {
res.push(new AscCommon.CellBase(pivotRange.r1, pivotRange.c1 + countR)); cell = new AscCommon.CellBase(pivotRange.r1, pivotRange.c1 + countR);
if (range.contains2(cell)) {
res.push(cell);
}
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment