Commit 95c1a769 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Set_Select_ToMComp для селекта мат объекта на Remove

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56112 954022d7-b5bf-4e40-9824-e11837661b57
parent 385e3204
......@@ -277,6 +277,9 @@ 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);
......@@ -318,14 +321,6 @@ ParaMath.prototype =
}
History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: oContent.Start});
return;
},
SetSelectionForRemove: function(Content, pos)
{
this.bSelectionUse = true;
},
GetSelectContent: function()
......@@ -343,11 +338,12 @@ ParaMath.prototype =
return new CParaPos( this.StartRange, this.StartLine, 0, 0 );
},
Apply_TextPr : function(TextPr, IncFontSize, ApplyToAll)
{
// TODO: ParaMath.Apply_TextPr
this.Root.Apply_TextPr();
},
Clear_TextPr : function()
......@@ -1036,6 +1032,13 @@ ParaMath.prototype =
return TextPrp;
},
Set_Select_ToMComp: function(Direction)
{
this.bSelectionUse = true;
this.Root.Set_Select_ToMComp(Direction);
console.log("bSelectionUse : " + this.bSelectionUse);
},
//-----------------------------------------------------------------------------------
// Функции отрисовки
//-----------------------------------------------------------------------------------
......@@ -1085,6 +1088,7 @@ ParaMath.prototype =
PDSL.X += this.Width;
}
},
//-----------------------------------------------------------------------------------
// Функции для работы с курсором
//-----------------------------------------------------------------------------------
......@@ -1217,14 +1221,14 @@ ParaMath.prototype =
var Pos = ContentPos.Get(Depth);
this.State.ContentPos = Pos;
console.log("Set_ParaContentPos");
/*console.log("Set_ParaContentPos");
var str = "";
for(var i = 0; i < ContentPos.Data.length; i++)
{
str += ContentPos.Data[i] + " ";
}
console.log(str);
console.log(str);*/
this.Root.Set_ParaContentPos(ContentPos, Depth);
},
......@@ -1245,15 +1249,6 @@ ParaMath.prototype =
// TODO: ParaMath.Get_LeftPos
var result = this.Root.Get_LeftPos(SearchPos, ContentPos, Depth, UseContentPos, false);
console.log("Get_LeftPos");
var str = "";
for(var i = 0; i < SearchPos.Pos.Data.length; i++)
{
str += SearchPos.Pos.Data[i] + " ";
}
console.log(str);
return result;
},
......
......@@ -1626,6 +1626,22 @@ CMathBase.prototype =
Get_CompiledPr: function(Copy)
{
return this.Get_CompiledTextPr(Copy);
},
Set_Select_ToMComp: function(Direction)
{
this.SelectStart_X = this.SelectEnd_X = this.CurPos_X;
this.SelectStart_Y = this.SelectEnd_Y = this.CurPos_Y;
this.elements[this.CurPos_X][this.CurPos_Y].Set_Select_ToMComp(Direction);
},
SetSelectAll: function()
{
this.SelectStart_X = 0;
this.SelectStart_Y = 0;
this.SelectEnd_X = this.nRow - 1;
this.SelectEnd_Y = this.nCol - 1;
}
//////////////////////////
......
......@@ -6483,6 +6483,29 @@ CMathContent.prototype =
this.bSelectionUse = false;
},
Set_Select_ToMComp: function(Direction)
{
this.bSelectionUse = true;
if(this.content[this.CurPos].typeObj == MATH_PARA_RUN)
{
if(Direction < 0 && this.CurPos > 0 && this.content[this.CurPos - 1].typeObj == MATH_COMP)
{
this.SelectStartPos = this.SelectEndPos = this.CurPos - 1;
this.content[this.CurPos - 1].SetSelectAll();
}
else if(this.CurPos < this.content.length - 1 && this.content[this.CurPos + 1].typeObj == MATH_COMP)
{
this.SelectStartPos = this.SelectEndPos = this.CurPos + 1;
this.content[this.CurPos + 1].SetSelectAll();
}
}
else
{
this.SelectStartPos = this.SelectEndPos = this.CurPos;
this.content[this.CurPos].Set_Select_ToMComp(Direction);
}
},
getElem: function(nNum)
{
return this.content[nNum];
......
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