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

Поправила баг : теперь при отсутствии селекта добавляем пустой ран на...

Поправила баг : теперь при отсутствии селекта добавляем пустой ран на Apply_TextPr с новыми текстовыми настройками 

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57205 954022d7-b5bf-4e40-9824-e11837661b57
parent ab39902f
......@@ -4902,8 +4902,6 @@ CMathContent.prototype =
}
}
else
{
if(this.Selection.Use)
{
var StartPos = this.Selection.Start;
var EndPos = this.Selection.End;
......@@ -4911,21 +4909,22 @@ CMathContent.prototype =
var NewRuns;
var LRun, CRun, RRun;
if(StartPos == EndPos)
if( !this.Selection.Use || (this.Selection.Use && StartPos == EndPos) ) // TextPr меняем только в одном Run
{
NewRuns = this.content[StartPos].Apply_TextPr(TextPr, IncFontSize, false);
var Pos = !this.Selection.Use ? this.CurPos : StartPos;
NewRuns = this.content[Pos].Apply_TextPr(TextPr, IncFontSize, false);
LRun = NewRuns[0];
CRun = NewRuns[1];
RRun = NewRuns[2];
var CRunPos = StartPos;
var Pos;
var CRunPos = Pos;
if(LRun !== null)
{
this.Internal_Content_Add(StartPos+1, CRun);
CRunPos = StartPos + 1;
this.Internal_Content_Add(Pos+1, CRun);
CRunPos = Pos + 1;
}
if(RRun !== null)
......@@ -4936,6 +4935,7 @@ CMathContent.prototype =
this.CurPos = CRunPos;
this.Selection.Start = CRunPos;
this.Selection.End = CRunPos;
}
else
{
......@@ -4952,7 +4952,7 @@ CMathContent.prototype =
if(this.content[EndPos].Type == para_Math_Run)
{
NewRuns = this.content[EndPos].Apply_TextPr(TextPr, IncFontSize, ApplyToAll);
NewRuns = this.content[EndPos].Apply_TextPr(TextPr, IncFontSize, false);
// LRun - null
CRun = NewRuns[1];
......@@ -4970,7 +4970,7 @@ CMathContent.prototype =
if(this.content[StartPos].Type == para_Math_Run)
{
NewRuns = this.content[StartPos].Apply_TextPr(TextPr, IncFontSize, ApplyToAll);
NewRuns = this.content[StartPos].Apply_TextPr(TextPr, IncFontSize, false);
LRun = NewRuns[0];
CRun = NewRuns[1];
......@@ -4979,9 +4979,6 @@ CMathContent.prototype =
if(LRun !== null)
{
//Pos = StartPos + 1;
//History.Add(this, {Type: historyitem_Math_AddItem, Pos: Pos, PosEnd: Pos+1, Items: [CRun]});
//this.content.splice(Pos, 0, CRun);
this.Internal_Content_Add(StartPos+1, CRun);
}
......@@ -4999,37 +4996,6 @@ CMathContent.prototype =
this.Selection.End--;
else if ( this.Selection.End < this.Selection.Start && true === this.content[this.Selection.Start].Selection_IsEmpty(true) )
this.Selection.Start--;
}
/*if ( StartPos === EndPos )
{
elem = this.content[StartPos];
if( elem.Type == para_Math_Composition)
elem.Apply_TextPr( TextPr, IncFontSize, true );
else if(elem.Type == para_Math_Run)
elem.Apply_TextPr( TextPr, IncFontSize, false );
}
else
{
for(var i = StartPos; i <= EndPos; i++)
{
elem = this.content[i];
if( elem.Type == para_Math_Composition)
elem.Apply_TextPr( TextPr, IncFontSize, true );
else if(elem.Type == para_Math_Run)
elem.Apply_TextPr( TextPr, IncFontSize, false );
}
}*/
}
else
{
this.content[this.CurPos].Apply_TextPr( TextPr, IncFontSize, false );
}
}
},
......
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