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

разделены вставка формулы в текст и mathcontent

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56394 954022d7-b5bf-4e40-9824-e11837661b57
parent 1d7e54fb
......@@ -159,26 +159,33 @@ ParaMath.prototype =
History.Create_NewPoint();
var oMRun = new ParaRun(this.Paragraph, true);
oMRun.Pr = oStartContent.Pr;
for (i=nPosStart; i<nLenStart; i++)
if(nPosStart != nLenStart)
{
var Pos = oMRun.Content.length;
var EndPos = Pos + 1;
var oItem = oStartContent.Content[i];
oMRun.Add(oItem);
oStartContent.Remove_FromContent(i, 1, false);
var oMRun = new ParaRun(this.Paragraph, true);
oMRun.Pr = oStartContent.Pr;
for (i=nPosStart; i<nLenStart; i++)
{
var Pos = oMRun.Content.length;
var EndPos = Pos + 1;
var oItem = oStartContent.Content[i];
oMRun.Add(oItem);
oStartContent.Remove_FromContent(i, 1, false);
}
}
oContent.Content.CurPos++;
oContent.Content.Load_FromMenu(Item.Menu, this.Paragraph);
var items = new Array();
oContent.Content.addElementToContent(oMRun);
items.push(oMRun);
var Pos = oContent.Content.CurPos,
PosEnd = Pos + 1;
History.Add(oContent.Content, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: PosEnd});
if(nPosStart != nLenStart)
{
var items = new Array();
oContent.Content.addElementToContent(oMRun);
items.push(oMRun);
var Pos = oContent.Content.CurPos,
PosEnd = Pos + 1;
History.Add(oContent.Content, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: PosEnd});
}
oContent.Content.SetRunEmptyToContent(false);
}
......
......@@ -5077,6 +5077,8 @@ CMathContent.prototype =
this.bRoot = false;
this.Parent = Parent;
}
if (this.content.length == 0)
this.fillPlaceholders();
for(var pos = 0; pos < this.content.length; pos++)
{
......@@ -6770,6 +6772,21 @@ CMathContent.prototype =
}
}
},
Add: function (oElem, Pos)
{
oElem.Parent = this;
if(oElem.typeObj === MATH_COMP)
{
oElem.setArgSize(this.argSize);
this.content.splice(Pos,0,oElem);
}
else
{
this.content.push(obj);
}
this.CurPos++;
},
Save_Changes: function(Data, Writer)
{
......@@ -6877,6 +6894,27 @@ CMathContent.prototype =
this.content.splice( Pos, 0, Element );
}
break;
}
case historyitem_Math_RemoveItem:
{
// Long : Количество удаляемых элементов
// Array of Long : позиции удаляемых элементов
var Count = Reader.GetLong();
for ( var Index = 0; Index < Count; Index++ )
{
var ChangesPos = this.m_oContentChanges.Check( contentchanges_Remove, Reader.GetLong() );
// действие совпало, не делаем его
if ( false === ChangesPos )
continue;
var Pos = ( true !== Debug_ParaRunMode ? this.Internal_Get_RealPos( ChangesPos ) : ChangesPos );
this.Content.splice( Pos, 1 );
}
break;
}
}
......@@ -9023,7 +9061,7 @@ CMathContent.prototype =
if (oParent)
{
oParent.addElementToContent(oElem);
oParent.Add(oElem,Pos);
items.push(oElem);
History.Add(oParent, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: PosEnd});
}
......
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