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

Fixed bug #34145.

parent 44411180
......@@ -318,11 +318,15 @@ CChangesDocumentRemoveItem.prototype.Load = function(Color)
oDocument.Content[Pos].Prev = null;
}
if(oDocument.SectionsInfo)
if (0 <= Pos && Pos <= oDocument.Content.length - 1)
{
oDocument.SectionsInfo.Update_OnRemove(Pos, 1);
if (oDocument.SectionsInfo)
{
oDocument.SectionsInfo.Update_OnRemove(Pos, 1);
}
oDocument.private_ReindexContent(Pos);
}
oDocument.private_ReindexContent(Pos);
}
};
CChangesDocumentRemoveItem.prototype.IsRelated = function(oChanges)
......
......@@ -2595,7 +2595,7 @@ CTable.prototype =
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);
......@@ -2667,29 +2667,30 @@ CTable.prototype =
}
if ( NewDocContent != OldDocContent )
{
// Сначала добавляем таблицу в новый класс
NewDocContent.Internal_Content_Add( NewIndex, this );
var oTargetTable = AscCommon.CollaborativeEditing.Is_SingleUser() ? this : this.Copy(NewDocContent);
if (NewDocContent != OldDocContent)
{
// Сначала добавляем таблицу в новый класс
NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
// Удаляем таблицу из родительского класса
OldDocContent.Internal_Content_Remove( OldIndex, 1 );
// Удаляем таблицу из родительского класса
OldDocContent.Internal_Content_Remove(OldIndex, 1);
this.Parent = NewDocContent;
}
else
{
if ( NearestPos.Paragraph.Index > this.Index )
{
NewDocContent.Internal_Content_Add( NewIndex, this );
OldDocContent.Internal_Content_Remove( OldIndex, 1 );
}
else
{
OldDocContent.Internal_Content_Remove( OldIndex, 1 );
NewDocContent.Internal_Content_Add( NewIndex, this );
}
}
oTargetTable.Parent = NewDocContent;
}
else
{
if (NearestPos.Paragraph.Index > this.Index)
{
NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
OldDocContent.Internal_Content_Remove(OldIndex, 1);
}
else
{
OldDocContent.Internal_Content_Remove(OldIndex, 1);
NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
}
}
}
editor.WordControl.m_oLogicDocument.Recalculate();
......@@ -2700,7 +2701,7 @@ CTable.prototype =
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);
......@@ -2734,30 +2735,30 @@ CTable.prototype =
NewIndex++;
}
var oTargetTable = AscCommon.CollaborativeEditing.Is_SingleUser() ? this : this.Copy(NewDocContent);
if (NewDocContent != OldDocContent)
{
// Сначала добавляем таблицу в новый класс
NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
if ( NewDocContent != OldDocContent )
{
// Сначала добавляем таблицу в новый класс
NewDocContent.Internal_Content_Add( NewIndex, this );
// Удаляем таблицу из родительского класса
OldDocContent.Internal_Content_Remove( OldIndex, 1 );
// Удаляем таблицу из родительского класса
OldDocContent.Internal_Content_Remove(OldIndex, 1);
this.Parent = NewDocContent;
}
else
{
if ( NearestPos.Paragraph.Index > this.Index )
{
NewDocContent.Internal_Content_Add( NewIndex, this );
OldDocContent.Internal_Content_Remove( OldIndex, 1 );
}
else
{
OldDocContent.Internal_Content_Remove( OldIndex, 1 );
NewDocContent.Internal_Content_Add( NewIndex, this );
}
}
oTargetTable.Parent = NewDocContent;
}
else
{
if (NearestPos.Paragraph.Index > this.Index)
{
NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
OldDocContent.Internal_Content_Remove(OldIndex, 1);
}
else
{
OldDocContent.Internal_Content_Remove(OldIndex, 1);
NewDocContent.Internal_Content_Add(NewIndex, oTargetTable);
}
}
editor.WordControl.m_oLogicDocument.Recalculate();
}
......@@ -12689,3 +12690,4 @@ CTableAnchorPosition.prototype =
//--------------------------------------------------------export----------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {};
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