Commit 4c745926 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@58762 954022d7-b5bf-4e40-9824-e11837661b57
parent 12dfbf2f
...@@ -206,7 +206,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -206,7 +206,7 @@ var gUndoInsDelCellsFlag = true;
function AddFormatTableOptions () { function AddFormatTableOptions () {
if ( !(this instanceof AddFormatTableOptions) ) {return new AddFormatTableOptions();}; if ( !(this instanceof AddFormatTableOptions) ) {return new AddFormatTableOptions();}
this.Properties = { this.Properties = {
range : 0, range : 0,
...@@ -283,8 +283,8 @@ var gUndoInsDelCellsFlag = true; ...@@ -283,8 +283,8 @@ var gUndoInsDelCellsFlag = true;
if(openFilter != undefined) if(openFilter != undefined)
History.TurnOff(); History.TurnOff();
var paramsForCallBack, paramsForCallBackAdd, filterChange, t = this, newRes, rangeShift1, rangeShift, selectionTable, result, isInsertButton = true, startCell, endCell; var paramsForCallBack, paramsForCallBackAdd, filterChange, t = this, newRes, rangeShift1, rangeShift, selectionTable, result, isInsertButton = true;
var rangeFilter, splitRange, addNameColumn, ref; var rangeFilter, addNameColumn, ref;
if(!addFormatTableOptionsObj) if(!addFormatTableOptionsObj)
addNameColumn = true; addNameColumn = true;
...@@ -341,7 +341,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -341,7 +341,7 @@ var gUndoInsDelCellsFlag = true;
filterChange.TableStyleInfo.Name = lTable; filterChange.TableStyleInfo.Name = lTable;
rangeFilter = filterChange.Ref; rangeFilter = filterChange.Ref;
t._setColorStyleTable(rangeFilter, filterChange) t._setColorStyleTable(rangeFilter, filterChange);
isUpdateRange = rangeFilter; isUpdateRange = rangeFilter;
...@@ -386,7 +386,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -386,7 +386,7 @@ var gUndoInsDelCellsFlag = true;
delete aWs.TableParts[apocal.num].AutoFilter; delete aWs.TableParts[apocal.num].AutoFilter;
isReDrawFilter = aWs.TableParts[apocal.num].clone(aWs); isReDrawFilter = aWs.TableParts[apocal.num].clone(aWs);
} }
}; }
t._showButtonFlag(newRes.result); t._showButtonFlag(newRes.result);
...@@ -407,17 +407,11 @@ var gUndoInsDelCellsFlag = true; ...@@ -407,17 +407,11 @@ var gUndoInsDelCellsFlag = true;
} }
if (bIsActiveSheet) if (bIsActiveSheet)
t._addButtonAF(newRes, bIsOpenFilter); t._addButtonAF(newRes, true);
//перерисовываем форматированную таблиц //перерисовываем форматированную таблиц
if(isReDrawFilter && isReDrawFilter.TableColumns && isReDrawFilter.result) if(isReDrawFilter && isReDrawFilter.TableColumns && isReDrawFilter.result)
t._reDrawCurrentFilter(null, null, isReDrawFilter); t._reDrawCurrentFilter(null, null, isReDrawFilter);
if(!apocal.changeAllFOnTable)
{
if(isInsert && bIsActiveSheet && !bIsOpenFilter)
{
ws.isChanged = true;
}
}
break; break;
} }
case 'changeAllFOnTable': case 'changeAllFOnTable':
...@@ -508,7 +502,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -508,7 +502,7 @@ var gUndoInsDelCellsFlag = true;
if(isInsertButton){ if(isInsertButton){
if (bIsActiveSheet) if (bIsActiveSheet)
t._addButtonAF(newRes, bIsOpenFilter); t._addButtonAF(newRes, true);
} }
else if(!t.allButtonAF) else if(!t.allButtonAF)
t.allButtonAF = []; t.allButtonAF = [];
...@@ -517,7 +511,6 @@ var gUndoInsDelCellsFlag = true; ...@@ -517,7 +511,6 @@ var gUndoInsDelCellsFlag = true;
{ {
if(openFilter == undefined) if(openFilter == undefined)
{ {
ws.isChanged = true;
arn.c1 = arn.c1 - 1; arn.c1 = arn.c1 - 1;
arn.c2 = arn.c2 - 1; arn.c2 = arn.c2 - 1;
arn.r1 = arn.r1 - 1; arn.r1 = arn.r1 - 1;
...@@ -568,7 +561,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -568,7 +561,7 @@ var gUndoInsDelCellsFlag = true;
break; break;
} }
}; }
if(paramsForCallBack == "setStyleTableForAutoFilter1" || paramsForCallBack == "setStyleTableForAutoFilter") if(paramsForCallBack == "setStyleTableForAutoFilter1" || paramsForCallBack == "setStyleTableForAutoFilter")
{ {
...@@ -576,7 +569,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -576,7 +569,7 @@ var gUndoInsDelCellsFlag = true;
{activeCells: activeCells, lTable: lTable}); {activeCells: activeCells, lTable: lTable});
if (bIsActiveSheet) if (bIsActiveSheet)
t._addButtonAF(newRes, bIsOpenFilter); t._addButtonAF(newRes, true);
if(ref) if(ref)
{ {
...@@ -588,7 +581,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -588,7 +581,7 @@ var gUndoInsDelCellsFlag = true;
isUpdateRange = rangeFilter; isUpdateRange = rangeFilter;
recalc = true; recalc = true;
}; }
} }
else if(paramsForCallBackAdd)//добавляем а/ф else if(paramsForCallBackAdd)//добавляем а/ф
{ {
...@@ -622,7 +615,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -622,7 +615,7 @@ var gUndoInsDelCellsFlag = true;
if(addNameColumn && !isTurnOffHistory) if(addNameColumn && !isTurnOffHistory)
tempCells.r2 = tempCells.r2 + 1; tempCells.r2 = tempCells.r2 + 1;
}; }
result = t._getResultAddFilter(paramsForCallBackAdd, activeCells, mainAdjacentCells, lTable); result = t._getResultAddFilter(paramsForCallBackAdd, activeCells, mainAdjacentCells, lTable);
...@@ -639,7 +632,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -639,7 +632,7 @@ var gUndoInsDelCellsFlag = true;
History.TurnOn(); History.TurnOn();
return false; return false;
} }
}; }
if(paramsForCallBackAdd) if(paramsForCallBackAdd)
...@@ -670,7 +663,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -670,7 +663,7 @@ var gUndoInsDelCellsFlag = true;
aWs.AutoFilter.result = result; aWs.AutoFilter.result = result;
aWs.AutoFilter.Ref = Asc.g_oRangeCache.getAscRange(result[0].id + ':' + result[result.length -1].idNext); aWs.AutoFilter.Ref = Asc.g_oRangeCache.getAscRange(result[0].id + ':' + result[result.length -1].idNext);
} }
}; }
newRes = newRes =
{ {
...@@ -681,7 +674,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -681,7 +674,7 @@ var gUndoInsDelCellsFlag = true;
var ref = var ref =
{ {
Ref: Asc.g_oRangeCache.getAscRange(result[0].id + ':' + result[result.length -1].idNext) Ref: Asc.g_oRangeCache.getAscRange(result[0].id + ':' + result[result.length -1].idNext)
}; }
if(addNameColumn && addFormatTableOptionsObj) if(addNameColumn && addFormatTableOptionsObj)
addFormatTableOptionsObj.range = ref; addFormatTableOptionsObj.range = ref;
...@@ -689,10 +682,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -689,10 +682,7 @@ var gUndoInsDelCellsFlag = true;
{activeCells: activeCells, lTable: lTable, addFormatTableOptionsObj: addFormatTableOptionsObj}); {activeCells: activeCells, lTable: lTable, addFormatTableOptionsObj: addFormatTableOptionsObj});
if(isInsertButton){ if(isInsertButton){
if (bIsActiveSheet) t._addButtonAF(newRes, true);
t._addButtonAF(newRes, bIsOpenFilter);
else
t._addButtonAF(newRes, true);
} }
else if(!t.allButtonAF) else if(!t.allButtonAF)
t.allButtonAF = []; t.allButtonAF = [];
...@@ -702,7 +692,6 @@ var gUndoInsDelCellsFlag = true; ...@@ -702,7 +692,6 @@ var gUndoInsDelCellsFlag = true;
{ {
if(openFilter == undefined) if(openFilter == undefined)
{ {
ws.isChanged = true;
arn.c1 = arn.c1 - 1; arn.c1 = arn.c1 - 1;
arn.c2 = arn.c2 - 1; arn.c2 = arn.c2 - 1;
arn.r1 = arn.r1 - 1; arn.r1 = arn.r1 - 1;
...@@ -710,7 +699,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -710,7 +699,7 @@ var gUndoInsDelCellsFlag = true;
} }
// ToDo - и еще это обновление стоит после switch, в котором тоже происходит обновление - возможно будет 2 раза // ToDo - и еще это обновление стоит после switch, в котором тоже происходит обновление - возможно будет 2 раза
rangeFilter = new Asc.Range(arn.c1, arn.r1, arn.c2, arn.r2); rangeFilter = new Asc.Range(arn.c1, arn.r1, arn.c2, arn.r2);
}; }
if(paramsForCallBackAdd && !bIsOpenFilter && !aWs.workbook.bCollaborativeChanges && (paramsForCallBackAdd == "addTableFilterOneCell" || paramsForCallBackAdd == "addTableFilterManyCells")) if(paramsForCallBackAdd && !bIsOpenFilter && !aWs.workbook.bCollaborativeChanges && (paramsForCallBackAdd == "addTableFilterOneCell" || paramsForCallBackAdd == "addTableFilterManyCells"))
ws._onEndAddFormatTable(rangeFilter, true); ws._onEndAddFormatTable(rangeFilter, true);
...@@ -773,8 +762,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -773,8 +762,7 @@ var gUndoInsDelCellsFlag = true;
rangeShift = filterChange.Ref; rangeShift = filterChange.Ref;
paramsForCallBack = 'changeStyle'; paramsForCallBack = 'changeStyle';
//rangeShift1 = t._getAscRange(rangeShift.bbox);
rangeShift1 = rangeShift; rangeShift1 = rangeShift;
if(isTurnOffHistory) if(isTurnOffHistory)
...@@ -866,8 +854,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -866,8 +854,7 @@ var gUndoInsDelCellsFlag = true;
rangeShift = filterChange.Ref; rangeShift = filterChange.Ref;
paramsForCallBack = 'changeStyleWithoutFilter'; paramsForCallBack = 'changeStyleWithoutFilter';
//rangeShift1 = t._getAscRange(rangeShift.bbox);
rangeShift1 = rangeShift; rangeShift1 = rangeShift;
if(isTurnOffHistory) if(isTurnOffHistory)
...@@ -914,8 +901,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -914,8 +901,7 @@ var gUndoInsDelCellsFlag = true;
rangeShift = ourFilter.Ref; rangeShift = ourFilter.Ref;
paramsForCallBack = 'setStyleTableForAutoFilter1'; paramsForCallBack = 'setStyleTableForAutoFilter1';
//rangeShift1 = t._getAscRange(rangeShift.bbox);
rangeShift1 = rangeShift; rangeShift1 = rangeShift;
if(isTurnOffHistory) if(isTurnOffHistory)
...@@ -932,13 +918,13 @@ var gUndoInsDelCellsFlag = true; ...@@ -932,13 +918,13 @@ var gUndoInsDelCellsFlag = true;
ws.handlers.trigger("selectionChanged", ws.getSelectionInfo()); ws.handlers.trigger("selectionChanged", ws.getSelectionInfo());
return true; return true;
} }
}; }
var mergedRange; var mergedRange;
if(activeCells && activeCells != null) if(activeCells && activeCells != null)
mergedRange = ws.model.getRange3(activeCells.r1, activeCells.c1, activeCells.r2, activeCells.c2).hasMerged() mergedRange = ws.model.getRange3(activeCells.r1, activeCells.c1, activeCells.r2, activeCells.c2).hasMerged();
//при открытии //при открытии
if(openFilter != undefined) if(openFilter != undefined)
...@@ -1115,17 +1101,17 @@ var gUndoInsDelCellsFlag = true; ...@@ -1115,17 +1101,17 @@ var gUndoInsDelCellsFlag = true;
isInsertButton = false; isInsertButton = false;
} }
aWs.TableParts[openFilter].result = result; aWs.TableParts[openFilter].result = result;
}; }
newRes = newRes =
{ {
result: result, result: result,
isVis: true isVis: true
}; }
if(isInsertButton){ if(isInsertButton){
//данные фунцкии не занимаются отрисовкой, а заполняют необходимые массивы. нужно для совместного редактировния в случае неактивного листа. //данные фунцкии не занимаются отрисовкой, а заполняют необходимые массивы. нужно для совместного редактировния в случае неактивного листа.
this._addButtonAF(newRes, bIsOpenFilter); this._addButtonAF(newRes, true);
} }
else if(!this.allButtonAF) else if(!this.allButtonAF)
this.allButtonAF = []; this.allButtonAF = [];
......
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