Commit 0623a99b authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

поправил _findColUnderCursor и _findRowUnderCursor для попадания в область pane


git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53084 954022d7-b5bf-4e40-9824-e11837661b57
parent b2b90e90
...@@ -548,7 +548,7 @@ ...@@ -548,7 +548,7 @@
if ("hyperlink" === ct.target) { if ("hyperlink" === ct.target) {
// Проверим замерженность // Проверим замерженность
var isHyperlinkClick = false; var isHyperlinkClick = false;
if ( (ar.c1 === ar.c2 && ar.r1 === ar.r2) || isSelectOnShape ) if ((ar.c1 === ar.c2 && ar.r1 === ar.r2) || isSelectOnShape)
isHyperlinkClick = true; isHyperlinkClick = true;
else { else {
var mergedRange = ws.model.getMergedByCell(ar.r1, ar.c1); var mergedRange = ws.model.getMergedByCell(ar.r1, ar.c1);
...@@ -559,7 +559,8 @@ ...@@ -559,7 +559,8 @@
if (false === ct.hyperlink.hyperlinkModel.getVisited() && !isSelectOnShape) { if (false === ct.hyperlink.hyperlinkModel.getVisited() && !isSelectOnShape) {
ct.hyperlink.hyperlinkModel.setVisited(true); ct.hyperlink.hyperlinkModel.setVisited(true);
if (ct.hyperlink.hyperlinkModel.Ref) if (ct.hyperlink.hyperlinkModel.Ref)
ws.changeWorksheet("updateRange", {range: ct.hyperlink.hyperlinkModel.Ref.getBBox0(), isLockDraw: false, canChangeColWidth: false}); ws.changeWorksheet("updateRange", {range: ct.hyperlink.hyperlinkModel.Ref.getBBox0(),
isLockDraw: false, canChangeColWidth: false});
} }
switch (ct.hyperlink.asc_getType()) { switch (ct.hyperlink.asc_getType()) {
case c_oAscHyperlinkType.WebLink: case c_oAscHyperlinkType.WebLink:
......
...@@ -5010,8 +5010,11 @@ ...@@ -5010,8 +5010,11 @@
if (this.topLeftFrozenCell) { if (this.topLeftFrozenCell) {
cFrozen = this.topLeftFrozenCell.getCol0(); cFrozen = this.topLeftFrozenCell.getCol0();
widthDiff = this.cols[cFrozen].left - this.cols[0].left; widthDiff = this.cols[cFrozen].left - this.cols[0].left;
if (x < this.cellsLeft + widthDiff && 0 !== widthDiff) {
c = 0;
widthDiff = 0;
}
} }
// ToDo select in frozen pane
for (x1 = this.cellsLeft + widthDiff, c2 = this.cols.length - 1; c <= c2; ++c, x1 = x2) { for (x1 = this.cellsLeft + widthDiff, c2 = this.cols.length - 1; c <= c2; ++c, x1 = x2) {
x2 = x1 + this.cols[c].width; x2 = x1 + this.cols[c].width;
if (x1 <= x && x < x2) { if (x1 <= x && x < x2) {
...@@ -5061,10 +5064,13 @@ ...@@ -5061,10 +5064,13 @@
offset = this.rows[r].top - this.cellsTop, offset = this.rows[r].top - this.cellsTop,
r2, y1, y2, rFrozen, heightDiff = 0; r2, y1, y2, rFrozen, heightDiff = 0;
if (y >= this.cellsTop) { if (y >= this.cellsTop) {
// ToDo select in frozen pane
if (this.topLeftFrozenCell) { if (this.topLeftFrozenCell) {
rFrozen = this.topLeftFrozenCell.getRow0(); rFrozen = this.topLeftFrozenCell.getRow0();
heightDiff = this.rows[rFrozen].top - this.rows[0].top; heightDiff = this.rows[rFrozen].top - this.rows[0].top;
if (y < this.cellsTop + heightDiff && 0 !== heightDiff) {
r = 0;
heightDiff = 0;
}
} }
for (y1 = this.cellsTop + heightDiff, r2 = this.rows.length - 1; r <= r2; ++r, y1 = y2) { for (y1 = this.cellsTop + heightDiff, r2 = this.rows.length - 1; r <= r2; ++r, y1 = y2) {
y2 = y1 + this.rows[r].height; y2 = y1 + this.rows[r].height;
...@@ -5110,24 +5116,18 @@ ...@@ -5110,24 +5116,18 @@
}, },
getCursorTypeFromXY: function (x, y, isViewerMode) { getCursorTypeFromXY: function (x, y, isViewerMode) {
var c, r, f, i, offsetX, offsetY, arNorm, arIntersection; var c, r, f, i, offsetX, offsetY, arIntersection, left, top, right, bottom, cellCursor,
var left, top, right, bottom; sheetId = this.model.getId(), userId, lockRangePosLeft, lockRangePosTop, lockInfo, oHyperlink,
var sheetId = this.model.getId(); isLocked = false, ar = this.activeRange;
var userId = undefined;
var lockRangePosLeft = undefined;
var lockRangePosTop = undefined;
var lockInfo = undefined;
var isLocked = false;
var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y); var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y);
if (asc["editor"].isStartAddShape && CheckIdSatetShapeAdd(this.objectRender.controller.curState.id)) if (asc["editor"].isStartAddShape && CheckIdSatetShapeAdd(this.objectRender.controller.curState.id))
return {cursor: kCurFillHandle, target: "shape", col: -1, row: -1}; return {cursor: kCurFillHandle, target: "shape", col: -1, row: -1};
if (drawingInfo && drawingInfo.id) { if (drawingInfo && drawingInfo.id) {
// Возможно картинка с lock // Возможно картинка с lock
lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, drawingInfo.id); lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, drawingInfo.id);
isLocked = this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther,false); isLocked = this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther, false);
if (false !== isLocked) { if (false !== isLocked) {
// Кто-то сделал lock // Кто-то сделал lock
userId = isLocked.UserId; userId = isLocked.UserId;
...@@ -5135,33 +5135,18 @@ ...@@ -5135,33 +5135,18 @@
lockRangePosTop = drawingInfo.object.getVisibleTopOffset(true); lockRangePosTop = drawingInfo.object.getVisibleTopOffset(true);
} }
if ( drawingInfo.hyperlink && (drawingInfo.hyperlink instanceof ParaHyperlinkStart) ) { if (drawingInfo.hyperlink instanceof ParaHyperlinkStart) {
oHyperlink = new Hyperlink();
var oHyperlink = new Hyperlink();
oHyperlink.Tooltip = drawingInfo.hyperlink.ToolTip; oHyperlink.Tooltip = drawingInfo.hyperlink.ToolTip;
var spl = drawingInfo.hyperlink.Value.split("!"); var spl = drawingInfo.hyperlink.Value.split("!");
if (spl.length === 2) { if (spl.length === 2)
oHyperlink.setLocation(drawingInfo.hyperlink.Value); oHyperlink.setLocation(drawingInfo.hyperlink.Value);
}
else else
oHyperlink.Hyperlink = drawingInfo.hyperlink.Value; oHyperlink.Hyperlink = drawingInfo.hyperlink.Value;
var _r = this.activeRange.clone(true); cellCursor = {cursor: drawingInfo.cursor, target: "cells", col: -1, row: -1, userId: userId};
oHyperlink.Ref = this.model.getRange3(_r.r1, _r.c1, _r.r2, _r.c2);
var cellCursor = {cursor: drawingInfo.cursor, target: "cells", col: (c ? c.col : -1),
row: (r ? r.row : -1), userId: userId,
lockRangePosLeft: undefined, lockRangePosTop: undefined,
userIdAllProps: undefined, lockAllPosLeft: undefined,
lockAllPosTop: undefined, userIdAllSheet: undefined,
commentIndexes: undefined, commentCoords: undefined};
return {cursor: kCurHyperlink, target: "hyperlink", return {cursor: kCurHyperlink, target: "hyperlink",
hyperlink: new asc_CHyperlink(oHyperlink), cellCursor: cellCursor, hyperlink: new asc_CHyperlink(oHyperlink), cellCursor: cellCursor, userId: userId};
userId: userId, lockRangePosLeft: undefined,
lockRangePosTop: undefined, userIdAllProps: undefined,
userIdAllSheet: undefined, lockAllPosLeft: undefined,
lockAllPosTop: undefined, commentIndexes: undefined, commentCoords: undefined};
} }
return {cursor: drawingInfo.cursor, target: "shape", drawingId: drawingInfo.id, col: -1, row: -1, return {cursor: drawingInfo.cursor, target: "shape", drawingId: drawingInfo.id, col: -1, row: -1,
...@@ -5238,7 +5223,7 @@ ...@@ -5238,7 +5223,7 @@
x >= (this.fillHandleL - fillHandleEpsilon) && x <= (this.fillHandleR + fillHandleEpsilon) && x >= (this.fillHandleL - fillHandleEpsilon) && x <= (this.fillHandleR + fillHandleEpsilon) &&
y >= (this.fillHandleT - fillHandleEpsilon) && y <= (this.fillHandleB + fillHandleEpsilon)) { y >= (this.fillHandleT - fillHandleEpsilon) && y <= (this.fillHandleB + fillHandleEpsilon)) {
// Мы на "квадрате" для автозаполнения // Мы на "квадрате" для автозаполнения
if ( !this.objectRender.selectedGraphicObjectsExists() ) if (!this.objectRender.selectedGraphicObjectsExists())
return {cursor: kCurFillHandle, target: "fillhandle", col: -1, row: -1}; return {cursor: kCurFillHandle, target: "fillhandle", col: -1, row: -1};
} }
...@@ -5246,19 +5231,18 @@ ...@@ -5246,19 +5231,18 @@
var yWithOffset = y + offsetY; var yWithOffset = y + offsetY;
// Навели на выделение // Навели на выделение
arNorm = this.activeRange.clone(true); arIntersection = ar.intersectionSimple(this.visibleRange);
arIntersection = arNorm.intersectionSimple(this.visibleRange); if (!isViewerMode && arIntersection) {
if (arIntersection) { left = ar.c1 === arIntersection.c1 ? this.cols[ar.c1].left : null;
left = arNorm.c1 === arIntersection.c1 ? this.cols[arNorm.c1].left : null; right = ar.c2 === arIntersection.c2 ? this.cols[ar.c2].left + this.cols[ar.c2].width : null;
right = arNorm.c2 === arIntersection.c2 ? this.cols[arNorm.c2].left + this.cols[arNorm.c2].width : null; top = ar.r1 === arIntersection.r1 ? this.rows[ar.r1].top : null;
top = arNorm.r1 === arIntersection.r1 ? this.rows[arNorm.r1].top : null; bottom = ar.r2 === arIntersection.r2 ? this.rows[ar.r2].top + this.rows[ar.r2].height : null;
bottom = arNorm.r2 === arIntersection.r2 ? this.rows[arNorm.r2].top + this.rows[arNorm.r2].height : null; if ((((null !== left && xWithOffset >= left - this.width_2px && xWithOffset <= left + this.width_2px) ||
if (!isViewerMode && ((((null !== left && xWithOffset >= left - this.width_2px && xWithOffset <= left + this.width_2px) ||
(null !== right && xWithOffset >= right - this.width_2px && xWithOffset <= right + this.width_2px)) && (null !== right && xWithOffset >= right - this.width_2px && xWithOffset <= right + this.width_2px)) &&
null !== top && null !== bottom && yWithOffset >= top - this.height_2px && yWithOffset <= bottom + this.height_2px) || null !== top && null !== bottom && yWithOffset >= top - this.height_2px && yWithOffset <= bottom + this.height_2px) ||
(((null !== top && yWithOffset >= top - this.height_2px && yWithOffset <= top + this.height_2px) || (((null !== top && yWithOffset >= top - this.height_2px && yWithOffset <= top + this.height_2px) ||
(null !== bottom && yWithOffset >= bottom - this.height_2px && yWithOffset <= bottom + this.height_2px)) && (null !== bottom && yWithOffset >= bottom - this.height_2px && yWithOffset <= bottom + this.height_2px)) &&
null !== left && null !== right && xWithOffset >= left - this.width_2px && xWithOffset <= right + this.width_2px))) { null !== left && null !== right && xWithOffset >= left - this.width_2px && xWithOffset <= right + this.width_2px)) {
// Мы навели на границу выделения // Мы навели на границу выделения
if ( !this.objectRender.selectedGraphicObjectsExists() ) if ( !this.objectRender.selectedGraphicObjectsExists() )
return {cursor: kCurMove, target: "moveRange", col: -1, row: -1}; return {cursor: kCurMove, target: "moveRange", col: -1, row: -1};
...@@ -5356,8 +5340,8 @@ ...@@ -5356,8 +5340,8 @@
} }
// Проверим, может мы в гиперлинке // Проверим, может мы в гиперлинке
var oHyperlink = this.model.getHyperlinkByCell(r.row, c.col); oHyperlink = this.model.getHyperlinkByCell(r.row, c.col);
var cellCursor = {cursor: kCurCells, target: "cells", col: (c ? c.col : -1), cellCursor = {cursor: kCurCells, target: "cells", col: (c ? c.col : -1),
row: (r ? r.row : -1), userId: userId, row: (r ? r.row : -1), userId: userId,
lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop, lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop,
userIdAllProps: userIdAllProps, lockAllPosLeft: lockAllPosLeft, userIdAllProps: userIdAllProps, lockAllPosLeft: lockAllPosLeft,
......
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