Commit e57ac25d authored by Sergey.Tsarkov's avatar Sergey.Tsarkov Committed by Alexander.Trofimov

баги на редактировании формул

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56698 954022d7-b5bf-4e40-9824-e11837661b57
parent f71c8296
......@@ -212,12 +212,10 @@ ParaMath.prototype =
Remove : function(Direction, bOnAddText)
{
var oContent = this.GetSelectContent();
this.Set_Select_ToMComp(Direction);
if (oContent.Start == oContent.End)
{
var oElem = oContent.Content.getElem(oContent.Start);
if (oElem.typeObj == MATH_COMP)
this.RemoveElem(oContent, Direction, bOnAddText);
else if (oElem.typeObj == MATH_PLACEHOLDER && bOnAddText == false)
......@@ -242,6 +240,11 @@ ParaMath.prototype =
}
else //pararun
{
if ((Direction > 0 && oElem.State.ContentPos + 1 > oElem.Content.length) || (Direction < 0 && oElem.State.ContentPos - 1 < 0))
{
this.Set_Select_ToMComp(Direction);
return;
}
History.Create_NewPoint();
oElem.Remove(Direction, bOnAddText);
if(oElem.Content.length == 0 && !bOnAddText) //тк pararun пустой, удаляем его
......@@ -255,6 +258,7 @@ ParaMath.prototype =
}
else
return this.RemoveElem(oContent, Direction, bOnAddText);
},
RemoveElem: function(oContent, Direction, bOnAdd)
......@@ -263,19 +267,8 @@ ParaMath.prototype =
end = oContent.End,
oMathContent = oContent.Content;
if(start == end)
{
var elem = oMathContent.content[start];
if(elem.typeObj == MATH_PARA_RUN && elem.Is_Empty())
{
}
}
History.Create_NewPoint();
History.Create_NewPoint();
var oStartContent = oContent.Content.content[oContent.Start];
var oEndContent = oContent.Content.content[oContent.End];
var Items = [];
......@@ -283,6 +276,7 @@ ParaMath.prototype =
{
Items.push(oContent.Content.content[i]);
oContent.Content.content.splice( i, 1 );
oContent.Content.CurPos--;
}
History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: oContent.Start});
return;
......
......@@ -5053,7 +5053,7 @@ CMathContent.prototype =
this.bRoot = false;
this.Parent = Parent;
}
if (this.content.length == 0)
if (!this.bRoot && this.content.length == 0)
this.fillPlaceholders();
var lng = this.content.length;
......@@ -6837,7 +6837,7 @@ CMathContent.prototype =
for ( var Index = 0; Index < Count; Index++ )
{
var Pos = Reader.GetLong();
this.Content.splice( Pos, 1 );
this.content.splice( Pos, 1 );
}
break;
......
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