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

1. Таблица операторов (не полная)

2. Таблица символов, которые всегда отрисовываются в Cambria Math (независимо от того, что выставлено св-во мат текст)
3. Обновила тестовые функции (к п.1)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63922 954022d7-b5bf-4e40-9824-e11837661b57
parent b3f8e0fe
......@@ -5911,7 +5911,7 @@ ParaRun.prototype.Apply_Pr = function(TextPr)
{
this.private_AddCollPrChangeMine();
if(this.Type == para_Math_Run && !this.IsNormalText())
if(this.Type == para_Math_Run && false === this.IsNormalText())
{
if(null === TextPr.Bold && null === TextPr.Italic)
this.Math_Apply_Style(undefined);
......@@ -9227,13 +9227,6 @@ ParaRun.prototype.IsNormalText = function()
var comp_MPrp = this.MathPrp.GetCompiled_ScrStyles();
return comp_MPrp.nor === true;
};
ParaRun.prototype.IsMathematicalText = function()
{
var MathText = !this.IsNormalText();
var bMFont = this.Get_CompiledPr(false).FontFamily.Name == "Cambria Math";
return MathText && bMFont;
};
ParaRun.prototype.getPropsForWrite = function()
{
var wRPrp = this.Pr.Copy(),
......
......@@ -20,6 +20,253 @@
//change FontSize
//editor.put_TextPrFontSize(parseInt("37"));
var TEST_MATH_FIRST_SYMBOL = 0x21;
var TEST_MATH_SYMBOL = 0x21;
var TEST_MATH_COUNT = 35;
var TEST_LAST_SYMBOL = 0x1D7FF;
// добавить в конструктор ParaMath
// this.TEST_SYMBOLS = true;
function _To_Run_To_Recalculate_Range(oRun)
{
if(oRun.Type == para_Math_Run && TEST_MATH_SYMBOL <= TEST_LAST_SYMBOL)
{
if(oRun.ParaMath.TEST_SYMBOLS == true)
{
for(var Pos = 0; Pos < TEST_MATH_COUNT && TEST_MATH_SYMBOL <= TEST_LAST_SYMBOL; Pos++)
{
TEST_MATH_SYMBOL = oTEST_MATH_RANGE.Check_Skip(TEST_MATH_SYMBOL);
oTEST_MATH_RANGE.Check_Space(TEST_MATH_SYMBOL, oRun.Content, true, this, oRun.ParaMath);
var oText = new CMathText(false);
oText.add(TEST_MATH_SYMBOL);
oText.PreRecalc(this, oRun.ParaMath);
oRun.Content.push(oText);
TEST_MATH_SYMBOL++;
}
oRun.ParaMath.TEST_SYMBOLS = false;
}
}
if(oRun.Content.length == 1 && oRun.Content[0].Type == para_Text && true === oRun.RecalcInfo.Measure)
{
if(oRun.Content[0].Value == 97)
{
TEST_MATH_SYMBOL = TEST_MATH_FIRST_SYMBOL;
oTEST_MATH_RANGE = new TEST_MATH_RANGES();
oRun.Content.length = 0;
for(var Pos = 0; TEST_MATH_SYMBOL<=0x35A8; Pos++)
{
TEST_MATH_SYMBOL = oTEST_MATH_RANGE.Check_Skip(TEST_MATH_SYMBOL);
oTEST_MATH_RANGE.Check_Space(TEST_MATH_SYMBOL, oRun.Content, false, this, oRun.ParaMath);
var oText = new ParaText();
oText.Set_CharCode(TEST_MATH_SYMBOL);
oRun.Content.push(oText);
TEST_MATH_SYMBOL++;
}
TEST_MATH_SYMBOL = TEST_MATH_FIRST_SYMBOL;
}
}
}
var oTEST_MATH_RANGE = new TEST_MATH_RANGES();
function TEST_MATH_RANGES()
{
this.Skips =
[
[0x7E, 0xA1],
[0x36F, 0x37A],
[0x37E, 0x384],
[0x38A, 0x38C],
[0x38C, 0x38E],
[0x3A1, 0x3A3],
[0x513, 0x524],
[0x525, 0x0E3F],
[0x0E3F, 0x1D00],
[0x1DCA, 0x1DFE],
[0x1E9B, 0x1EA0],
[0x1EF9, 0x1F00],
[0x1F15, 0x1F18],
[0x1F1D, 0x1F20],
[0x1F45, 0x1F48],
[0x1F4D, 0x1F50],
[0x1F57, 0x1F59],
[0x1F59, 0x1F5B],
[0x1F5B, 0x1F5D],
[0x1F5D, 0x1F5F],
[0x1F7D, 0x1F80],
[0x1FB4, 0x1FB6],
[0x1FC4, 0x1FC6],
[0x1FD3, 0x1FD6],
[0x1FDB, 0x1FDD],
[0x1FEF, 0x1FF2],
[0x1FFE, 0x2010],
[0x2010, 0x2012],
[0x2022, 0x2026],
[0x2026, 0x2030],
[0x2030, 0x2032],
[0x2034, 0x2039],
[0x203A, 0x203C],
[0x203C, 0x203E],
[0x203E, 0x2044],
[0x2046, 0x2057],
[0x2057, 0x205E],
[0x205E, 0x2070],
[0x2071, 0x2074],
[0x208E, 0x2090],
[0x2094, 0x20A0],
[0x20B5, 0x20B8],
[0x20B8, 0x20D0],
[0x20DF, 0x20E1],
[0x20E1, 0x20E5],
[0x20E6, 0x20E8],
[0x20EA, 0x2102],
[0x2105, 0x2107],
[0x211D, 0x2122],
[0x2122, 0x2124],
[0x213A, 0x213D],
[0x214B, 0x214D],
[0x214E, 0x2153],
[0x215E, 0x2183],
[0x2184, 0x2190],
[0x23CF, 0x23DC],
[0x23E0, 0x2460],
[0x2473, 0x24EA],
[0x24F4, 0x24FF],
[0x2500, 0x2502],
[0x2502, 0x250C],
[0x250C, 0x2510],
[0x2510, 0x2514],
[0x2514, 0x2518],
[0x2518, 0x251C],
[0x251C, 0x2524],
[0x2524, 0x252C],
[0x252C, 0x2534],
[0x2534, 0x2581],
[0x2581, 0x2588],
[0x2588, 0x2592],
[0x2592, 0x25A0],
[0x25A1, 0x25AD],
[0x25AD, 0x25B3],
[0x25B3, 0x25CA],
[0x25CB, 0x2660],
[0x2661, 0x2666],
[0x2666, 0x2776],
[0x277F, 0x27D0],
[0x27EB, 0x27F0],
[0x27FF, 0x2900],
[0x2AFF, 0x2B04],
[0x2B04, 0x2B06],
[0x2B07, 0x2B0C],
[0x2B0D, 0x2C60],
[0x2C6C, 0x2C74],
[0x2C77, 0x2E17],
[0x2E17, 0x3000],
[0x3020, 0x3030],
[0x3037, 0x303B],
[0x303D, 0x3041],
[0x3096, 0x3099],
[0x30FF, 0x3131],
[0x318E, 0x31F0],
[0x321E, 0x3220],
[0x3243, 0x3251],
[0x32CB, 0x32D0],
[0x32FE, 0x3300],
[0x3376, 0x337B],
[0x33DD, 0x33E0],
[0x33FE, 0x3402],
[0x3402, 0x3406],
[0x3406, 0x342C],
[0x342C, 0x342E],
[0x342E, 0x3468],
[0x3468, 0x346A],
[0x346A, 0x3492],
[0x3492, 0x34B5],
[0x34B5, 0x34BC],
[0x34BC, 0x34C1],
[0x34C1, 0x34C7],
[0x34C7, 0x34DB],
[0x34DB, 0x351F],
[0x351F, 0x355D],
[0x355E, 0x3563],
[0x3563, 0x356E],
[0x356E, 0x35A6],
[0x35A6, 0x35A8]
];
this.Spaces =
[
[0x2FE, 0x370],
[0x481, 0x48A],
[0x1DBF, 0x1E00],
[0x20D2, 0x20E0],
[0x20E4, 0x20E7]
];
this.CountSpaces =
{
0x20DD: 7, 0x20DE: 7, 0x20DF: 9, 0x35D: 7, 0x0488: 8, 0x0489: 8, 0x35E: 6
}
}
TEST_MATH_RANGES.prototype.Check_Skip = function(code)
{
var resCode = code;
while(this.Skips.length > 0 && code >= this.Skips[0][1])
{
this.Skips.splice(0, 1);
}
if(this.Skips.length > 0 && code > this.Skips[0][0] && code < this.Skips[0][1])
{
resCode = this.Skips[0][1];
}
return resCode;
};
TEST_MATH_RANGES.prototype.Check_Space = function(code, Content, bMath, Run, ParaMath)
{
while(this.Spaces.length > 0 && code >= this.Spaces[0][1])
{
this.Spaces.splice(0, 1);
}
if(this.Spaces.length > 0 && code > this.Spaces[0][0] && code < this.Spaces[0][1])
{
var Count = this.CountSpaces[code] !== undefined ? this.CountSpaces[code] : 4;
for(var i = 0; i < Count; i++)
{
var oSpace;
if(bMath)
{
oSpace = new CMathText(false);
oSpace.add(0x20);
oSpace.PreRecalc(Run, ParaMath);
}
else
{
oSpace = new ParaSpace();
}
Content.push(oSpace);
}
}
};
function TEST_MATH_JUCTIFICATION(mcJc)
{
......
......@@ -419,10 +419,6 @@ CMathBoxPr.prototype.Set_FromObject = function(Obj)
else
this.opEmu = false;
};
/*CMathBoxPr.prototype.IsBreak = function()
{
return this.brk ! == undefined;
};*/
CMathBoxPr.prototype.Copy = function()
{
var NewPr = new CMathBoxPr();
......
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