Commit 4d6a3ce4 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #34145.

parent 44411180
...@@ -318,12 +318,16 @@ CChangesDocumentRemoveItem.prototype.Load = function(Color) ...@@ -318,12 +318,16 @@ CChangesDocumentRemoveItem.prototype.Load = function(Color)
oDocument.Content[Pos].Prev = null; oDocument.Content[Pos].Prev = null;
} }
if(oDocument.SectionsInfo) if (0 <= Pos && Pos <= oDocument.Content.length - 1)
{
if (oDocument.SectionsInfo)
{ {
oDocument.SectionsInfo.Update_OnRemove(Pos, 1); oDocument.SectionsInfo.Update_OnRemove(Pos, 1);
} }
oDocument.private_ReindexContent(Pos); oDocument.private_ReindexContent(Pos);
} }
}
}; };
CChangesDocumentRemoveItem.prototype.IsRelated = function(oChanges) CChangesDocumentRemoveItem.prototype.IsRelated = function(oChanges)
{ {
......
...@@ -2595,7 +2595,7 @@ CTable.prototype = ...@@ -2595,7 +2595,7 @@ CTable.prototype =
if ( true != this.Is_Inline() ) if ( true != this.Is_Inline() )
{ {
if ( false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Table_Properties) ) if ( false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Table_Properties, null, true) )
{ {
oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_MoveInlineTable); oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_MoveInlineTable);
...@@ -2667,27 +2667,28 @@ CTable.prototype = ...@@ -2667,27 +2667,28 @@ CTable.prototype =
} }
if ( NewDocContent != OldDocContent ) var oTargetTable = AscCommon.CollaborativeEditing.Is_SingleUser() ? this : this.Copy(NewDocContent);
if (NewDocContent != OldDocContent)
{ {
// Сначала добавляем таблицу в новый класс // Сначала добавляем таблицу в новый класс
NewDocContent.Internal_Content_Add( NewIndex, this ); NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
// Удаляем таблицу из родительского класса // Удаляем таблицу из родительского класса
OldDocContent.Internal_Content_Remove( OldIndex, 1 ); OldDocContent.Internal_Content_Remove(OldIndex, 1);
this.Parent = NewDocContent; oTargetTable.Parent = NewDocContent;
} }
else else
{ {
if ( NearestPos.Paragraph.Index > this.Index ) if (NearestPos.Paragraph.Index > this.Index)
{ {
NewDocContent.Internal_Content_Add( NewIndex, this ); NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
OldDocContent.Internal_Content_Remove( OldIndex, 1 ); OldDocContent.Internal_Content_Remove(OldIndex, 1);
} }
else else
{ {
OldDocContent.Internal_Content_Remove( OldIndex, 1 ); OldDocContent.Internal_Content_Remove(OldIndex, 1);
NewDocContent.Internal_Content_Add( NewIndex, this ); NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
} }
} }
} }
...@@ -2700,7 +2701,7 @@ CTable.prototype = ...@@ -2700,7 +2701,7 @@ CTable.prototype =
else else
{ {
// Проверяем, можно ли двигать данную таблицу // Проверяем, можно ли двигать данную таблицу
if ( false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Table_Properties, { Type : AscCommon.changestype_2_InlineObjectMove, PageNum : PageNum, X : X, Y : Y }) ) if ( false === oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Table_Properties, { Type : AscCommon.changestype_2_InlineObjectMove, PageNum : PageNum, X : X, Y : Y }, true) )
{ {
oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_MoveFlowTable); oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_MoveFlowTable);
...@@ -2734,28 +2735,28 @@ CTable.prototype = ...@@ -2734,28 +2735,28 @@ CTable.prototype =
NewIndex++; NewIndex++;
} }
var oTargetTable = AscCommon.CollaborativeEditing.Is_SingleUser() ? this : this.Copy(NewDocContent);
if ( NewDocContent != OldDocContent ) if (NewDocContent != OldDocContent)
{ {
// Сначала добавляем таблицу в новый класс // Сначала добавляем таблицу в новый класс
NewDocContent.Internal_Content_Add( NewIndex, this ); NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
// Удаляем таблицу из родительского класса // Удаляем таблицу из родительского класса
OldDocContent.Internal_Content_Remove( OldIndex, 1 ); OldDocContent.Internal_Content_Remove(OldIndex, 1);
this.Parent = NewDocContent; oTargetTable.Parent = NewDocContent;
} }
else else
{ {
if ( NearestPos.Paragraph.Index > this.Index ) if (NearestPos.Paragraph.Index > this.Index)
{ {
NewDocContent.Internal_Content_Add( NewIndex, this ); NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
OldDocContent.Internal_Content_Remove( OldIndex, 1 ); OldDocContent.Internal_Content_Remove(OldIndex, 1);
} }
else else
{ {
OldDocContent.Internal_Content_Remove( OldIndex, 1 ); OldDocContent.Internal_Content_Remove(OldIndex, 1);
NewDocContent.Internal_Content_Add( NewIndex, this ); NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
} }
} }
...@@ -12689,3 +12690,4 @@ CTableAnchorPosition.prototype = ...@@ -12689,3 +12690,4 @@ CTableAnchorPosition.prototype =
//--------------------------------------------------------export---------------------------------------------------- //--------------------------------------------------------export----------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {}; window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].CTable = CTable; window['AscCommonWord'].CTable = CTable;
window['AscCommonWord'].type_Table = type_Table;
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