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,14 +388,9 @@ function FrozenPlace(ws, type) { ...@@ -388,14 +388,9 @@ function FrozenPlace(ws, type) {
_this.isCellInside = function(cell) { _this.isCellInside = function(cell) {
var result = false; 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 cellRange = new asc_Range(cell.col, cell.row, cell.col, cell.row);
var _r = _this.range.intersection(cellRange); result = _this.range.isIntersect(cellRange);
if ( _r ) {
if ( log )
console.log( cell.col + "," + cell.row + " in " + _this.type);
result = true;
}
} }
return result; return result;
}; };
...@@ -403,12 +398,8 @@ function FrozenPlace(ws, type) { ...@@ -403,12 +398,8 @@ function FrozenPlace(ws, type) {
_this.isObjectInside = function(object) { _this.isObjectInside = function(object) {
// TODO Нужно учитывать collOff, rowOff // TODO Нужно учитывать collOff, rowOff
var result = false;
var objectRange = new asc_Range(object.from.col, object.from.row, object.to.col, object.to.row); var objectRange = new asc_Range(object.from.col, object.from.row, object.to.col, object.to.row);
var _r = _this.range.intersection(objectRange); return _this.range.isIntersect(objectRange);
if ( _r )
result = true;
return result;
}; };
_this.getVerticalScroll = function() { _this.getVerticalScroll = function() {
......
...@@ -2137,19 +2137,12 @@ var gUndoInsDelCellsFlag = true; ...@@ -2137,19 +2137,12 @@ var gUndoInsDelCellsFlag = true;
checkRemoveTableParts: function(delRange, tableRange) checkRemoveTableParts: function(delRange, tableRange)
{ {
var result = true, firstRowRange; 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); firstRowRange = new Asc.Range(tableRange.c1, tableRange.r1, tableRange.c2, tableRange.r1);
if(firstRowRange.intersection(delRange)) result = !firstRowRange.isIntersect(delRange);
{ }
result = false;
};
};
};
return result; return result;
}, },
...@@ -6514,7 +6507,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -6514,7 +6507,7 @@ var gUndoInsDelCellsFlag = true;
//проходимся по всем заголовкам //проходимся по всем заголовкам
for(var j = tableRange.c1; j <= tableRange.c2; j++) 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(); val = cell.getValue();
//если не пустая изменяем TableColumns //если не пустая изменяем TableColumns
if(val != "" && intersection.c1 <= j && intersection.c2 >= j ) 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