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

1) поправлен баг на удаление последнего элемента из run

2) прокинут argSz на чтение
3) при вставке первой формулы в mathcontent позиция curpos остается в нуле

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57503 954022d7-b5bf-4e40-9824-e11837661b57
parent 1db308b4
...@@ -303,8 +303,9 @@ ParaMath.prototype = ...@@ -303,8 +303,9 @@ ParaMath.prototype =
} }
else //справа есть элемент else //справа есть элемент
{ {
var nextElem = oContent.Content.getElem(oContent.Start + 1); var nNextElem = oContent.Start + 1;
if (nextElem.typeObj == para_Math_Composition) //справа композиция var nextElem = oContent.Content.getElem(nNextElem);
if (nextElem.Type == para_Math_Composition) //справа композиция
{ {
this.Set_Select_ToMComp(Direction); this.Set_Select_ToMComp(Direction);
return; return;
...@@ -317,8 +318,8 @@ ParaMath.prototype = ...@@ -317,8 +318,8 @@ ParaMath.prototype =
if(nextElem.Content.length == 0 && !bOnAddText) //тк pararun пустой, удаляем его if(nextElem.Content.length == 0 && !bOnAddText) //тк pararun пустой, удаляем его
{ {
var Items = []; var Items = [];
Items.push(nextElem.Parent.content[0]); Items.push(nextElem);
nextElem.Parent.content.splice( 0, 1 ); nextElem.Parent.content.splice( nNextElem, 1 );
History.Add(nextElem.Parent, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: 0}); History.Add(nextElem.Parent, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: 0});
} }
return; return;
...@@ -331,9 +332,9 @@ ParaMath.prototype = ...@@ -331,9 +332,9 @@ ParaMath.prototype =
if(oElem.Content.length == 0 && !bOnAddText) //тк pararun пустой, удаляем его if(oElem.Content.length == 0 && !bOnAddText) //тк pararun пустой, удаляем его
{ {
var Items = []; var Items = [];
Items.push(oElem.Parent.content[0]); Items.push(oElem.Parent.content[oContent.Start]);
oElem.Parent.content.splice( 0, 1 ); oElem.Parent.content.splice( oContent.Start, 1 );
History.Add(oElem.Parent, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: 0}); History.Add(oElem.Parent, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: oContent.Start});
if (Direction < 0) if (Direction < 0)
oContent.Content.CurPos--; oContent.Content.CurPos--;
} }
......
...@@ -8434,6 +8434,7 @@ function Binary_oMathReader(stream) ...@@ -8434,6 +8434,7 @@ function Binary_oMathReader(stream)
res = this.bcr.Read2(length, function(t, l){ res = this.bcr.Read2(length, function(t, l){
return oThis.ReadMathArgSz(t,l,props); return oThis.ReadMathArgSz(t,l,props);
}); });
oElem.SetArgSize(props.argSz);
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
......
...@@ -7179,6 +7179,7 @@ CMathContent.prototype = ...@@ -7179,6 +7179,7 @@ CMathContent.prototype =
{ {
this.content.splice(Pos,0,oElem); this.content.splice(Pos,0,oElem);
} }
if (this.content.length != 1)
this.CurPos++; this.CurPos++;
}, },
AddText : function(oElem, sText) AddText : function(oElem, sText)
......
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