Commit dde0b744 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@56591 954022d7-b5bf-4e40-9824-e11837661b57
parent 02d918fb
...@@ -155,18 +155,31 @@ ParaMath.prototype = ...@@ -155,18 +155,31 @@ ParaMath.prototype =
} }
else if ( para_Math === Type ) else if ( para_Math === Type )
{ {
var nPosStart = oStartContent.State.ContentPos; if (oStartContent.typeObj == MATH_PLACEHOLDER)
var nLenStart = oStartContent.Content.length; {
var nPosEnd = oEndContent.State.ContentPos; History.Create_NewPoint();
var Items = [];
Items.push(oContent.Content.content[0]);
oContent.Content.content.splice( 0, 1 );
History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: 0});
oContent.Content.Load_FromMenu(Item.Menu, this.Paragraph);
}
else
{
nPosStart = oStartContent.State.ContentPos;
nLenStart = oStartContent.Content.length;
nPosEnd = oEndContent.State.ContentPos;
History.Create_NewPoint(); History.Create_NewPoint();
if(nPosStart != nLenStart) if(nPosStart != nLenStart) //вставка идет в mathcontent
{ {
var oMRun = new ParaRun(this.Paragraph, true); var oMRun = new ParaRun(this.Paragraph, true);
oMRun.Pr = oStartContent.Pr; oMRun.Pr = oStartContent.Pr;
for (var i=nPosStart; i<nLenStart; i++) for (i=nPosStart; i<nLenStart; i++)
{ {
var Pos = oMRun.Content.length; var Pos = oMRun.Content.length;
var EndPos = Pos + 1; var EndPos = Pos + 1;
...@@ -191,6 +204,7 @@ ParaMath.prototype = ...@@ -191,6 +204,7 @@ ParaMath.prototype =
oContent.Content.SetRunEmptyToContent(false); oContent.Content.SetRunEmptyToContent(false);
} }
}
}, },
Remove : function(Direction, bOnAddText) Remove : function(Direction, bOnAddText)
...@@ -202,8 +216,27 @@ ParaMath.prototype = ...@@ -202,8 +216,27 @@ ParaMath.prototype =
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 || oElem.typeObj == MATH_PLACEHOLDER) if (oElem.typeObj == MATH_COMP)
this.RemoveElem(oContent, Direction, bOnAddText); this.RemoveElem(oContent, Direction, bOnAddText);
else if (oElem.typeObj == MATH_PLACEHOLDER && bOnAddText == false)
return;
else if (oElem.typeObj == MATH_PLACEHOLDER && bOnAddText == true)
{
History.Create_NewPoint();
var Items = new Array();
Items.push(oContent.Content.content[0]);
oContent.Content.content.splice( 0, 1 );
History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: 0});
var oMRun = new ParaRun(this.Paragraph, true);
oContent.Content.addElementToContent(oMRun);
var items = new Array();
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});
}
else //pararun else //pararun
{ {
History.Create_NewPoint(); History.Create_NewPoint();
......
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