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

1. Попрпавила баг : не пересчитывался размер формулы при смене текстовых настроек

2. На Correct_Pos добавила проверку на плейсхолдер для контента

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58675 954022d7-b5bf-4e40-9824-e11837661b57
parent 1320ec21
......@@ -28,14 +28,7 @@ function ParaMath()
this.Id = g_oIdCounter.Get_NewId();
this.Type = para_Math;
//this.MathPara = true; // false - внутристроковая формула, true - формула на отдельной строке (w:oMath/w:oMathPara)
//this.OldMathPara = null;
this.Jc = undefined;
//this.Math = new CMathComposition();
//this.Math.Parent = this;
//this.Root = this.Math.Root;
this.Root = new CMathContent();
this.Root.bRoot = true;
......@@ -43,14 +36,11 @@ function ParaMath()
this.X = 0;
this.Y = 0;
//this.CurrentContent = this.RootComposition;
//this.SelectContent = this.RootComposition;
this.bInline = false;
this.bChangeInline = true;
this.NeedResize = true;
this.bSelectionUse = false;
//this.State = new CParaRunState(); // Положение курсора и селекта для данного run
this.Paragraph = null;
......@@ -63,7 +53,6 @@ function ParaMath()
this.Descent = 0;
this.DefaultTextPr = new CTextPr();
//this.DefaultTextPr.Init_Default();
this.DefaultTextPr.Italic = true;
this.DefaultTextPr.FontFamily = {Name : "Cambria Math", Index : -1 };
......@@ -170,6 +159,8 @@ ParaMath.prototype.Add = function(Item)
var oStartContent = oContent.Content.content[oContent.Start];
var oEndContent = oContent.Content.content[oContent.End];
if ( para_Text === Type)
{
var oText = new CMathText(false);
......@@ -233,8 +224,11 @@ ParaMath.prototype.Add = function(Item)
}
oContent.Content.SetRunEmptyToContent(true);
}
oContent.Content.Correct_Content();
};
ParaMath.prototype.Remove = function(Direction, bOnAddText)
......@@ -406,6 +400,8 @@ ParaMath.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
{
// TODO: ParaMath.Apply_TextPr
this.NeedResize = true;
if(ApplyToAll == true) // для ситуации, когда ApplyToAll = true, в Root формулы при этом позиции селекта не проставлены
{
this.Root.Apply_TextPr(TextPr, IncFontSize, true);
......@@ -572,13 +568,8 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
else
this.Root.Resize_2(g_oTextMeasurer, null, this, RPI/*recalculate properties info*/, ArgSize);
this.NeedResize = false;
//this.OldMathPara = this.MathPara;
//this.Root.Resize(null, this, g_oTextMeasurer, RPI/*recalculate properties info*/, TextPr);
this.Width = this.Root.size.width;
this.Height = this.Root.size.height;
......
......@@ -7971,6 +7971,14 @@ ParaRun.prototype.fillPlaceholders = function()
this.Add_ToContent(0, placeholder, false);
}
ParaRun.prototype.Math_Correct_Content = function()
{
for(var i = 0; i < this.Content.length; i++)
{
if(this.Content[i].Type == para_Math_Placeholder)
this.Remove_FromContent(i, 1, true);
}
}
ParaRun.prototype.Set_MathPr = function(MPrp)
{
var OldValue = this.MathPrp;
......
......@@ -3975,9 +3975,6 @@ CMathContent.prototype =
var GapsInfo = new CMathGapsInfo(oMeasure, this, this.Compiled_ArgSz.value);
if (!this.bRoot && this.content.length == 0)
this.fillPlaceholders();
this.RecalcInfo.bEqqArray = RPI.bEqqArray;
var lng = this.content.length;
......@@ -4438,7 +4435,7 @@ CMathContent.prototype =
}
this.Selection.Start = posStart;
this.Selection.End = posEnd;
this.Selection.End = posEnd;
Depth++;
if(this.IsPlaceholder())
......@@ -4831,7 +4828,6 @@ CMathContent.prototype =
this.Internal_Content_Add(len, emptyRun);
}
},
Correct_Content : function()
{
......@@ -4857,6 +4853,19 @@ CMathContent.prototype =
nLen--;
}
}
if(para_Math_Run === oCurrElement.Type)
oCurrElement.Math_Correct_Content();
}
if (this.content.length == 1)
{
if(para_Math_Run === this.content[0].Type)
this.content[0].Math_Correct_Content();
if(this.content[0].Is_Empty())
this.content[0].fillPlaceholders();
}
},
......
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