Commit 7f61cc3e authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

add function asc_changeDisplayNameTable

parent 788b8426
...@@ -675,6 +675,11 @@ var editor; ...@@ -675,6 +675,11 @@ var editor;
var ws = this.wb.getWorksheet(); var ws = this.wb.getWorksheet();
return ws.af_deleteCellsInTable(tableName, optionType); return ws.af_deleteCellsInTable(tableName, optionType);
}; };
spreadsheet_api.prototype.asc_changeDisplayNameTable = function(tableName, newName) {
var ws = this.wb.getWorksheet();
return ws.af_changeDisplayNameTable(tableName, newName);
};
spreadsheet_api.prototype.asc_setMobileVersion = function(isMobile) { spreadsheet_api.prototype.asc_setMobileVersion = function(isMobile) {
this.isMobileVersion = isMobile; this.isMobileVersion = isMobile;
......
...@@ -12844,26 +12844,31 @@ ...@@ -12844,26 +12844,31 @@
var endRow = this.activeRange.r2; var endRow = this.activeRange.r2;
var newActiveRange = null; var newActiveRange = null;
var val;
switch(optionType) switch(optionType)
{ {
case c_oAscInsertOptions.InsertTableRowAbove: case c_oAscInsertOptions.InsertTableRowAbove:
{ {
newActiveRange = new Asc.Range(tablePart.Ref.c1, startRow, tablePart.Ref.c2, endRow); newActiveRange = new Asc.Range(tablePart.Ref.c1, startRow, tablePart.Ref.c2, endRow);
val = c_oAscInsertOptions.InsertCellsAndShiftDown;
break; break;
} }
case c_oAscInsertOptions.InsertTableRowBelow: case c_oAscInsertOptions.InsertTableRowBelow:
{ {
newActiveRange = new Asc.Range(tablePart.Ref.c1, startRow - 1, tablePart.Ref.c2, endRow - 1); newActiveRange = new Asc.Range(tablePart.Ref.c1, startRow - 1, tablePart.Ref.c2, endRow - 1);
val = c_oAscInsertOptions.InsertCellsAndShiftDown;
break; break;
} }
case c_oAscInsertOptions.InsertTableColLeft: case c_oAscInsertOptions.InsertTableColLeft:
{ {
newActiveRange = new Asc.Range(startCol - 1, tablePart.Ref.r1, endCol - 1, tablePart.Ref.r2); newActiveRange = new Asc.Range(startCol - 1, tablePart.Ref.r1, endCol - 1, tablePart.Ref.r2);
val = c_oAscInsertOptions.InsertCellsAndShiftRight;
break; break;
} }
case c_oAscInsertOptions.InsertTableColRight: case c_oAscInsertOptions.InsertTableColRight:
{ {
newActiveRange = new Asc.Range(startCol, tablePart.Ref.r1, endCol, tablePart.Ref.r2); newActiveRange = new Asc.Range(startCol, tablePart.Ref.r1, endCol, tablePart.Ref.r2);
val = c_oAscInsertOptions.InsertCellsAndShiftRight;
break; break;
} }
} }
...@@ -12871,7 +12876,7 @@ ...@@ -12871,7 +12876,7 @@
if(newActiveRange !== null) if(newActiveRange !== null)
{ {
t.activeRange = newActiveRange; t.activeRange = newActiveRange;
t.changeWorksheet("insCell"); t.changeWorksheet("insCell", val);
t.activeRange = acitveRange; t.activeRange = acitveRange;
} }
}; };
...@@ -12895,16 +12900,19 @@ ...@@ -12895,16 +12900,19 @@
var endRow = this.activeRange.r2; var endRow = this.activeRange.r2;
var newActiveRange = null; var newActiveRange = null;
var val;
switch(optionType) switch(optionType)
{ {
case c_oAscInsertOptions.DeleteColumns: case c_oAscInsertOptions.DeleteColumns:
{ {
newActiveRange = new Asc.Range(startCol, tablePart.Ref.r1, endCol, tablePart.Ref.r2); newActiveRange = new Asc.Range(startCol, tablePart.Ref.r1, endCol, tablePart.Ref.r2);
val = c_oAscInsertOptions.DeleteCellsAndShiftLeft;
break; break;
} }
case c_oAscInsertOptions.DeleteRows: case c_oAscInsertOptions.DeleteRows:
{ {
newActiveRange = new Asc.Range(tablePart.Ref.c1, startRow, tablePart.Ref.c2, endRow); newActiveRange = new Asc.Range(tablePart.Ref.c1, startRow, tablePart.Ref.c2, endRow);
val = c_oAscInsertOptions.DeleteCellsAndShiftTop;
break; break;
} }
} }
...@@ -12912,10 +12920,27 @@ ...@@ -12912,10 +12920,27 @@
if(newActiveRange !== null) if(newActiveRange !== null)
{ {
t.activeRange = newActiveRange; t.activeRange = newActiveRange;
t.changeWorksheet("delCell"); t.changeWorksheet("delCell", val);
t.activeRange = acitveRange; t.activeRange = acitveRange;
} }
}; };
WorksheetView.prototype.af_changeDisplayNameTable = function(tableName, newName)
{
var t = this;
var ws = this.model;
var acitveRange = this.activeRange.clone();
var tablePart = ws.autoFilters._getFilterByDisplayName(tableName);
if(!tablePart)
{
return false;
}
//TODO тестовый вариант. нужно сделать методы и добавлять в историю
tablePart.DisplayName = newName;
};
/* /*
* Export * Export
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
......
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