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 ...@@ -607,9 +607,16 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
&& this.IsSelectedAll()) && this.IsSelectedAll())
{ {
if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_SdtLocked === nContentControlLock) if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_SdtLocked === nContentControlLock)
{
return AscCommon.CollaborativeEditing.Add_CheckLock(true); return AscCommon.CollaborativeEditing.Add_CheckLock(true);
}
else 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) else if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_ContentLocked === nContentControlLock)
{ {
...@@ -624,7 +631,8 @@ CBlockLevelSdt.prototype.CheckContentControlEditingLock = function() ...@@ -624,7 +631,8 @@ CBlockLevelSdt.prototype.CheckContentControlEditingLock = function()
{ {
var nContentControlLock = this.GetContentControlLock(); 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); return AscCommon.CollaborativeEditing.Add_CheckLock(true);
if (this.Parent && this.Parent.CheckContentControlEditingLock) if (this.Parent && this.Parent.CheckContentControlEditingLock)
......
...@@ -47,6 +47,8 @@ function CWordCollaborativeEditing() ...@@ -47,6 +47,8 @@ function CWordCollaborativeEditing()
this.m_aForeignCursors = {}; this.m_aForeignCursors = {};
this.m_aForeignCursorsXY = {}; this.m_aForeignCursorsXY = {};
this.m_aForeignCursorsToShow = {}; this.m_aForeignCursorsToShow = {};
this.m_aSkipContentControlsOnCheckEditingLock = {};
} }
CWordCollaborativeEditing.prototype = Object.create(AscCommon.CCollaborativeEditingBase.prototype); CWordCollaborativeEditing.prototype = Object.create(AscCommon.CCollaborativeEditingBase.prototype);
...@@ -337,6 +339,21 @@ CWordCollaborativeEditing.prototype.OnCallback_AskLock = function(result) ...@@ -337,6 +339,21 @@ CWordCollaborativeEditing.prototype.OnCallback_AskLock = function(result)
oEditor.isChartEditor = false; 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