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