Commit 728a2510 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #35573

parent c8409796
...@@ -207,6 +207,7 @@ CAbstractNum.prototype.Document_Is_SelectionLocked = function(CheckType) ...@@ -207,6 +207,7 @@ CAbstractNum.prototype.Document_Is_SelectionLocked = function(CheckType)
case AscCommon.changestype_Paragraph_Content: case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties: case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText: case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_ContentControl_Add:
{ {
this.Lock.Check( this.Get_Id() ); this.Lock.Check( this.Get_Id() );
break; break;
...@@ -242,6 +243,7 @@ if(typeof CGraphicObjects !== "undefined") ...@@ -242,6 +243,7 @@ if(typeof CGraphicObjects !== "undefined")
|| AscCommon.changestype_Remove === CheckType || AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Paragraph_Content === CheckType || AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType || AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_ContentControl_Add === CheckType
|| AscCommon.changestype_Paragraph_Properties === CheckType || AscCommon.changestype_Paragraph_Properties === CheckType
|| AscCommon.changestype_Document_Content_Add === CheckType) || AscCommon.changestype_Document_Content_Add === CheckType)
{ {
...@@ -272,6 +274,7 @@ CStyle.prototype.Document_Is_SelectionLocked = function(CheckType) ...@@ -272,6 +274,7 @@ CStyle.prototype.Document_Is_SelectionLocked = function(CheckType)
case AscCommon.changestype_Paragraph_Content: case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties: case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText: case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_ContentControl_Add:
case AscCommon.changestype_Document_Content: case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add: case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Image_Properties: case AscCommon.changestype_Image_Properties:
...@@ -294,6 +297,7 @@ CStyles.prototype.Document_Is_SelectionLocked = function(CheckType) ...@@ -294,6 +297,7 @@ CStyles.prototype.Document_Is_SelectionLocked = function(CheckType)
case AscCommon.changestype_Paragraph_Content: case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties: case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText: case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_ContentControl_Add:
case AscCommon.changestype_Document_Content: case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add: case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Image_Properties: case AscCommon.changestype_Image_Properties:
...@@ -420,6 +424,7 @@ Paragraph.prototype.Document_Is_SelectionLocked = function(CheckType) ...@@ -420,6 +424,7 @@ Paragraph.prototype.Document_Is_SelectionLocked = function(CheckType)
case AscCommon.changestype_Paragraph_Content: case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties: case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText: case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_ContentControl_Add:
case AscCommon.changestype_Document_Content: case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add: case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Image_Properties: case AscCommon.changestype_Image_Properties:
...@@ -528,6 +533,7 @@ CTable.prototype.Document_Is_SelectionLocked = function(CheckType, bCheckInner) ...@@ -528,6 +533,7 @@ CTable.prototype.Document_Is_SelectionLocked = function(CheckType, bCheckInner)
case AscCommon.changestype_Paragraph_Content: case AscCommon.changestype_Paragraph_Content:
case AscCommon.changestype_Paragraph_Properties: case AscCommon.changestype_Paragraph_Properties:
case AscCommon.changestype_Paragraph_AddText: case AscCommon.changestype_Paragraph_AddText:
case AscCommon.changestype_ContentControl_Add:
case AscCommon.changestype_Document_Content: case AscCommon.changestype_Document_Content:
case AscCommon.changestype_Document_Content_Add: case AscCommon.changestype_Document_Content_Add:
case AscCommon.changestype_Delete: case AscCommon.changestype_Delete:
...@@ -647,6 +653,7 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec ...@@ -647,6 +653,7 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
if (isCheckContentControlLock if (isCheckContentControlLock
&& (AscCommon.changestype_Paragraph_Content === CheckType && (AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType || AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_ContentControl_Add === CheckType
|| AscCommon.changestype_Remove === CheckType || AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Delete === CheckType || AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Document_Content === CheckType || AscCommon.changestype_Document_Content === CheckType
...@@ -655,7 +662,17 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec ...@@ -655,7 +662,17 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
&& this.IsSelectionUse() && this.IsSelectionUse()
&& this.IsSelectedAll()) && this.IsSelectedAll())
{ {
if (AscCommonWord.sdtlock_SdtContentLocked === nContentControlLock || AscCommonWord.sdtlock_SdtLocked === nContentControlLock) var bSelectedOnlyThis = false;
// Если это происходит на добавлении текста, тогда проверяем, что выделен только данный элемент
if ((AscCommon.changestype_Paragraph_AddText === CheckType || AscCommon.changestype_ContentControl_Add === CheckType) && this.LogicDocument)
{
var oInfo = this.LogicDocument.GetSelectedElementsInfo();
bSelectedOnlyThis = oInfo.GetBlockLevelSdt() === 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); return AscCommon.CollaborativeEditing.Add_CheckLock(true);
} }
...@@ -716,6 +733,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType) ...@@ -716,6 +733,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType)
if ((AscCommon.changestype_Paragraph_Content === CheckType if ((AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType || AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_ContentControl_Add === CheckType
|| AscCommon.changestype_Remove === CheckType || AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Delete === CheckType || AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Document_Content === CheckType || AscCommon.changestype_Document_Content === CheckType
...@@ -725,7 +743,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType) ...@@ -725,7 +743,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType)
{ {
var bSelectedOnlyThis = false; var bSelectedOnlyThis = false;
// Если это происходит на добавлении текста, тогда проверяем, что выделен только данный элемент // Если это происходит на добавлении текста, тогда проверяем, что выделен только данный элемент
if (AscCommon.changestype_Paragraph_AddText === CheckType && this.Paragraph && this.Paragraph.LogicDocument) if ((AscCommon.changestype_Paragraph_AddText === CheckType || AscCommon.changestype_ContentControl_Add === CheckType) && this.Paragraph && this.Paragraph.LogicDocument)
{ {
var oInfo = this.Paragraph.LogicDocument.GetSelectedElementsInfo(); var oInfo = this.Paragraph.LogicDocument.GetSelectedElementsInfo();
bSelectedOnlyThis = oInfo.GetInlineLevelSdt() === this ? true : false; bSelectedOnlyThis = oInfo.GetInlineLevelSdt() === this ? true : false;
...@@ -740,6 +758,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType) ...@@ -740,6 +758,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType)
} }
else if ((AscCommon.changestype_Paragraph_Content === CheckType else if ((AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Paragraph_AddText === CheckType || AscCommon.changestype_Paragraph_AddText === CheckType
|| AscCommon.changestype_ContentControl_Add === CheckType
|| AscCommon.changestype_Remove === CheckType || AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Delete === CheckType || AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Document_Content === CheckType || AscCommon.changestype_Document_Content === CheckType
......
...@@ -1056,6 +1056,7 @@ ...@@ -1056,6 +1056,7 @@
var changestype_Image_Properties = 23; // Изменения настроек картинки var changestype_Image_Properties = 23; // Изменения настроек картинки
var changestype_ContentControl_Remove = 24; // Удаление контейнера целиком var changestype_ContentControl_Remove = 24; // Удаление контейнера целиком
var changestype_ContentControl_Properties = 25; // Изменение свойств контейнера var changestype_ContentControl_Properties = 25; // Изменение свойств контейнера
var changestype_ContentControl_Add = 26; // Добавление контейнера
var changestype_HdrFtr = 30; // Изменения в колонтитуле (любые изменения) var changestype_HdrFtr = 30; // Изменения в колонтитуле (любые изменения)
var changestype_Remove = 40; // Удаление, через кнопку backspace (Удаление назад) var changestype_Remove = 40; // Удаление, через кнопку backspace (Удаление назад)
var changestype_Delete = 41; // Удаление, через кнопку delete (Удаление вперед) var changestype_Delete = 41; // Удаление, через кнопку delete (Удаление вперед)
...@@ -1758,6 +1759,7 @@ ...@@ -1758,6 +1759,7 @@
window["AscCommon"].changestype_Image_Properties = changestype_Image_Properties; window["AscCommon"].changestype_Image_Properties = changestype_Image_Properties;
window["AscCommon"].changestype_ContentControl_Remove = changestype_ContentControl_Remove; window["AscCommon"].changestype_ContentControl_Remove = changestype_ContentControl_Remove;
window["AscCommon"].changestype_ContentControl_Properties = changestype_ContentControl_Properties; window["AscCommon"].changestype_ContentControl_Properties = changestype_ContentControl_Properties;
window["AscCommon"].changestype_ContentControl_Add = changestype_ContentControl_Add;
window["AscCommon"].changestype_HdrFtr = changestype_HdrFtr; window["AscCommon"].changestype_HdrFtr = changestype_HdrFtr;
window["AscCommon"].changestype_Remove = changestype_Remove; window["AscCommon"].changestype_Remove = changestype_Remove;
window["AscCommon"].changestype_Delete = changestype_Delete; window["AscCommon"].changestype_Delete = changestype_Delete;
......
...@@ -7405,7 +7405,7 @@ background-repeat: no-repeat;\ ...@@ -7405,7 +7405,7 @@ background-repeat: no-repeat;\
var sDefaultText = AscCommon.translateManager.getValue('Your text here'); var sDefaultText = AscCommon.translateManager.getValue('Your text here');
if (AscCommonWord.sdttype_BlockLevel === nType) if (AscCommonWord.sdttype_BlockLevel === nType)
{ {
if (false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Document_Content)) if (false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_ContentControl_Add))
{ {
oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_AddBlockLevelContentControl); oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_AddBlockLevelContentControl);
...@@ -7434,7 +7434,7 @@ background-repeat: no-repeat;\ ...@@ -7434,7 +7434,7 @@ background-repeat: no-repeat;\
} }
else if (AscCommonWord.sdttype_InlineLevel === nType) else if (AscCommonWord.sdttype_InlineLevel === nType)
{ {
if (false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Paragraph_Content)) if (false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_ContentControl_Add))
{ {
oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_AddInlineLevelContentControl); oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_AddInlineLevelContentControl);
......
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