Commit 1cbd762d authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with check locks for ContentControl.

parent 19b7d96d
......@@ -607,9 +607,16 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
&& this.IsSelectedAll())
{
if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_SdtLocked === nContentControlLock)
{
return AscCommon.CollaborativeEditing.Add_CheckLock(true);
}
else
return this.Content.Document_Is_SelectionLocked(CheckType, bCheckInner);
{
AscCommon.CollaborativeEditing.AddContentControlForSkippingOnCheckEditingLock(this);
this.Content.Document_Is_SelectionLocked(CheckType, bCheckInner);
AscCommon.CollaborativeEditing.RemoveContentControlForSkippingOnCheckEditingLock(this);
return;
}
}
else if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_ContentLocked === nContentControlLock)
{
......@@ -624,7 +631,8 @@ CBlockLevelSdt.prototype.CheckContentControlEditingLock = function()
{
var nContentControlLock = this.GetContentControlLock();
if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_ContentLocked === nContentControlLock)
if (false === AscCommon.CollaborativeEditing.IsNeedToSkipContentControlOnCheckEditingLock(this)
&& (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_ContentLocked === nContentControlLock))
return AscCommon.CollaborativeEditing.Add_CheckLock(true);
if (this.Parent && this.Parent.CheckContentControlEditingLock)
......
......@@ -47,9 +47,11 @@ function CWordCollaborativeEditing()
this.m_aForeignCursors = {};
this.m_aForeignCursorsXY = {};
this.m_aForeignCursorsToShow = {};
this.m_aSkipContentControlsOnCheckEditingLock = {};
}
CWordCollaborativeEditing.prototype = Object.create(AscCommon.CCollaborativeEditingBase.prototype);
CWordCollaborativeEditing.prototype = Object.create(AscCommon.CCollaborativeEditingBase.prototype);
CWordCollaborativeEditing.prototype.constructor = CWordCollaborativeEditing;
CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalInfo, IsUpdateInterface)
......@@ -337,6 +339,21 @@ CWordCollaborativeEditing.prototype.OnCallback_AskLock = function(result)
oEditor.isChartEditor = false;
}
};
CWordCollaborativeEditing.prototype.AddContentControlForSkippingOnCheckEditingLock = function(oContentControl)
{
this.m_aSkipContentControlsOnCheckEditingLock[oContentControl.GetId()] = oContentControl;
};
CWordCollaborativeEditing.prototype.RemoveContentControlForSkippingOnCheckEditingLock = function(oContentControl)
{
delete this.m_aSkipContentControlsOnCheckEditingLock[oContentControl.GetId()];
};
CWordCollaborativeEditing.prototype.IsNeedToSkipContentControlOnCheckEditingLock = function(oContentControl)
{
if (this.m_aSkipContentControlsOnCheckEditingLock[oContentControl.GetId()] === oContentControl)
return true;
return false;
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с сохраненными позициями документа.
//----------------------------------------------------------------------------------------------------------------------
......
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