Commit 708c8a87 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Fix #20602

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50081 954022d7-b5bf-4e40-9824-e11837661b57
parent 26ee5396
......@@ -2392,7 +2392,7 @@ function DrawingObjects() {
_t.flags = {
anchorUpdated: false,
lockState: c_oAscObjectLockState.No
lockState: c_oAscLockTypes.kLockTypeNone
};
_t.getAllFonts = function(AllFonts) {
......@@ -2479,6 +2479,10 @@ function DrawingObjects() {
}
_t.to.row = foundRow.row;
_t.to.rowOff = _t.graphicObject.y + _t.graphicObject.extY - _t.worksheet.getCellTop(_t.to.row, 3);
console.log("col: " + _t.from.col + " colOff: " + _t.from.colOff + " row: " + _t.from.row + " rowOff: " + _t.from.rowOff);
console.log("col: " + _t.to.col + " colOff: " + _t.to.colOff + " row: " + _t.to.row + " rowOff: " + _t.to.rowOff);
console.log("---");
}
}
......@@ -4259,7 +4263,13 @@ function DrawingObjects() {
for (var i = 0; i < aObjects.length; i++) {
if ( id == aObjects[i].graphicObject.Id ) {
aObjects[i].graphicObject.lockType = state;
//shapeCtx.DrawLockObjectRect(aObjects[i].graphicObject.lockType, aObjects[i].graphicObject.x, aObjects[i].graphicObject.y, aObjects[i].graphicObject.extX, aObjects[i].graphicObject.extY );
shapeCtx.SetIntegerGrid(false);
shapeCtx.transform3(aObjects[i].graphicObject.transform, false);
shapeCtx.DrawLockObjectRect(aObjects[i].graphicObject.lockType, 0, 0, aObjects[i].graphicObject.extX, aObjects[i].graphicObject.extY );
shapeCtx.reset();
shapeCtx.SetIntegerGrid(true);
break;
}
}
......@@ -4269,9 +4279,17 @@ function DrawingObjects() {
for (var i = 0; i < aObjects.length; i++) {
aObjects[i].graphicObject.lockType = c_oAscLockTypes.kLockTypeNone;
//shapeCtx.DrawLockObjectRect(aObjects[i].graphicObject.lockType, aObjects[i].graphicObject.x, aObjects[i].graphicObject.y, aObjects[i].graphicObject.extX, aObjects[i].graphicObject.extY );
}
//_this.showDrawingObjects(true);
}
_this.tryResetLockedGraphicObject = function(id) {
for (var i = 0; i < aObjects.length; i++) {
if ( aObjects[i].graphicObject.Id == id ) {
aObjects[i].graphicObject.lockType = c_oAscLockTypes.kLockTypeNone;
break;
}
}
}
_this.setScrollOffset = function(x_px, y_px) {
......
......@@ -33,12 +33,6 @@ var c_oAscNumFormatType = {
bottom: "bottom"
};
var c_oAscObjectLockState = {
No: 1,
On: 2,
Off: 3
};
var c_oAscDrawingLayerType = {
BringToFront: 0,
SendToBack: 1,
......
......@@ -1263,8 +1263,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
"updateAllSheetsLock": function () {t._onUpdateAllSheetsLock.apply(t, arguments);},
"showDrawingObjects": function () {t._onShowDrawingObjects.apply(t, arguments);},
"resetLockedGraphicObjects": function () {t._onResetLockedGraphicObjects.apply(t, arguments);},
"tryResetLockedGraphicObject": function () {t._onTryResetLockedGraphicObject.apply(t, arguments);},
"showComments": function () {t._onShowComments.apply(t, arguments);},
"unlockComments": function () {t._onUnlockComments.apply(t);},
"tryUnlockComment": function () {t._onTryUnlockComment.apply(t, arguments);},
"cleanSelection": function () {t._onCleanSelection.apply(t, arguments);}
});
......@@ -1513,6 +1515,12 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}
},
_onTryResetLockedGraphicObject: function (id) {
if (this.wb) {
this.wb.getWorksheet().objectRender.tryResetLockedGraphicObject(id);
}
},
_onShowComments: function () {
if (this.wb) {
this.wb.getWorksheet().cellCommentator.drawCommentCells();
......@@ -1526,6 +1534,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}
},
_onTryUnlockComment: function (id) {
if (this.wb) {
var ws = this.wb.getWorksheet();
ws.cellCommentator.tryUnlockComment(id);
}
},
_onUpdateSheetsLock: function (lockElem) {
var t = this;
// Шлем update для листов, т.к. нужно залочить лист
......
......@@ -597,6 +597,15 @@ function asc_CCellCommentator(currentSheet) {
}
}
_this.tryUnlockComment = function(id) {
for (var i = 0; i < _this.aComments.length; i++) {
if ( _this.aComments[i].asc_getId() == id ) {
_this.worksheet.model.workbook.handlers.trigger("asc_onUnLockComment", id);
break;
}
}
}
_this.moveRangeComments = function(rangeFrom, rangeTo) {
if ( rangeFrom && rangeTo ) {
var colOffset = rangeTo.c1 - rangeFrom.c1;
......
......@@ -205,7 +205,7 @@
while (0 < this.m_arrNeedUnlock2.length) {
oLock = this.m_arrNeedUnlock2.shift();
oLock.setType(c_oAscLockTypes.kLockTypeNone, false);
this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element.rangeOrObjectId);
this.handlers.trigger("releaseLocks", oLock.Element["guid"]);
}
// Очищаем примененные чужие изменения
......@@ -214,7 +214,7 @@
for (; nIndex < nCount; ++nIndex) {
oLock = this.m_arrNeedUnlock[nIndex];
if (c_oAscLockTypes.kLockTypeOther2 === oLock.getType()) {
this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element.rangeOrObjectId);
this.m_arrNeedUnlock.splice(nIndex, 1);
--nIndex;
--nCount;
......@@ -244,7 +244,6 @@
this.handlers.trigger("updateAllSheetsLock");
this.handlers.trigger("unlockComments");
this.handlers.trigger("showComments");
this.handlers.trigger("resetLockedGraphicObjects");
this.handlers.trigger("showDrawingObjects");
}
},
......
......@@ -3168,8 +3168,7 @@
arrayCells = arrayCells.concat(this.collaborativeEditing.getArrayInsertRowsBySheetId(currentSheetId));
}
if (bIsDrawObjects) {
var objectState = (c_oAscLockTypes.kLockTypeMine === type) ? c_oAscObjectLockState.Off : c_oAscObjectLockState.On;
if ( bIsDrawObjects ) {
var arrayObjects = (c_oAscLockTypes.kLockTypeMine === type) ? this.collaborativeEditing.getLockObjectsMe(currentSheetId) : this.collaborativeEditing.getLockObjectsOther(currentSheetId);
for (i = 0; i < arrayObjects.length; ++i) {
......
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