Commit 3111bc44 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #35351. Fixed issues with adding text to inline content control with...

Fixed bug #35351. Fixed issues with adding text to inline content control with different types of the lock.
parent 3ca67abf
......@@ -206,6 +206,7 @@ CAbstractNum.prototype.Document_Is_SelectionLocked = function(CheckType)
{
case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText:
{
this.Lock.Check( this.Get_Id() );
break;
......@@ -240,6 +241,7 @@ if(typeof CGraphicObjects !== "undefined")
|| AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_Paragraph_Properties === CheckType
|| AscCommon.changestype_Document_Content_Add === CheckType)
{
......@@ -269,6 +271,7 @@ CStyle.prototype.Document_Is_SelectionLocked = function(CheckType)
{
case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Image_Properties:
......@@ -290,6 +293,7 @@ CStyles.prototype.Document_Is_SelectionLocked = function(CheckType)
{
case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Image_Properties:
......@@ -415,6 +419,7 @@ Paragraph.prototype.Document_Is_SelectionLocked = function(CheckType)
{
case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Image_Properties:
......@@ -522,6 +527,7 @@ CTable.prototype.Document_Is_SelectionLocked = function(CheckType, bCheckInner)
{
case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Delete:
......@@ -640,6 +646,7 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
if (isCheckContentControlLock
&& (AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Document_Content === CheckType
......@@ -708,6 +715,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType)
var nContentControlLock = this.GetContentControlLock();
if ((AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Document_Content === CheckType
......@@ -715,12 +723,23 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType)
&& this.IsSelectionUse()
&& this.IsSelectedAll())
{
if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_SdtLocked === nContentControlLock)
var bSelectedOnlyThis = false;
// Если это происходит на добавлении текста, тогда проверяем, что выделен только данный элемент
if (AscCommon.changestype_Paragraph_AddText === CheckType && this.Paragraph && this.Paragraph.LogicDocument)
{
var oInfo = this.Paragraph.LogicDocument.GetSelectedElementsInfo();
bSelectedOnlyThis = oInfo.GetInlineLevelSdt() === this ? true : false;
}
if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock
|| (AscCommonWord.sdtlock_SdtLocked === nContentControlLock && true !== bSelectedOnlyThis)
|| (AscCommonWord.sdtlock_ContentLocked === nContentControlLock && true === bSelectedOnlyThis))
{
return AscCommon.CollaborativeEditing.Add_CheckLock(true);
}
}
else if ((AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Document_Content === CheckType
......
......@@ -1045,6 +1045,7 @@
var changestype_None = 0; // Ничего не происходит с выделенным элементом (проверка идет через дополнительный параметр)
var changestype_Paragraph_Content = 1; // Добавление/удаление элементов в параграф
var changestype_Paragraph_Properties = 2; // Изменение свойств параграфа
var changestype_Paragraph_AddText = 3; // Добавление текста
var changestype_Document_Content = 10; // Добавление/удаление элементов в Document или в DocumentContent
var changestype_Document_Content_Add = 11; // Добавление элемента в класс Document или в класс DocumentContent
var changestype_Document_SectPr = 12; // Изменения свойств данной секции (размер страницы, поля и ориентация)
......@@ -1747,6 +1748,7 @@
window["AscCommon"].changestype_None = changestype_None;
window["AscCommon"].changestype_Paragraph_Content = changestype_Paragraph_Content;
window["AscCommon"].changestype_Paragraph_Properties = changestype_Paragraph_Properties;
window["AscCommon"].changestype_Paragraph_AddText = changestype_Paragraph_AddText;
window["AscCommon"].changestype_Document_Content = changestype_Document_Content;
window["AscCommon"].changestype_Document_Content_Add = changestype_Document_Content_Add;
window["AscCommon"].changestype_Document_SectPr = changestype_Document_SectPr;
......
......@@ -7106,7 +7106,7 @@ CDocument.prototype.OnKeyPress = function(e)
if (Code > 0x20)
{
if (false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content, null, true, this.IsFormFieldEditing()))
if (false === this.Document_Is_SelectionLocked(AscCommon.changestype_Paragraph_AddText, null, true, this.IsFormFieldEditing()))
{
this.Create_NewHistoryPoint(AscDFH.historydescription_Document_AddLetter);
......
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