Commit 16bc6020 authored by Alexander.Trofimov's avatar Alexander.Trofimov

update pivot fields info

parent e61ba2d7
...@@ -253,6 +253,8 @@ var st_datetimegroupingHOUR = 3; ...@@ -253,6 +253,8 @@ var st_datetimegroupingHOUR = 3;
var st_datetimegroupingMINUTE = 4; var st_datetimegroupingMINUTE = 4;
var st_datetimegroupingSECOND = 5; var st_datetimegroupingSECOND = 5;
var st_VALUES = -2;
function FromXml_ST_SourceType(val) { function FromXml_ST_SourceType(val) {
var res = -1; var res = -1;
if ("worksheet" === val) { if ("worksheet" === val) {
...@@ -1679,8 +1681,8 @@ CT_PivotCacheDefinition.prototype.toXml = function(writer) { ...@@ -1679,8 +1681,8 @@ CT_PivotCacheDefinition.prototype.toXml = function(writer) {
} }
writer.WriteXmlNodeEnd("pivotCacheDefinition"); writer.WriteXmlNodeEnd("pivotCacheDefinition");
}; };
CT_PivotCacheDefinition.prototype.getField = function (index) { CT_PivotCacheDefinition.prototype.getFields = function () {
return this.cacheFields && this.cacheFields.cacheField && this.cacheFields.cacheField[index]; return this.cacheFields && this.cacheFields.cacheField;
}; };
function CT_PivotCacheRecords() { function CT_PivotCacheRecords() {
//Attributes //Attributes
...@@ -2620,7 +2622,7 @@ CT_pivotTableDefinition.prototype.getColumnFieldsCount = function () { ...@@ -2620,7 +2622,7 @@ CT_pivotTableDefinition.prototype.getColumnFieldsCount = function () {
var res = 0; var res = 0;
if (this.colFields) { if (this.colFields) {
res = this.colFields.field.length; res = this.colFields.field.length;
if (1 === res && -2 === this.colFields.field[0].x) { if (1 === res && st_VALUES === this.colFields.field[0].x) {
res = 0; res = 0;
} }
} }
...@@ -2650,30 +2652,23 @@ CT_pivotTableDefinition.prototype.asc_getName = function () { ...@@ -2650,30 +2652,23 @@ CT_pivotTableDefinition.prototype.asc_getName = function () {
CT_pivotTableDefinition.prototype.asc_getStyleInfo = function () { CT_pivotTableDefinition.prototype.asc_getStyleInfo = function () {
return this.pivotTableStyleInfo; return this.pivotTableStyleInfo;
}; };
CT_pivotTableDefinition.prototype.asc_getFields = function () { CT_pivotTableDefinition.prototype.asc_getCacheFields = function () {
return this.pivotFields && this.getField(this.pivotFields.pivotField, function (element, index) { return this.cacheDefinition.getFields();
return element.name || this.cacheDefinition.getField(index).name; };
}); CT_pivotTableDefinition.prototype.asc_getPivotFields = function () {
return this.pivotFields && this.pivotFields.pivotField;
}; };
CT_pivotTableDefinition.prototype.asc_getPageFields = function () { CT_pivotTableDefinition.prototype.asc_getPageFields = function () {
return this.pageFields && this.getField(this.pageFields.pageField, function (element) { return this.pageFields && this.pageFields.pageField;
return element.name || this.cacheDefinition.getField(element.fld).name;
});
}; };
CT_pivotTableDefinition.prototype.asc_getColumnFields = function () { CT_pivotTableDefinition.prototype.asc_getColumnFields = function () {
return this.colFields && this.getField(this.colFields.field, function (element) { return this.colFields && this.colFields.field;
return this.cacheDefinition.getField(element.x).name;
});
}; };
CT_pivotTableDefinition.prototype.asc_getRowFields = function () { CT_pivotTableDefinition.prototype.asc_getRowFields = function () {
return this.rowFields && this.getField(this.rowFields.field, function (element) { return this.rowFields && this.rowFields.field;
return this.cacheDefinition.getField(element.x).name;
});
}; };
CT_pivotTableDefinition.prototype.asc_getDataFields = function () { CT_pivotTableDefinition.prototype.asc_getDataFields = function () {
return this.dataFields && this.getField(this.dataFields.dataField, function (element) { return this.dataFields && this.dataFields.dataField;
return element.name || this.cacheDefinition.getField(element.fld).name;
});
}; };
CT_pivotTableDefinition.prototype.forEachColItems = function (callback, thisArg) { CT_pivotTableDefinition.prototype.forEachColItems = function (callback, thisArg) {
return this.colItems && this.colItems.i.forEach(callback, thisArg); return this.colItems && this.colItems.i.forEach(callback, thisArg);
...@@ -6192,6 +6187,9 @@ CT_PivotField.prototype.toXml = function(writer, name) { ...@@ -6192,6 +6187,9 @@ CT_PivotField.prototype.toXml = function(writer, name) {
} }
writer.WriteXmlNodeEnd(name); writer.WriteXmlNodeEnd(name);
}; };
CT_PivotField.prototype.asc_getName = function () {
return this.name;
};
function CT_Field() { function CT_Field() {
//Attributes //Attributes
this.x = null; this.x = null;
...@@ -6213,6 +6211,9 @@ CT_Field.prototype.toXml = function(writer, name) { ...@@ -6213,6 +6211,9 @@ CT_Field.prototype.toXml = function(writer, name) {
} }
writer.WriteXmlNodeEnd(name, true, true); writer.WriteXmlNodeEnd(name, true, true);
}; };
CT_Field.prototype.asc_getIndex = function () {
return this.x;
};
function CT_I() { function CT_I() {
//Attributes //Attributes
this.t = null;//data this.t = null;//data
...@@ -6345,6 +6346,12 @@ CT_PageField.prototype.toXml = function(writer, name) { ...@@ -6345,6 +6346,12 @@ CT_PageField.prototype.toXml = function(writer, name) {
} }
writer.WriteXmlNodeEnd(name); writer.WriteXmlNodeEnd(name);
}; };
CT_PageField.prototype.asc_getName = function () {
return this.name;
};
CT_PageField.prototype.asc_getIndex = function () {
return this.fld;
};
function CT_DataField() { function CT_DataField() {
//Attributes //Attributes
this.name = null; this.name = null;
...@@ -6439,6 +6446,12 @@ CT_DataField.prototype.toXml = function(writer, name) { ...@@ -6439,6 +6446,12 @@ CT_DataField.prototype.toXml = function(writer, name) {
} }
writer.WriteXmlNodeEnd(name); writer.WriteXmlNodeEnd(name);
}; };
CT_DataField.prototype.asc_getName = function () {
return this.name;
};
CT_DataField.prototype.asc_getIndex = function () {
return this.fld;
};
function CT_Format() { function CT_Format() {
//Attributes //Attributes
this.action = null;//formatting this.action = null;//formatting
...@@ -9648,7 +9661,8 @@ var prot; ...@@ -9648,7 +9661,8 @@ var prot;
prot = CT_pivotTableDefinition.prototype; prot = CT_pivotTableDefinition.prototype;
prot["asc_getName"] = prot.asc_getName; prot["asc_getName"] = prot.asc_getName;
prot["asc_getFields"] = prot.asc_getFields; prot["asc_getCacheFields"] = prot.asc_getCacheFields;
prot["asc_getPivotFields"] = prot.asc_getPivotFields;
prot["asc_getStyleInfo"] = prot.asc_getStyleInfo; prot["asc_getStyleInfo"] = prot.asc_getStyleInfo;
prot["asc_getPageFields"] = prot.asc_getPageFields; prot["asc_getPageFields"] = prot.asc_getPageFields;
prot["asc_getColumnFields"] = prot.asc_getColumnFields; prot["asc_getColumnFields"] = prot.asc_getColumnFields;
...@@ -9664,3 +9678,17 @@ prot["asc_getShowColStripes"] = prot.asc_getShowColStripes; ...@@ -9664,3 +9678,17 @@ prot["asc_getShowColStripes"] = prot.asc_getShowColStripes;
prot = CT_CacheField.prototype; prot = CT_CacheField.prototype;
prot["asc_getName"] = prot.asc_getName; prot["asc_getName"] = prot.asc_getName;
prot = CT_PivotField.prototype;
prot["asc_getName"] = prot.asc_getName;
prot = CT_Field.prototype;
prot["asc_getIndex"] = prot.asc_getIndex;
prot = CT_PageField.prototype;
prot["asc_getIndex"] = prot.asc_getIndex;
prot["asc_getName"] = prot.asc_getName;
prot = CT_DataField.prototype;
prot["asc_getIndex"] = prot.asc_getIndex;
prot["asc_getName"] = prot.asc_getName;
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