Commit b5d1be46 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Add containsFirstLineRange function - содержится ли первая строка в диапазоне.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64118 954022d7-b5bf-4e40-9824-e11837661b57
parent 9c7e5fb2
...@@ -1160,8 +1160,7 @@ var maxIndividualValues = 10000; ...@@ -1160,8 +1160,7 @@ var maxIndividualValues = 10000;
var bbox = oRange.getBBox0(); var bbox = oRange.getBBox0();
//смотрим находится ли фильтр(первая его строчка) внутри выделенного фрагмента //смотрим находится ли фильтр(первая его строчка) внутри выделенного фрагмента
if(activeCells.r1 <= bbox.r1 && activeCells.r2 >= bbox.r1 && activeCells.c1 <= bbox.c1 && activeCells.c2 >= bbox.c2) if (activeCells.containsFirstLineRange(bbox)) {
{
if(isTablePart) if(isTablePart)
oRange.setTableStyle(null); oRange.setTableStyle(null);
else else
...@@ -1179,8 +1178,7 @@ var maxIndividualValues = 10000; ...@@ -1179,8 +1178,7 @@ var maxIndividualValues = 10000;
if(isTablePart) if(isTablePart)
aWs.workbook.dependencyFormulas.delTableName(oldFilter.DisplayName,aWs.getName()) aWs.workbook.dependencyFormulas.delTableName(oldFilter.DisplayName,aWs.getName())
} } else
else
return oldFilter; return oldFilter;
}; };
...@@ -1210,14 +1208,9 @@ var maxIndividualValues = 10000; ...@@ -1210,14 +1208,9 @@ var maxIndividualValues = 10000;
cleanFormat: function(range) cleanFormat: function(range)
{ {
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
//if first row AF in ActiveRange - delete AF
if(aWs.AutoFilter && aWs.AutoFilter.Ref) if(aWs.AutoFilter && aWs.AutoFilter.Ref && range.containsFirstLineRange(aWs.AutoFilter.Ref))
{ this.isEmptyAutoFilters(aWs.AutoFilter.Ref);
//if first row AF in ActiveRange - delete AF
var firstRowRange = new Asc.Range(aWs.AutoFilter.Ref.c1, aWs.AutoFilter.Ref.r1, aWs.AutoFilter.Ref.c2, aWs.AutoFilter.Ref.r1);
if(range.containsRange(firstRowRange))
this.isEmptyAutoFilters(aWs.AutoFilter.Ref);
}
}, },
isCheckMoveRange: function(arnFrom) isCheckMoveRange: function(arnFrom)
...@@ -4210,7 +4203,7 @@ var maxIndividualValues = 10000; ...@@ -4210,7 +4203,7 @@ var maxIndividualValues = 10000;
rangeFilter = aWs.AutoFilter.Ref; rangeFilter = aWs.AutoFilter.Ref;
if(range.c1 <= rangeFilter.c1 && range.r1 <= rangeFilter.r1 && range.c2 >= rangeFilter.c2 && range.r2 >= rangeFilter.r2) if(range.c1 <= rangeFilter.c1 && range.r1 <= rangeFilter.r1 && range.c2 >= rangeFilter.c2 && range.r2 >= rangeFilter.r2)
{ {
result[result.length] = aWs.AutoFilter result[result.length] = aWs.AutoFilter;
} }
} }
if(aWs.TableParts) if(aWs.TableParts)
......
...@@ -234,6 +234,10 @@ ...@@ -234,6 +234,10 @@
return this.contains(range.c1, range.r1) && this.contains(range.c2, range.r2); return this.contains(range.c1, range.r1) && this.contains(range.c2, range.r2);
}, },
containsFirstLineRange: function (range) {
return this.contains(range.c1, range.r1) && this.contains(range.c2, range.r1);
},
intersection: function (range) { intersection: function (range) {
var s1 = this.clone(true), var s1 = this.clone(true),
s2 = range instanceof Range ? range.clone(true) : s2 = range instanceof Range ? range.clone(true) :
...@@ -492,6 +496,9 @@ ...@@ -492,6 +496,9 @@
ActiveRange.prototype.containsRange = function () { ActiveRange.prototype.containsRange = function () {
return ActiveRange.superclass.containsRange.apply(this, arguments); return ActiveRange.superclass.containsRange.apply(this, arguments);
}; };
ActiveRange.prototype.containsFirstLine = function () {
return ActiveRange.superclass.containsFirstLineRange.apply(this, arguments);
};
ActiveRange.prototype.intersection = function () { ActiveRange.prototype.intersection = function () {
var oRes = ActiveRange.superclass.intersection.apply(this, arguments); var oRes = ActiveRange.superclass.intersection.apply(this, arguments);
if(null != oRes) if(null != oRes)
......
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