Commit 1d9eb47e authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 35947

parent 46b48509
...@@ -2004,6 +2004,7 @@ function CT_pivotTableDefinition() { ...@@ -2004,6 +2004,7 @@ function CT_pivotTableDefinition() {
this.pageFieldsPositions = null; this.pageFieldsPositions = null;
this.clearGrid = false; this.clearGrid = false;
this.hasCompact = true;
} }
CT_pivotTableDefinition.prototype.readAttributes = function(attr, uq) { CT_pivotTableDefinition.prototype.readAttributes = function(attr, uq) {
if (attr()) { if (attr()) {
...@@ -2724,6 +2725,7 @@ CT_pivotTableDefinition.prototype.init = function () { ...@@ -2724,6 +2725,7 @@ CT_pivotTableDefinition.prototype.init = function () {
}; };
CT_pivotTableDefinition.prototype.updatePivotType = function () { CT_pivotTableDefinition.prototype.updatePivotType = function () {
this.clearGrid = false; this.clearGrid = false;
this.hasCompact = false;
var field; var field;
var pivotFields = this.asc_getPivotFields(); var pivotFields = this.asc_getPivotFields();
var rowFields = this.asc_getRowFields(); var rowFields = this.asc_getRowFields();
...@@ -2732,7 +2734,9 @@ CT_pivotTableDefinition.prototype.updatePivotType = function () { ...@@ -2732,7 +2734,9 @@ CT_pivotTableDefinition.prototype.updatePivotType = function () {
field = pivotFields[rowFields[i].asc_getIndex()]; field = pivotFields[rowFields[i].asc_getIndex()];
if (false !== field.outline) { if (false !== field.outline) {
this.clearGrid = true; this.clearGrid = true;
break; }
if (false !== field.compact) {
this.hasCompact = true;
} }
} }
} }
......
...@@ -5484,11 +5484,14 @@ ...@@ -5484,11 +5484,14 @@
pivotRange = pivotTable.getRange(); pivotRange = pivotTable.getRange();
if (countR) { if (countR) {
cell = new AscCommon.CellBase(pivotRange.r1 + pivotTable.getFirstHeaderRow0(), pivotRange.c1); countR = pivotTable.hasCompact ? 1 : countR;
for (j = 0; j < countR; ++j) {
cell = new AscCommon.CellBase(pivotRange.r1 + pivotTable.getFirstHeaderRow0(), pivotRange.c1 + j);
if (range.contains2(cell)) { if (range.contains2(cell)) {
res.push(cell); res.push(cell);
} }
} }
}
if (countCWValues) { if (countCWValues) {
cell = new AscCommon.CellBase(pivotRange.r1, pivotRange.c1 + pivotTable.getFirstDataCol()); cell = new AscCommon.CellBase(pivotRange.r1, pivotRange.c1 + pivotTable.getFirstDataCol());
if (range.contains2(cell)) { if (range.contains2(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