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) ...@@ -169,27 +169,26 @@ ParaMath.prototype.Add = function(Item)
if (para_Math_Run !== Run.Type) if (para_Math_Run !== Run.Type)
return; return;
var NewElement = null;
if (para_Text === Type) if (para_Text === Type)
{ {
if(Item.Value == 38) if(Item.Value == 38)
{ {
var Amper = new CMathAmp(); NewElement = new CMathAmp();
Run.Add(Amper, true); Run.Add(NewElement, true);
} }
else else
{ {
var oText = new CMathText(false); NewElement = new CMathText(false);
oText.add(Item.Value); NewElement.add(Item.Value);
Run.Add(oText, true); Run.Add(NewElement, true);
} }
} }
else if (para_Space === Type) else if (para_Space === Type)
{ {
var oText = new CMathText(false); NewElement = new CMathText(false);
oText.addTxt(" "); NewElement.addTxt(" ");
Run.Add(oText, true); Run.Add(NewElement, true);
} }
else if (para_Math === Type) else if (para_Math === Type)
{ {
...@@ -218,6 +217,12 @@ ParaMath.prototype.Add = function(Item) ...@@ -218,6 +217,12 @@ ParaMath.prototype.Add = function(Item)
RightRun.Cursor_MoveToStartPos(); RightRun.Cursor_MoveToStartPos();
} }
if ((para_Text === Type || para_Space === Type) && null !== NewElement)
{
// Пробуем произвести автозамену
oContent.Process_AutoCorrect(NewElement);
}
// Корректируем данный контент // Корректируем данный контент
oContent.Correct_Content(true); oContent.Correct_Content(true);
}; };
......
...@@ -8084,6 +8084,26 @@ ParaRun.prototype.GetMathTextPr = function() ...@@ -8084,6 +8084,26 @@ ParaRun.prototype.GetMathTextPr = function()
return {TextPr: TextPr, MathPr: this.MathPrp.Copy()}; 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) function CParaRunStartState(Run)
{ {
this.Paragraph = Run.Paragraph; 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