Commit 8e40f05f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлены баги с удалением внутри формул.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52729 954022d7-b5bf-4e40-9824-e11837661b57
parent 727bdcab
......@@ -5604,16 +5604,7 @@ Paragraph.prototype =
// После удаления в математическом элементе может остаться выделение
if ( true === MathItem.Selection_IsUse() && false === MathItem.Selection_IsEmpty() )
{
this.Selection.Use = true;
this.Selection.Start = false;
this.Selection.StartPos = CurPos2;
this.Selection.EndPos = CurPos2 + 1;
this.Selection.StartPos2 = CurPos2;
this.Selection.EndPos2 = CurPos2;
this.Document_SetThisElementCurrent();
}
this.Internal_SelectMath( CurPos2 );
return true;
}
......@@ -5635,7 +5626,7 @@ Paragraph.prototype =
{
var LetterPos = CurPos - 1;
var oPos = this.Internal_FindBackward( LetterPos, [para_PageNum, para_Drawing, para_Tab, para_Text, para_Space, para_NewLine] );
var oPos = this.Internal_FindBackward( LetterPos, [para_PageNum, para_Drawing, para_Tab, para_Text, para_Space, para_NewLine, para_Math] );
if ( oPos.Found )
{
......@@ -5643,6 +5634,27 @@ Paragraph.prototype =
{
this.Parent.Select_DrawingObject( this.Content[oPos.LetterPos].Get_Id() );
}
else if ( para_Math === oPos.Type )
{
var MathElement = this.Content[oPos.LetterPos];
MathElement.Cursor_MoveToEndPos();
MathElement.Remove( -1, false );
if ( true === MathElement.Is_Empty() )
{
this.Internal_Content_Remove( oPos.LetterPos );
this.Set_ContentPos( oPos.LetterPos, true, -1 );
}
else
{
this.Set_ContentPos( oPos.LetterPos, true, -1 );
if ( true === MathElement.Selection_IsUse() && false === MathElement.Selection_IsEmpty() )
this.Internal_SelectMath( oPos.LetterPos );
else
this.CurPos.ContentPos2 = oPos.LetterPos;
}
}
else
{
// Удаляем элемент в найденной позиции и уменьшаем текущую позицию
......@@ -5716,16 +5728,7 @@ Paragraph.prototype =
// После удаления в математическом элементе может остаться выделение
if ( true === MathItem.Selection_IsUse() && false === MathItem.Selection_IsEmpty() )
{
this.Selection.Use = true;
this.Selection.Start = false;
this.Selection.StartPos = CurPos2;
this.Selection.EndPos = CurPos2 + 1;
this.Selection.StartPos2 = CurPos2;
this.Selection.EndPos2 = CurPos2;
this.Document_SetThisElementCurrent();
}
this.Internal_SelectMath( CurPos2 );
return true;
}
......@@ -5749,7 +5752,7 @@ Paragraph.prototype =
{
var LetterPos = CurPos;
var oPos = this.Internal_FindForward( LetterPos, [para_PageNum, para_Drawing, para_Tab, para_Text, para_Space, para_NewLine] );
var oPos = this.Internal_FindForward( LetterPos, [para_PageNum, para_Drawing, para_Tab, para_Text, para_Space, para_NewLine, para_Math] );
if ( oPos.Found )
{
......@@ -5757,6 +5760,27 @@ Paragraph.prototype =
{
this.Parent.Select_DrawingObject( this.Content[oPos.LetterPos].Get_Id() );
}
else if ( para_Math === oPos.Type )
{
var MathElement = this.Content[oPos.LetterPos];
MathElement.Cursor_MoveToStartPos();
MathElement.Remove( 1, false );
if ( true === MathElement.Is_Empty() )
{
this.Internal_Content_Remove( oPos.LetterPos );
this.Set_ContentPos( oPos.LetterPos, true, -1 );
}
else
{
this.Set_ContentPos( oPos.LetterPos, true, -1 );
if ( true === MathElement.Selection_IsUse() && false === MathElement.Selection_IsEmpty() )
this.Internal_SelectMath( oPos.LetterPos );
else
this.CurPos.ContentPos2 = oPos.LetterPos;
}
}
else
{
// Удаляем элемент в найденной позиции и меняем текущую позицию
......
......@@ -7575,6 +7575,11 @@ ParaMath.prototype =
}
},
Is_Empty : function()
{
return false;
},
Remove : function(Order, bOnAddText)
{
return this.Math.Remove(Order, bOnAddText);
......
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