Commit 39312f27 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

http://bugzserver/show_bug.cgi?id=29111 - [CoEdit] Рассинхронизация данных при...

http://bugzserver/show_bug.cgi?id=29111 - [CoEdit] Рассинхронизация данных при сортировке значений автофильтра

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62756 954022d7-b5bf-4e40-9824-e11837661b57
parent 7513bcbe
...@@ -1077,7 +1077,7 @@ var maxIndividualValues = 10000; ...@@ -1077,7 +1077,7 @@ var maxIndividualValues = 10000;
{ {
if(aWs.AutoFilter && cloneData.oldFilter.Ref.isIntersect(aWs.AutoFilter.Ref)) if(aWs.AutoFilter && cloneData.oldFilter.Ref.isIntersect(aWs.AutoFilter.Ref))
{ {
aWs.AutoFilter = cloneData.oldFilter; aWs.AutoFilter = cloneData.oldFilter.clone(null);
} }
else if(aWs.TableParts) else if(aWs.TableParts)
{ {
...@@ -1085,7 +1085,7 @@ var maxIndividualValues = 10000; ...@@ -1085,7 +1085,7 @@ var maxIndividualValues = 10000;
{ {
if(cloneData.oldFilter.Ref.isIntersect(aWs.TableParts[l].Ref)) if(cloneData.oldFilter.Ref.isIntersect(aWs.TableParts[l].Ref))
{ {
aWs.TableParts[l] = cloneData.oldFilter; aWs.TableParts[l] = cloneData.oldFilter.clone(null);
//var splitRange = cloneData.oldFilter.Ref.split(':'); //var splitRange = cloneData.oldFilter.Ref.split(':');
var splitRange = cloneData.oldFilter.Ref; var splitRange = cloneData.oldFilter.Ref;
...@@ -1532,6 +1532,8 @@ var maxIndividualValues = 10000; ...@@ -1532,6 +1532,8 @@ var maxIndividualValues = 10000;
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
var ws = this.worksheet; var ws = this.worksheet;
var t = this; var t = this;
var bUndoChanges = aWs.workbook.bUndoChanges;
var bRedoChanges = aWs.workbook.bRedoChanges;
var curFilter, sortRange, filterRef, startCol; var curFilter, sortRange, filterRef, startCol;
var onSortAutoFilterCallback = function(success) var onSortAutoFilterCallback = function(success)
...@@ -1560,12 +1562,13 @@ var maxIndividualValues = 10000; ...@@ -1560,12 +1562,13 @@ var maxIndividualValues = 10000;
var sortCol = new Asc.Range(startCol, filterRef.r1, startCol, filterRef.r2); var sortCol = new Asc.Range(startCol, filterRef.r1, startCol, filterRef.r2);
curFilter.SortState.SortConditions[0].Ref = sortCol; curFilter.SortState.SortConditions[0].Ref = sortCol;
curFilter.SortState.SortConditions[0].ConditionDescending = type; curFilter.SortState.SortConditions[0].ConditionDescending = resType;
cellId = t._rangeToId(cellIdRange); cellId = t._rangeToId(cellIdRange);
//сама сортировка //сама сортировка
ws.cellCommentator.sortComments(sortRange.sort(type, startCol)); if(!bRedoChanges && !bUndoChanges)
ws.cellCommentator.sortComments(sortRange.sort(resType, startCol));
if(curFilter.TableStyleInfo) if(curFilter.TableStyleInfo)
t._setColorStyleTable(curFilter.Ref, curFilter); t._setColorStyleTable(curFilter.Ref, curFilter);
...@@ -1584,7 +1587,7 @@ var maxIndividualValues = 10000; ...@@ -1584,7 +1587,7 @@ var maxIndividualValues = 10000;
if(cellId) if(cellId)
activeRange = t._idToRange(cellId); activeRange = t._idToRange(cellId);
type = type == 'ascending'; var resType = type == 'ascending';
var filter = t.searchRangeInTableParts(activeRange); var filter = t.searchRangeInTableParts(activeRange);
if(filter === -2)//если захвачена часть ф/т if(filter === -2)//если захвачена часть ф/т
...@@ -1607,7 +1610,7 @@ var maxIndividualValues = 10000; ...@@ -1607,7 +1610,7 @@ var maxIndividualValues = 10000;
} }
else//внутри а/ф либо без а/ф либо часть а/ф else//внутри а/ф либо без а/ф либо часть а/ф
{ {
ws.setSelectionInfo("sort", type); ws.setSelectionInfo("sort", resType);
return; return;
} }
} }
......
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