Commit 24a91cd2 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Сделана поддержка автозамен текста (автозамены формул не сделаны) в формулах.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59133 954022d7-b5bf-4e40-9824-e11837661b57
parent c721d56b
......@@ -169,27 +169,26 @@ ParaMath.prototype.Add = function(Item)
if (para_Math_Run !== Run.Type)
return;
var NewElement = null;
if (para_Text === Type)
{
if(Item.Value == 38)
{
var Amper = new CMathAmp();
Run.Add(Amper, true);
NewElement = new CMathAmp();
Run.Add(NewElement, true);
}
else
{
var oText = new CMathText(false);
oText.add(Item.Value);
Run.Add(oText, true);
NewElement = new CMathText(false);
NewElement.add(Item.Value);
Run.Add(NewElement, true);
}
}
else if (para_Space === Type)
{
var oText = new CMathText(false);
oText.addTxt(" ");
Run.Add(oText, true);
NewElement = new CMathText(false);
NewElement.addTxt(" ");
Run.Add(NewElement, true);
}
else if (para_Math === Type)
{
......@@ -218,6 +217,12 @@ ParaMath.prototype.Add = function(Item)
RightRun.Cursor_MoveToStartPos();
}
if ((para_Text === Type || para_Space === Type) && null !== NewElement)
{
// Пробуем произвести автозамену
oContent.Process_AutoCorrect(NewElement);
}
// Корректируем данный контент
oContent.Correct_Content(true);
};
......
......@@ -8084,6 +8084,26 @@ ParaRun.prototype.GetMathTextPr = function()
return {TextPr: TextPr, MathPr: this.MathPrp.Copy()};
}
ParaRun.prototype.Get_TextForAutoCorrect = function(AutoCorrectEngine, RunPos)
{
var ActionElement = AutoCorrectEngine.Get_ActionElement();
var nCount = this.Content.length;
for (var nPos = 0; nPos < nCount; nPos++)
{
var Item = this.Content[nPos];
if (para_Math_Text === Item.Type)
{
AutoCorrectEngine.Add_Text(String.fromCharCode(Item.value), this, nPos, RunPos);
}
if (Item === ActionElement)
{
AutoCorrectEngine.Stop_CollectText();
break;
}
}
};
function CParaRunStartState(Run)
{
this.Paragraph = Run.Paragraph;
......
This diff is collapsed.
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