Commit 30573e66 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add asc_setShowRowHeaders, asc_setShowColHeaders, asc_setShowRowStripes, asc_setShowColStripes;

parent 6f032292
......@@ -312,6 +312,7 @@ var editor;
AscCommonExcel.g_oUndoRedoComment = new AscCommonExcel.UndoRedoComment(wbModel);
AscCommonExcel.g_oUndoRedoAutoFilters = new AscCommonExcel.UndoRedoAutoFilters(wbModel);
AscCommonExcel.g_oUndoRedoSparklines = new AscCommonExcel.UndoRedoSparklines(wbModel);
AscCommonExcel.g_oUndoRedoPivotTables = new AscCommonExcel.UndoRedoPivotTables(wbModel);
AscCommonExcel.g_DefNameWorksheet = new AscCommonExcel.Worksheet(wbModel, -1);
};
......@@ -559,10 +560,6 @@ var editor;
return this.wb.af_getTablePictures(props, pivot);
};
spreadsheet_api.prototype.asc_changePivotStyle = function (props, pivot) {
};
spreadsheet_api.prototype.getViewMode = function() {
return this.isViewMode;
};
......@@ -1718,6 +1715,30 @@ var editor;
this.collaborativeEditing.onEndCheckLock(callback);
};
spreadsheet_api.prototype._isLockedPivot = function (pivotName, callback) {
var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, /*subType*/null,
this.asc_getActiveWorksheetId(), pivotName);
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
AscCommonExcel.applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeMine, false)) {
// Редактируем сами
AscCommonExcel.applyFunction(callback, true);
return;
} else if (false !==
this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther, false)) {
// Уже ячейку кто-то редактирует
AscCommonExcel.applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
};
spreadsheet_api.prototype._addWorksheet = function (name, i) {
var t = this;
var addWorksheetCallback = function(res) {
......@@ -3457,6 +3478,21 @@ var editor;
this.asc_closeCellEditor();
};
spreadsheet_api.prototype._changePivotStyle = function (pivot, callback) {
var t = this;
var changePivotStyle = function (res) {
if (res) {
History.Create_NewPoint();
History.StartTransaction();
callback();
History.EndTransaction();
t.wb._onWSSelectionChanged();
t.wb.getWorksheet().draw();
}
};
this._isLockedPivot(pivot.asc_getName(), changePivotStyle);
};
/*
* Export
* -----------------------------------------------------------------------------
......@@ -3600,9 +3636,6 @@ var editor;
prot["asc_convertTableToRange"] = prot.asc_convertTableToRange;
prot["asc_getTablePictures"] = prot.asc_getTablePictures;
// Pivot Table
prot["asc_changePivotStyle"] = prot.asc_changePivotStyle;
// Drawing objects interface
prot["asc_showDrawingObjects"] = prot.asc_showDrawingObjects;
......
......@@ -4501,6 +4501,9 @@ CT_PivotTableStyle.prototype.toXml = function(writer, name) {
writer.WriteXmlAttributeBool("showLastColumn", this.showLastColumn);
}
writer.WriteXmlNodeEnd(name, true, true);
};
CT_PivotTableStyle.prototype.set = function() {
};
CT_PivotTableStyle.prototype.asc_getName = function() {
return this.name;
......@@ -4517,6 +4520,42 @@ CT_PivotTableStyle.prototype.asc_getShowRowStripes = function() {
CT_PivotTableStyle.prototype.asc_getShowColStripes = function() {
return this.showColStripes;
};
CT_PivotTableStyle.prototype.asc_setShowRowHeaders = function(api, pivot, newVal) {
if (newVal !== this.showRowHeaders) {
var t = this;
api._changePivotStyle(pivot, function() {t._setShowRowHeaders()});
}
};
CT_PivotTableStyle.prototype.asc_setShowColHeaders = function(api, pivot, newVal) {
if (newVal !== this.showColHeaders) {
var t = this;
api._changePivotStyle(pivot, function() {t._setShowColHeaders()});
}
};
CT_PivotTableStyle.prototype.asc_setShowRowStripes = function(api, pivot, newVal) {
if (newVal !== this.showRowStripes) {
var t = this;
api._changePivotStyle(pivot, function() {t._setShowRowStripes()});
}
};
CT_PivotTableStyle.prototype.asc_setShowColStripes = function(api, pivot, newVal) {
if (newVal !== this.showColStripes) {
var t = this;
api._changePivotStyle(pivot, function() {t._setShowColStripes()});
}
};
CT_PivotTableStyle.prototype._setShowRowHeaders = function(newVal) {
this.showRowHeaders = newVal;
};
CT_PivotTableStyle.prototype._setShowColHeaders = function(newVal) {
this.showColHeaders = newVal;
};
CT_PivotTableStyle.prototype._setShowRowStripes = function(newVal) {
this.showRowStripes = newVal;
};
CT_PivotTableStyle.prototype._setShowColStripes = function(newVal) {
this.showColStripes = newVal;
};
function CT_PivotFilters() {
//Attributes
this.count = null;//0
......@@ -10012,6 +10051,10 @@ prot["asc_getShowRowHeaders"] = prot.asc_getShowRowHeaders;
prot["asc_getShowColHeaders"] = prot.asc_getShowColHeaders;
prot["asc_getShowRowStripes"] = prot.asc_getShowRowStripes;
prot["asc_getShowColStripes"] = prot.asc_getShowColStripes;
prot["asc_setShowRowHeaders"] = prot.asc_setShowRowHeaders;
prot["asc_setShowColHeaders"] = prot.asc_setShowColHeaders;
prot["asc_setShowRowStripes"] = prot.asc_setShowRowStripes;
prot["asc_setShowColStripes"] = prot.asc_setShowColStripes;
prot = CT_CacheField.prototype;
prot["asc_getName"] = prot.asc_getName;
......
......@@ -3806,6 +3806,30 @@ UndoRedoAutoFilters.prototype = {
UndoRedoSparklines.prototype.UndoRedo = function (Type, Data, nSheetId, bUndo) {
};
function UndoRedoPivotTables(wb) {
this.wb = wb;
this.nType = UndoRedoClassTypes.Add(function () {
return AscCommonExcel.g_oUndoRedoPivotTables;
});
}
UndoRedoPivotTables.prototype.getClassType = function () {
return this.nType;
};
UndoRedoPivotTables.prototype.Undo = function (Type, Data, nSheetId) {
this.UndoRedo(Type, Data, nSheetId, true);
};
UndoRedoPivotTables.prototype.Redo = function (Type, Data, nSheetId) {
this.UndoRedo(Type, Data, nSheetId, false);
};
UndoRedoPivotTables.prototype.UndoRedo = function (Type, Data, nSheetId, bUndo) {
var wb = opt_wb ? opt_wb : this.wb;
var ws = wb.getWorksheetById(nSheetId);
if (ws) {
}
};
//----------------------------------------------------------export----------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
window['AscCommonExcel'].UndoRedoItemSerializable = UndoRedoItemSerializable;
......@@ -3834,6 +3858,7 @@ UndoRedoAutoFilters.prototype = {
window['AscCommonExcel'].UndoRedoComment = UndoRedoComment;
window['AscCommonExcel'].UndoRedoAutoFilters = UndoRedoAutoFilters;
window['AscCommonExcel'].UndoRedoSparklines = UndoRedoSparklines;
window['AscCommonExcel'].UndoRedoPivotTables = UndoRedoPivotTables;
window['AscCommonExcel'].g_oUndoRedoWorkbook = null;
window['AscCommonExcel'].g_oUndoRedoCell = null;
......@@ -3843,4 +3868,5 @@ UndoRedoAutoFilters.prototype = {
window['AscCommonExcel'].g_oUndoRedoComment = null;
window['AscCommonExcel'].g_oUndoRedoAutoFilters = null;
window['AscCommonExcel'].g_oUndoRedoSparklines = null;
window['AscCommonExcel'].g_oUndoRedoPivotTables = null;
})(window);
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