Commit 5f8125b5 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

обработка в а/ф для удаления/добавления строк/столбцов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62657 954022d7-b5bf-4e40-9824-e11837661b57
parent 60fa90a6
...@@ -4346,6 +4346,27 @@ TablePart.prototype.clone = function(ws) { ...@@ -4346,6 +4346,27 @@ TablePart.prototype.clone = function(ws) {
TablePart.prototype.recalc = function(ws) { TablePart.prototype.recalc = function(ws) {
this.DisplayName = ws.workbook.oNameGenerator.getNextTableName(ws, this.Ref); this.DisplayName = ws.workbook.oNameGenerator.getNextTableName(ws, this.Ref);
}; };
TablePart.prototype.moveRef = function(col, row) {
var ref = this.Ref.clone();
ref.setOffset({offsetCol: col ? col : 0, offsetRow: row ? row : 0});
this.Ref = ref;
if(this.AutoFilter)
this.AutoFilter.moveRef(col, row);
};
TablePart.prototype.changeRef = function(col, row, bIsFirst) {
var ref = this.Ref.clone();
if(bIsFirst)
ref.setOffsetFirst({offsetCol: col ? col : 0, offsetRow: row ? row : 0});
else
ref.setOffsetLast({offsetCol: col ? col : 0, offsetRow: row ? row : 0});
this.Ref = ref;
if(this.AutoFilter)
this.AutoFilter.changeRef(col, row, bIsFirst);
};
/** @constructor */ /** @constructor */
function AutoFilter() { function AutoFilter() {
this.Ref = null; this.Ref = null;
...@@ -4384,7 +4405,22 @@ AutoFilter.prototype.addFilterColumn = function() { ...@@ -4384,7 +4405,22 @@ AutoFilter.prototype.addFilterColumn = function() {
this.FilterColumns.push(oNewElem); this.FilterColumns.push(oNewElem);
return oNewElem; return oNewElem;
} };
AutoFilter.prototype.moveRef = function(col, row) {
var ref = this.Ref.clone();
ref.setOffset({offsetCol: col ? col : 0, offsetRow: row ? row : 0});
this.Ref = ref;
};
AutoFilter.prototype.changeRef = function(col, row, bIsFirst) {
var ref = this.Ref.clone();
if(bIsFirst)
ref.setOffsetFirst({offsetCol: col ? col : 0, offsetRow: row ? row : 0});
else
ref.setOffsetLast({offsetCol: col ? col : 0, offsetRow: row ? row : 0});
this.Ref = ref;
};
function FilterColumns() { function FilterColumns() {
this.ColId = null; this.ColId = null;
......
This diff is collapsed.
...@@ -9613,6 +9613,8 @@ ...@@ -9613,6 +9613,8 @@
functionModelAction = function () { functionModelAction = function () {
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
if(isCheckChangeAutoFilter === true)
t.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteCellsAndShiftLeft);
if (range.deleteCellsShiftLeft()) { if (range.deleteCellsShiftLeft()) {
t._cleanCache(oChangeData.changedRange); t._cleanCache(oChangeData.changedRange);
if(isCheckChangeAutoFilter === true) if(isCheckChangeAutoFilter === true)
...@@ -9634,6 +9636,8 @@ ...@@ -9634,6 +9636,8 @@
functionModelAction = function () { functionModelAction = function () {
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
if(isCheckChangeAutoFilter === true)
t.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteCellsAndShiftTop);
if (range.deleteCellsShiftUp()) { if (range.deleteCellsShiftUp()) {
t._cleanCache(oChangeData.changedRange); t._cleanCache(oChangeData.changedRange);
if(isCheckChangeAutoFilter === true) if(isCheckChangeAutoFilter === true)
...@@ -9656,6 +9660,7 @@ ...@@ -9656,6 +9660,7 @@
fullRecalc = true; fullRecalc = true;
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
t.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteColumns);
t.model.removeCols(checkRange.c1, checkRange.c2); t.model.removeCols(checkRange.c1, checkRange.c2);
t.autoFilters.insertColumn(prop, arn, c_oAscDeleteOptions.DeleteColumns); t.autoFilters.insertColumn(prop, arn, c_oAscDeleteOptions.DeleteColumns);
t.objectRender.updateDrawingObject(false, val, checkRange); t.objectRender.updateDrawingObject(false, val, checkRange);
...@@ -9676,6 +9681,7 @@ ...@@ -9676,6 +9681,7 @@
fullRecalc = true; fullRecalc = true;
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
t.autoFilters.isEmptyAutoFilters(arn, c_oAscDeleteOptions.DeleteRows);
t.model.removeRows(checkRange.r1, checkRange.r2); t.model.removeRows(checkRange.r1, checkRange.r2);
t.autoFilters.insertRows(prop, checkRange, c_oAscDeleteOptions.DeleteRows); t.autoFilters.insertRows(prop, checkRange, c_oAscDeleteOptions.DeleteRows);
t.objectRender.updateDrawingObject(false, val, checkRange); t.objectRender.updateDrawingObject(false, val, checkRange);
......
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