Commit 61ae699a authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Оставался лок у принятых граф.объектов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51149 954022d7-b5bf-4e40-9824-e11837661b57
parent 7025a284
......@@ -4462,12 +4462,15 @@ function DrawingObjects() {
_this.tryResetLockedGraphicObject = function(id) {
var bObjectFound = false;
for (var i = 0; i < aObjects.length; i++) {
if ( aObjects[i].graphicObject.Id == id ) {
aObjects[i].graphicObject.lockType = c_oAscLockTypes.kLockTypeNone;
bObjectFound = true;
break;
}
}
return bObjectFound;
}
_this.setScrollOffset = function() {
......
......@@ -1350,7 +1350,7 @@ 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);},
"tryResetLockedGraphicObject": function () {return 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);},
......@@ -1601,8 +1601,9 @@ 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);
return this.wb.getWorksheet().objectRender.tryResetLockedGraphicObject(id);
}
return false;
},
_onShowComments: function () {
......
......@@ -194,6 +194,7 @@
return;
var bCheckRedraw = false;
var bRedrawGraphicObjects = false;
if (0 < this.m_arrNeedUnlock.length ||
0 < this.m_arrNeedUnlock2.length) {
bCheckRedraw = true;
......@@ -205,8 +206,10 @@
while (0 < this.m_arrNeedUnlock2.length) {
oLock = this.m_arrNeedUnlock2.shift();
oLock.setType(c_oAscLockTypes.kLockTypeNone, false);
if ( oLock.Element["type"] == c_oAscLockTypeElem.Object )
this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element["rangeOrObjectId"]);
if ( oLock.Element["type"] == c_oAscLockTypeElem.Object ) {
if ( this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element["rangeOrObjectId"]) )
bRedrawGraphicObjects = true;
}
this.handlers.trigger("releaseLocks", oLock.Element["guid"]);
}
// Очищаем примененные чужие изменения
......@@ -215,8 +218,10 @@
for (; nIndex < nCount; ++nIndex) {
oLock = this.m_arrNeedUnlock[nIndex];
if (c_oAscLockTypes.kLockTypeOther2 === oLock.getType()) {
if ( oLock.Element["type"] == c_oAscLockTypeElem.Object )
this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element["rangeOrObjectId"]);
if ( oLock.Element["type"] == c_oAscLockTypeElem.Object ) {
if ( this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element["rangeOrObjectId"]) )
bRedrawGraphicObjects = true;
}
this.m_arrNeedUnlock.splice(nIndex, 1);
--nIndex;
--nCount;
......@@ -246,8 +251,10 @@
this.handlers.trigger("updateAllSheetsLock");
this.handlers.trigger("unlockComments");
this.handlers.trigger("showComments");
this.handlers.trigger("showDrawingObjects");
}
if ( bCheckRedraw || bRedrawGraphicObjects )
this.handlers.trigger("showDrawingObjects");
},
getRecalcIndexSave: function (oRecalcIndex) {
......
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