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() { ...@@ -2392,7 +2392,7 @@ function DrawingObjects() {
_t.flags = { _t.flags = {
anchorUpdated: false, anchorUpdated: false,
lockState: c_oAscObjectLockState.No lockState: c_oAscLockTypes.kLockTypeNone
}; };
_t.getAllFonts = function(AllFonts) { _t.getAllFonts = function(AllFonts) {
...@@ -2479,6 +2479,10 @@ function DrawingObjects() { ...@@ -2479,6 +2479,10 @@ function DrawingObjects() {
} }
_t.to.row = foundRow.row; _t.to.row = foundRow.row;
_t.to.rowOff = _t.graphicObject.y + _t.graphicObject.extY - _t.worksheet.getCellTop(_t.to.row, 3); _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() { ...@@ -4259,7 +4263,13 @@ function DrawingObjects() {
for (var i = 0; i < aObjects.length; i++) { for (var i = 0; i < aObjects.length; i++) {
if ( id == aObjects[i].graphicObject.Id ) { if ( id == aObjects[i].graphicObject.Id ) {
aObjects[i].graphicObject.lockType = state; 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; break;
} }
} }
...@@ -4269,9 +4279,17 @@ function DrawingObjects() { ...@@ -4269,9 +4279,17 @@ function DrawingObjects() {
for (var i = 0; i < aObjects.length; i++) { for (var i = 0; i < aObjects.length; i++) {
aObjects[i].graphicObject.lockType = c_oAscLockTypes.kLockTypeNone; 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) { _this.setScrollOffset = function(x_px, y_px) {
......
...@@ -32,12 +32,6 @@ var c_oAscNumFormatType = { ...@@ -32,12 +32,6 @@ var c_oAscNumFormatType = {
top: "top", top: "top",
bottom: "bottom" bottom: "bottom"
}; };
var c_oAscObjectLockState = {
No: 1,
On: 2,
Off: 3
};
var c_oAscDrawingLayerType = { var c_oAscDrawingLayerType = {
BringToFront: 0, BringToFront: 0,
......
...@@ -1263,8 +1263,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1263,8 +1263,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
"updateAllSheetsLock": function () {t._onUpdateAllSheetsLock.apply(t, arguments);}, "updateAllSheetsLock": function () {t._onUpdateAllSheetsLock.apply(t, arguments);},
"showDrawingObjects": function () {t._onShowDrawingObjects.apply(t, arguments);}, "showDrawingObjects": function () {t._onShowDrawingObjects.apply(t, arguments);},
"resetLockedGraphicObjects": function () {t._onResetLockedGraphicObjects.apply(t, arguments);}, "resetLockedGraphicObjects": function () {t._onResetLockedGraphicObjects.apply(t, arguments);},
"tryResetLockedGraphicObject": function () {t._onTryResetLockedGraphicObject.apply(t, arguments);},
"showComments": function () {t._onShowComments.apply(t, arguments);}, "showComments": function () {t._onShowComments.apply(t, arguments);},
"unlockComments": function () {t._onUnlockComments.apply(t);}, "unlockComments": function () {t._onUnlockComments.apply(t);},
"tryUnlockComment": function () {t._onTryUnlockComment.apply(t, arguments);},
"cleanSelection": function () {t._onCleanSelection.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"; ...@@ -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 () { _onShowComments: function () {
if (this.wb) { if (this.wb) {
this.wb.getWorksheet().cellCommentator.drawCommentCells(); this.wb.getWorksheet().cellCommentator.drawCommentCells();
...@@ -1525,6 +1533,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1525,6 +1533,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
ws.cellCommentator.unlockComments(); ws.cellCommentator.unlockComments();
} }
}, },
_onTryUnlockComment: function (id) {
if (this.wb) {
var ws = this.wb.getWorksheet();
ws.cellCommentator.tryUnlockComment(id);
}
},
_onUpdateSheetsLock: function (lockElem) { _onUpdateSheetsLock: function (lockElem) {
var t = this; var t = this;
......
...@@ -596,6 +596,15 @@ function asc_CCellCommentator(currentSheet) { ...@@ -596,6 +596,15 @@ function asc_CCellCommentator(currentSheet) {
_this.worksheet.model.workbook.handlers.trigger("asc_onUnLockComment", _this.aComments[i].asc_getId()); _this.worksheet.model.workbook.handlers.trigger("asc_onUnLockComment", _this.aComments[i].asc_getId());
} }
} }
_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) { _this.moveRangeComments = function(rangeFrom, rangeTo) {
if ( rangeFrom && rangeTo ) { if ( rangeFrom && rangeTo ) {
......
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
while (0 < this.m_arrNeedUnlock2.length) { while (0 < this.m_arrNeedUnlock2.length) {
oLock = this.m_arrNeedUnlock2.shift(); oLock = this.m_arrNeedUnlock2.shift();
oLock.setType(c_oAscLockTypes.kLockTypeNone, false); oLock.setType(c_oAscLockTypes.kLockTypeNone, false);
this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element.rangeOrObjectId);
this.handlers.trigger("releaseLocks", oLock.Element["guid"]); this.handlers.trigger("releaseLocks", oLock.Element["guid"]);
} }
// Очищаем примененные чужие изменения // Очищаем примененные чужие изменения
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
for (; nIndex < nCount; ++nIndex) { for (; nIndex < nCount; ++nIndex) {
oLock = this.m_arrNeedUnlock[nIndex]; oLock = this.m_arrNeedUnlock[nIndex];
if (c_oAscLockTypes.kLockTypeOther2 === oLock.getType()) { if (c_oAscLockTypes.kLockTypeOther2 === oLock.getType()) {
this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element.rangeOrObjectId);
this.m_arrNeedUnlock.splice(nIndex, 1); this.m_arrNeedUnlock.splice(nIndex, 1);
--nIndex; --nIndex;
--nCount; --nCount;
...@@ -244,7 +244,6 @@ ...@@ -244,7 +244,6 @@
this.handlers.trigger("updateAllSheetsLock"); this.handlers.trigger("updateAllSheetsLock");
this.handlers.trigger("unlockComments"); this.handlers.trigger("unlockComments");
this.handlers.trigger("showComments"); this.handlers.trigger("showComments");
this.handlers.trigger("resetLockedGraphicObjects");
this.handlers.trigger("showDrawingObjects"); this.handlers.trigger("showDrawingObjects");
} }
}, },
......
...@@ -3168,8 +3168,7 @@ ...@@ -3168,8 +3168,7 @@
arrayCells = arrayCells.concat(this.collaborativeEditing.getArrayInsertRowsBySheetId(currentSheetId)); arrayCells = arrayCells.concat(this.collaborativeEditing.getArrayInsertRowsBySheetId(currentSheetId));
} }
if (bIsDrawObjects) { if ( bIsDrawObjects ) {
var objectState = (c_oAscLockTypes.kLockTypeMine === type) ? c_oAscObjectLockState.Off : c_oAscObjectLockState.On;
var arrayObjects = (c_oAscLockTypes.kLockTypeMine === type) ? this.collaborativeEditing.getLockObjectsMe(currentSheetId) : this.collaborativeEditing.getLockObjectsOther(currentSheetId); var arrayObjects = (c_oAscLockTypes.kLockTypeMine === type) ? this.collaborativeEditing.getLockObjectsMe(currentSheetId) : this.collaborativeEditing.getLockObjectsOther(currentSheetId);
for (i = 0; i < arrayObjects.length; ++i) { 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