Commit 52e952c3 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил использование функции intersection (можно вызывать isIntersect).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57684 954022d7-b5bf-4e40-9824-e11837661b57
parent 301a5628
......@@ -388,27 +388,18 @@ function FrozenPlace(ws, type) {
_this.isCellInside = function(cell) {
var result = false;
if ( cell && _this.range ) {
if (cell && _this.range) {
var cellRange = new asc_Range(cell.col, cell.row, cell.col, cell.row);
var _r = _this.range.intersection(cellRange);
if ( _r ) {
if ( log )
console.log( cell.col + "," + cell.row + " in " + _this.type);
result = true;
}
result = _this.range.isIntersect(cellRange);
}
return result;
};
_this.isObjectInside = function(object) {
// TODO Нужно учитывать collOff, rowOff
var result = false;
var objectRange = new asc_Range(object.from.col, object.from.row, object.to.col, object.to.row);
var _r = _this.range.intersection(objectRange);
if ( _r )
result = true;
return result;
return _this.range.isIntersect(objectRange);
};
_this.getVerticalScroll = function() {
......
......@@ -2056,40 +2056,40 @@ var gUndoInsDelCellsFlag = true;
}
return null;
},
checkApplyFilterOrSort: function(tablePartId)
{
var aWs = this._getCurrentWS();
var result = false;
if(tablePartId !== undefined)
{
var tablePart = aWs.TableParts[tablePartId];
if(tablePart.Ref && ((tablePart.AutoFilter && tablePart.AutoFilter.FilterColumns && tablePart.AutoFilter.FilterColumns.length) || (tablePart && tablePart.SortState && tablePart.SortState.SortConditions && tablePart.SortState.SortConditions[0])))
checkApplyFilterOrSort: function(tablePartId)
{
var aWs = this._getCurrentWS();
var result = false;
if(tablePartId !== undefined)
{
var tablePart = aWs.TableParts[tablePartId];
if(tablePart.Ref && ((tablePart.AutoFilter && tablePart.AutoFilter.FilterColumns && tablePart.AutoFilter.FilterColumns.length) || (tablePart && tablePart.SortState && tablePart.SortState.SortConditions && tablePart.SortState.SortConditions[0])))
result = {isFilterColumns: true, isAutoFilter: true};
else if(tablePart.Ref && tablePart.AutoFilter && tablePart.AutoFilter !== null)
result = {isFilterColumns: null, isAutoFilter: true};
else
result = {isFilterColumns: null, isAutoFilter: false};
}
else
{
if(aWs.AutoFilter && ((aWs.AutoFilter.FilterColumns && aWs.AutoFilter.FilterColumns.length) || (aWs.AutoFilter.SortState && aWs.AutoFilter.SortState.SortConditions && aWs.AutoFilter.SortState.SortConditions[0])))
{
result = {isFilterColumns: true, isAutoFilter: true};
}
else if(aWs.AutoFilter)
{
result = {isFilterColumns: null, isAutoFilter: true};
}
else
{
result = {isFilterColumns: null, isAutoFilter: false};
};
};
return result;
},
result = {isFilterColumns: null, isAutoFilter: false};
}
else
{
if(aWs.AutoFilter && ((aWs.AutoFilter.FilterColumns && aWs.AutoFilter.FilterColumns.length) || (aWs.AutoFilter.SortState && aWs.AutoFilter.SortState.SortConditions && aWs.AutoFilter.SortState.SortConditions[0])))
{
result = {isFilterColumns: true, isAutoFilter: true};
}
else if(aWs.AutoFilter)
{
result = {isFilterColumns: null, isAutoFilter: true};
}
else
{
result = {isFilterColumns: null, isAutoFilter: false};
};
};
return result;
},
getAddFormatTableOptions: function(activeCells)
{
......@@ -2137,19 +2137,12 @@ var gUndoInsDelCellsFlag = true;
checkRemoveTableParts: function(delRange, tableRange)
{
var result = true, firstRowRange;
var aWs = this._getCurrentWS();
if(tableRange)
if(tableRange && delRange.containsRange(tableRange) == false)
{
if(delRange.containsRange(tableRange) == false)
{
firstRowRange = new Asc.Range(tableRange.c1, tableRange.r1, tableRange.c2, tableRange.r1);
if(firstRowRange.intersection(delRange))
{
result = false;
};
};
};
firstRowRange = new Asc.Range(tableRange.c1, tableRange.r1, tableRange.c2, tableRange.r1);
result = !firstRowRange.isIntersect(delRange);
}
return result;
},
......@@ -6514,7 +6507,7 @@ var gUndoInsDelCellsFlag = true;
//проходимся по всем заголовкам
for(var j = tableRange.c1; j <= tableRange.c2; j++)
{
cell = ws.model.getCell(new CellAddress(ref.r1, j, 0))
cell = ws.model.getCell(new CellAddress(ref.r1, j, 0));
val = cell.getValue();
//если не пустая изменяем TableColumns
if(val != "" && intersection.c1 <= j && intersection.c2 >= j )
......
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