Commit 4374a8ce authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

+ к rev.62657

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62680 954022d7-b5bf-4e40-9824-e11837661b57
parent 3651a356
......@@ -4339,8 +4339,10 @@ TablePart.prototype.clone = function(ws) {
res.result.push(this.result[i].clone());
}
res.DisplayName = this.DisplayName;
if(ws !== null)
res.recalc(ws);
return res;
};
TablePart.prototype.recalc = function(ws) {
......
......@@ -1346,13 +1346,13 @@ var maxIndividualValues = 10000;
filter.moveRef(diff);
}
else if(activeRange.c1 > ref.c1 && activeRange.c2 >= ref.c2 && diff < 0)//parts of after filter
else if(activeRange.c1 > ref.c1 && activeRange.c2 >= ref.c2 && activeRange.c1 < ref.c2 && diff < 0)//parts of after filter
{
oldFilter = filter.clone(null);
filter.changeRef(activeRange.c1 - ref.c2 - 1);
}
else if((activeRange.c1 >= ref.c1 && activeRange.c1 <= ref.c2 && activeRange.c2 <= ref.c2) || (activeRange.c1 > ref.c1 && activeRange.c2 >= ref.c2 && diff > 0))//inside
else if((activeRange.c1 >= ref.c1 && activeRange.c1 <= ref.c2 && activeRange.c2 <= ref.c2) || (activeRange.c1 > ref.c1 && activeRange.c2 >= ref.c2 && activeRange.c1 < ref.c2 && diff > 0))//inside
{
oldFilter = filter.clone(null);
filter.changeRef(diff);
......@@ -1666,6 +1666,18 @@ var maxIndividualValues = 10000;
return false;
},
isActiveRangeIntersectionAutoFilter: function(addFormatTableOptionsObj)
{
var res = false;
var aWs = this._getCurrentWS();
var activeRange = Asc.g_oRangeCache.getAscRange(addFormatTableOptionsObj.asc_getRange());
if(activeRange && aWs.AutoFilter && aWs.AutoFilter.Ref.intersection(activeRange))
res = true;
return res;
},
_moveAutoFilters: function(arnTo, arnFrom, data, copyRange)
{
//проверяем покрывает ли диапазон хотя бы один автофильтр
......
......@@ -10827,11 +10827,15 @@
isApplyAutoFilter = info.isAutoFilter;
isApplyFormatTable = info.tableStyleName;
var isActiveRangeIntersectionAutoFilter = null;
if(lTable && addFormatTableOptionsObj && isApplyAutoFilter)
isActiveRangeIntersectionAutoFilter = t.autoFilters.isActiveRangeIntersectionAutoFilter(addFormatTableOptionsObj);
if(!lTable && isApplyAutoFilter)//delete filter in AutoFilter or TablePart
t.autoFilters.deleteAutoFilter(ar);
else if(!lTable && !isApplyAutoFilter)//add autoFilter
t.autoFilters.addAutoFilter(lTable, ar);
else if(lTable && !isApplyFormatTable && !isApplyAutoFilter)//add TablePart
else if(lTable && !isApplyFormatTable && (!isApplyAutoFilter || (isApplyAutoFilter && !isActiveRangeIntersectionAutoFilter)))//add TablePart
t.autoFilters.addAutoFilter(lTable, ar, addFormatTableOptionsObj);
else if(lTable && isApplyFormatTable)//change TablePart
t.autoFilters.changeTableStyleInfo(lTable, ar);
......
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