Commit 70f64464 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Убрал calculateCell из drawingArea и FrozenPlace

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60208 954022d7-b5bf-4e40-9824-e11837661b57
parent e5053c27
......@@ -558,77 +558,6 @@ function FrozenPlace(ws, type) {
}
};
_this.calculateCell = function(x, y) {
var cell = new CCellObjectInfo();
if ( _this.isPointInside(x, y) ) {
var _x = x + _this.worksheet.getCellLeftRelative(0, 0);
var _y = y + _this.worksheet.getCellTopRelative(0, 0);
var xPt = _this.worksheet.objectRender.convertMetric(_x, 0, 1);
var yPt = _this.worksheet.objectRender.convertMetric(_y, 0, 1);
var offsetX = 0;// _this.worksheet.cols[fv.col].left - _this.worksheet.cellsLeft;
var offsetY = 0;//_this.worksheet.rows[fv.row].top - _this.worksheet.cellsTop;
/* Проверки на максимум в листе */
var isMaxCol = function() {
var result = false;
if ( _this.worksheet.cols.length >= gc_nMaxCol )
result = true;
return result;
};
var isMaxRow = function() {
var result = false;
if ( _this.worksheet.rows.length >= gc_nMaxRow )
result = true;
return result;
};
//
var delta = 0;
var what = roundPlus(xPt - offsetX, 3);
var col = _this.worksheet._findColUnderCursor( what, true );
while (col == null) {
if ( isMaxCol() ) {
col = _this.worksheet._findColUnderCursor( _this.worksheet.cols[gc_nMaxCol - 1].left - 1, true );
break;
}
_this.worksheet.expandColsOnScroll(true);
_this.worksheet.handlers.trigger("reinitializeScrollX");
col = _this.worksheet._findColUnderCursor( what + delta, true );
if ( what < 0 )
delta++;
}
cell.col = col.col;
cell.colOffPx = Math.max(0, _x - _this.worksheet.getCellLeft(cell.col, 0));
cell.colOff = _this.worksheet.objectRender.convertMetric(cell.colOffPx, 0, 3);
delta = 0;
what = roundPlus(yPt - offsetY, 3);
var row = _this.worksheet._findRowUnderCursor( what, true );
while (row == null) {
if ( isMaxRow() ) {
row = _this.worksheet._findRowUnderCursor( _this.worksheet.rows[gc_nMaxRow - 1].top - 1, true );
break;
}
_this.worksheet.expandRowsOnScroll(true);
_this.worksheet.handlers.trigger("reinitializeScrollY");
row = _this.worksheet._findRowUnderCursor( what + delta, true );
if ( what < 0 )
delta++;
}
cell.row = row.row;
cell.rowOffPx = Math.max(0, _y - _this.worksheet.getCellTop(cell.row, 0));
cell.rowOff = _this.worksheet.objectRender.convertMetric(cell.rowOffPx, 0, 3);
}
return cell;
};
// Range constructor
_this.initRange();
}
......@@ -787,16 +716,4 @@ function DrawingArea(ws) {
}
return null;
};
_this.calculateCell = function(x, y) {
var cell = null;
for ( var i = 0; i < _this.frozenPlaces.length; i++ ) {
if ( _this.frozenPlaces[i].isPointInside(x, y) ) {
cell = _this.frozenPlaces[i].calculateCell(x, y);
break;
}
}
return null !== cell ? cell : new CCellObjectInfo();
};
}
\ No newline at end of file
......@@ -2347,11 +2347,23 @@ function DrawingObjects() {
width /= metricCoeff;
}
var cellTo = _this.drawingArea.calculateCell(realLeftOffset + width, realTopOffset + height);
object.to.col = cellTo.col;
object.to.colOff = cellTo.colOff;
object.to.row = cellTo.row;
object.to.rowOff = cellTo.rowOff;
var findVal = pxToPt(realLeftOffset + width);
var toCell = worksheet.findCellByXY(findVal, 0, true, false, true);
while (toCell.col === null && worksheet.cols.length < gc_nMaxCol) {
worksheet.expandColsOnScroll(true);
toCell = worksheet.findCellByXY(findVal, 0, true, false, true);
}
object.to.col = toCell.col;
object.to.colOff = ptToMm(toCell.colOff);
findVal = pxToPt(realTopOffset + height);
toCell = worksheet.findCellByXY(0, findVal, true, true, false);
while (toCell.row === null && worksheet.rows.length < gc_nMaxRow) {
worksheet.expandRowsOnScroll(true);
toCell = worksheet.findCellByXY(0, findVal, true, true, false);
}
object.to.row = toCell.row;
object.to.rowOff = ptToMm(toCell.rowOff);
worksheet.handlers.trigger("reinitializeScroll");
};
......
......@@ -2354,8 +2354,6 @@
};
imCount++;
}
//worksheet.objectRender.addImageDrawingObject(tag.src, { cell: curCell, width: tag.width, height: tag.height });
}
aResult[tR][tC] = t._getArray(_tBody,isText);
if(undefined != _tBody && (_tBody.colSpan > 1 || _tBody.rowSpan > 1))
......
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