Commit 88a0ccbf 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@59271 954022d7-b5bf-4e40-9824-e11837661b57
parent 9c59e865
...@@ -2024,7 +2024,9 @@ CMathContent.prototype.Load_FromMenu = function(Type, Paragraph) ...@@ -2024,7 +2024,9 @@ CMathContent.prototype.Load_FromMenu = function(Type, Paragraph)
var MainType = Type >> 24; var MainType = Type >> 24;
if (MainType === c_oAscMathMainType.Fraction) if (MainType === c_oAscMathMainType.Symbol)
this.private_LoadFromMenuSymbol(Type, Pr);
else if (MainType === c_oAscMathMainType.Fraction)
this.private_LoadFromMenuFraction(Type, Pr); this.private_LoadFromMenuFraction(Type, Pr);
else if (MainType === c_oAscMathMainType.Script) else if (MainType === c_oAscMathMainType.Script)
this.private_LoadFromMenuScript(Type, Pr); this.private_LoadFromMenuScript(Type, Pr);
...@@ -2047,6 +2049,127 @@ CMathContent.prototype.Load_FromMenu = function(Type, Paragraph) ...@@ -2047,6 +2049,127 @@ CMathContent.prototype.Load_FromMenu = function(Type, Paragraph)
else if (MainType === c_oAscMathMainType.Matrix) else if (MainType === c_oAscMathMainType.Matrix)
this.private_LoadFromMenuMatrix(Type, Pr); this.private_LoadFromMenuMatrix(Type, Pr);
}; };
CMathContent.prototype.private_LoadFromMenuSymbol = function(Type, Pr)
{
var Code = -1;
switch (Type)
{
case c_oAscMathType.Symbol_pm : Code = 0x00B1; break;
case c_oAscMathType.Symbol_infinity : Code = 0x221E; break;
case c_oAscMathType.Symbol_equals : Code = 0x003D; break;
case c_oAscMathType.Symbol_neq : Code = 0x2260; break;
case c_oAscMathType.Symbol_about : Code = 0x007E; break;
case c_oAscMathType.Symbol_times : Code = 0x00D7; break;
case c_oAscMathType.Symbol_div : Code = 0x00F7; break;
case c_oAscMathType.Symbol_factorial : Code = 0x0021; break;
case c_oAscMathType.Symbol_propto : Code = 0x221D; break;
case c_oAscMathType.Symbol_less : Code = 0x003C; break;
case c_oAscMathType.Symbol_ll : Code = 0x226A; break;
case c_oAscMathType.Symbol_greater : Code = 0x003E; break;
case c_oAscMathType.Symbol_gg : Code = 0x226B; break;
case c_oAscMathType.Symbol_leq : Code = 0x2264; break;
case c_oAscMathType.Symbol_geq : Code = 0x2265; break;
case c_oAscMathType.Symbol_mp : Code = 0x2213; break;
case c_oAscMathType.Symbol_cong : Code = 0x2245; break;
case c_oAscMathType.Symbol_approx : Code = 0x2248; break;
case c_oAscMathType.Symbol_equiv : Code = 0x2261; break;
case c_oAscMathType.Symbol_forall : Code = 0x2200; break;
case c_oAscMathType.Symbol_additional : Code = 0x2201; break;
case c_oAscMathType.Symbol_partial : Code = 0x1D715; break;
case c_oAscMathType.Symbol_sqrt : this.Add_Radical(Pr, null, null); break;
case c_oAscMathType.Symbol_cbrt : this.Add_Radical({ctrPrp : Pr.ctrPrp, type : DEGREE_RADICAL}, null, "3"); break;
case c_oAscMathType.Symbol_qdrt : this.Add_Radical({ctrPrp : Pr.ctrPrp, type : DEGREE_RADICAL}, null, "4"); break;
case c_oAscMathType.Symbol_cup : Code = 0x222A; break;
case c_oAscMathType.Symbol_cap : Code = 0x2229; break;
case c_oAscMathType.Symbol_emptyset : Code = 0x2205; break;
case c_oAscMathType.Symbol_percent : Code = 0x0025; break;
case c_oAscMathType.Symbol_degree : Code = 0x00B0; break;
case c_oAscMathType.Symbol_fahrenheit : Code = 0x2109; break;
case c_oAscMathType.Symbol_celsius : Code = 0x2103; break;
case c_oAscMathType.Symbol_inc : Code = 0x2206; break;
case c_oAscMathType.Symbol_nabla : Code = 0x2207; break;
case c_oAscMathType.Symbol_exists : Code = 0x2203; break;
case c_oAscMathType.Symbol_notexists : Code = 0x2204; break;
case c_oAscMathType.Symbol_in : Code = 0x2208; break;
case c_oAscMathType.Symbol_ni : Code = 0x220B; break;
case c_oAscMathType.Symbol_leftarrow : Code = 0x2190; break;
case c_oAscMathType.Symbol_uparrow : Code = 0x2191; break;
case c_oAscMathType.Symbol_rightarrow : Code = 0x2192; break;
case c_oAscMathType.Symbol_downarrow : Code = 0x2193; break;
case c_oAscMathType.Symbol_leftrightarrow: Code = 0x2194; break;
case c_oAscMathType.Symbol_therefore : Code = 0x2234; break;
case c_oAscMathType.Symbol_plus : Code = 0x002B; break;
case c_oAscMathType.Symbol_minus : Code = 0x2212; break;
case c_oAscMathType.Symbol_not : Code = 0x00AC; break;
case c_oAscMathType.Symbol_ast : Code = 0x2217; break;
case c_oAscMathType.Symbol_bullet : Code = 0x2219; break;
case c_oAscMathType.Symbol_vdots : Code = 0x22EE; break;
case c_oAscMathType.Symbol_cdots : Code = 0x22EF; break;
case c_oAscMathType.Symbol_rddots : Code = 0x22F0; break;
case c_oAscMathType.Symbol_ddots : Code = 0x22F1; break;
case c_oAscMathType.Symbol_aleph : Code = 0x2135; break;
case c_oAscMathType.Symbol_beth : Code = 0x2136; break;
case c_oAscMathType.Symbol_QED : Code = 0x220E; break;
case c_oAscMathType.Symbol_alpha : Code = 0x1D6FC; break;
case c_oAscMathType.Symbol_beta : Code = 0x1D6FD; break;
case c_oAscMathType.Symbol_gamma : Code = 0x1D6FE; break;
case c_oAscMathType.Symbol_delta : Code = 0x1D6FF; break;
case c_oAscMathType.Symbol_varepsilon : Code = 0x1D700; break;
case c_oAscMathType.Symbol_epsilon : Code = 0x1D716; break;
case c_oAscMathType.Symbol_zeta : Code = 0x1D701; break;
case c_oAscMathType.Symbol_eta : Code = 0x1D702; break;
case c_oAscMathType.Symbol_theta : Code = 0x1D703; break;
case c_oAscMathType.Symbol_vartheta : Code = 0x1D717; break;
case c_oAscMathType.Symbol_iota : Code = 0x1D704; break;
case c_oAscMathType.Symbol_kappa : Code = 0x1D705; break;
case c_oAscMathType.Symbol_lambda : Code = 0x1D706; break;
case c_oAscMathType.Symbol_mu : Code = 0x1D707; break;
case c_oAscMathType.Symbol_nu : Code = 0x1D708; break;
case c_oAscMathType.Symbol_xsi : Code = 0x1D709; break;
case c_oAscMathType.Symbol_o : Code = 0x1D70A; break;
case c_oAscMathType.Symbol_pi : Code = 0x1D70B; break;
case c_oAscMathType.Symbol_varpi : Code = 0x1D71B; break;
case c_oAscMathType.Symbol_rho : Code = 0x1D70C; break;
case c_oAscMathType.Symbol_varrho : Code = 0x1D71A; break;
case c_oAscMathType.Symbol_sigma : Code = 0x1D70E; break;
case c_oAscMathType.Symbol_varsigma : Code = 0x1D70D; break;
case c_oAscMathType.Symbol_tau : Code = 0x1D70F; break;
case c_oAscMathType.Symbol_upsilon : Code = 0x1D710; break;
case c_oAscMathType.Symbol_varphi : Code = 0x1D711; break;
case c_oAscMathType.Symbol_phi : Code = 0x1D719; break;
case c_oAscMathType.Symbol_chi : Code = 0x1D712; break;
case c_oAscMathType.Symbol_psi : Code = 0x1D713; break;
case c_oAscMathType.Symbol_omega : Code = 0x1D714; break;
case c_oAscMathType.Symbol_Alpha : Code = 0x0391; break;
case c_oAscMathType.Symbol_Beta : Code = 0x0392; break;
case c_oAscMathType.Symbol_Gamma : Code = 0x0393; break;
case c_oAscMathType.Symbol_Delta : Code = 0x0394; break;
case c_oAscMathType.Symbol_Epsilon : Code = 0x0395; break;
case c_oAscMathType.Symbol_Zeta : Code = 0x0396; break;
case c_oAscMathType.Symbol_Eta : Code = 0x0397; break;
case c_oAscMathType.Symbol_Theta : Code = 0x0398; break;
case c_oAscMathType.Symbol_Iota : Code = 0x0399; break;
case c_oAscMathType.Symbol_Kappa : Code = 0x039A; break;
case c_oAscMathType.Symbol_Lambda : Code = 0x039B; break;
case c_oAscMathType.Symbol_Mu : Code = 0x039C; break;
case c_oAscMathType.Symbol_Nu : Code = 0x039D; break;
case c_oAscMathType.Symbol_Xsi : Code = 0x039E; break;
case c_oAscMathType.Symbol_O : Code = 0x039F; break;
case c_oAscMathType.Symbol_Pi : Code = 0x03A0; break;
case c_oAscMathType.Symbol_Rho : Code = 0x03A1; break;
case c_oAscMathType.Symbol_Sigma : Code = 0x03A3; break;
case c_oAscMathType.Symbol_Tau : Code = 0x03A4; break;
case c_oAscMathType.Symbol_Upsilon : Code = 0x03A5; break;
case c_oAscMathType.Symbol_Phi : Code = 0x03A6; break;
case c_oAscMathType.Symbol_Chi : Code = 0x03A7; break;
case c_oAscMathType.Symbol_Psi : Code = 0x03A8; break;
case c_oAscMathType.Symbol_Omega : Code = 0x03A9; break;
}
if (-1 !== nCode)
this.Add_Symbol(Code);
};
CMathContent.prototype.private_LoadFromMenuFraction = function(Type, Pr) CMathContent.prototype.private_LoadFromMenuFraction = function(Type, Pr)
{ {
switch (Type) switch (Type)
...@@ -2580,6 +2703,19 @@ CMathContent.prototype.Add_Text = function(sText, MathStyle) ...@@ -2580,6 +2703,19 @@ CMathContent.prototype.Add_Text = function(sText, MathStyle)
this.Internal_Content_Add(this.content.length, MathRun, true); this.Internal_Content_Add(this.content.length, MathRun, true);
} }
}; };
CMathContent.prototype.Add_Symbol = function(Code)
{
var MathRun = new ParaRun(this.Paragraph, true);
for (var nCharPos = 0, nTextLen = sText.length; nCharPos < nTextLen; nCharPos++)
{
var Symbol = new CMathText(false);
Symbol.add(Code);
MathRun.Add(Symbol, true);
}
this.Internal_Content_Add(this.content.length, MathRun, true);
};
CMathContent.prototype.Add_Fraction = function(Pr, NumText, DenText) CMathContent.prototype.Add_Fraction = function(Pr, NumText, DenText)
{ {
var Fraction = new CFraction(Pr); var Fraction = new CFraction(Pr);
......
...@@ -372,6 +372,118 @@ c_oAscMathMainTypeStrings[c_oAscMathMainType.Matrix ] = "Matrix"; ...@@ -372,6 +372,118 @@ c_oAscMathMainTypeStrings[c_oAscMathMainType.Matrix ] = "Matrix";
var c_oAscMathType = var c_oAscMathType =
{ {
//----------------------------------------------------------------------------------------------------------------------
Symbol_pm : 0x00000000,
Symbol_infinity : 0x00000001,
Symbol_equals : 0x00000002,
Symbol_neq : 0x00000003,
Symbol_about : 0x00000004,
Symbol_times : 0x00000005,
Symbol_div : 0x00000006,
Symbol_factorial : 0x00000007,
Symbol_propto : 0x00000008,
Symbol_less : 0x00000009,
Symbol_ll : 0x0000000a,
Symbol_greater : 0x0000000b,
Symbol_gg : 0x0000000c,
Symbol_leq : 0x0000000d,
Symbol_geq : 0x0000000e,
Symbol_mp : 0x0000000f,
Symbol_cong : 0x00000010,
Symbol_approx : 0x00000011,
Symbol_equiv : 0x00000012,
Symbol_forall : 0x00000013,
Symbol_additional : 0x00000014,
Symbol_partial : 0x00000015,
Symbol_sqrt : 0x00000016,
Symbol_cbrt : 0x00000017,
Symbol_qdrt : 0x00000018,
Symbol_cup : 0x00000019,
Symbol_cap : 0x0000001a,
Symbol_emptyset : 0x0000001b,
Symbol_percent : 0x0000001c,
Symbol_degree : 0x0000001d,
Symbol_fahrenheit : 0x0000001e,
Symbol_celsius : 0x0000001f,
Symbol_inc : 0x00000020,
Symbol_nabla : 0x00000021,
Symbol_exists : 0x00000022,
Symbol_notexists : 0x00000023,
Symbol_in : 0x00000024,
Symbol_ni : 0x00000025,
Symbol_leftarrow : 0x00000026,
Symbol_uparrow : 0x00000027,
Symbol_rightarrow : 0x00000028,
Symbol_downarrow : 0x00000029,
Symbol_leftrightarrow : 0x0000002a,
Symbol_therefore : 0x0000002b,
Symbol_plus : 0x0000002c,
Symbol_minus : 0x0000002d,
Symbol_not : 0x0000002e,
Symbol_ast : 0x0000002f,
Symbol_bullet : 0x00000030,
Symbol_vdots : 0x00000031,
Symbol_cdots : 0x00000032,
Symbol_rddots : 0x00000033,
Symbol_ddots : 0x00000034,
Symbol_aleph : 0x00000035,
Symbol_beth : 0x00000036,
Symbol_QED : 0x00000037,
Symbol_alpha : 0x00010000,
Symbol_beta : 0x00010001,
Symbol_gamma : 0x00010002,
Symbol_delta : 0x00010003,
Symbol_varepsilon : 0x00010004,
Symbol_epsilon : 0x00010005,
Symbol_zeta : 0x00010006,
Symbol_eta : 0x00010007,
Symbol_theta : 0x00010008,
Symbol_vartheta : 0x00010009,
Symbol_iota : 0x0001000a,
Symbol_kappa : 0x0001000b,
Symbol_lambda : 0x0001000c,
Symbol_mu : 0x0001000d,
Symbol_nu : 0x0001000e,
Symbol_xsi : 0x0001000f,
Symbol_o : 0x00010010,
Symbol_pi : 0x00010011,
Symbol_varpi : 0x00010012,
Symbol_rho : 0x00010013,
Symbol_varrho : 0x00010014,
Symbol_sigma : 0x00010015,
Symbol_varsigma : 0x00010016,
Symbol_tau : 0x00010017,
Symbol_upsilon : 0x00010018,
Symbol_varphi : 0x00010019,
Symbol_phi : 0x0001001a,
Symbol_chi : 0x0001001b,
Symbol_psi : 0x0001001c,
Symbol_omega : 0x0001001d,
Symbol_Alpha : 0x00020000,
Symbol_Beta : 0x00020001,
Symbol_Gamma : 0x00020002,
Symbol_Delta : 0x00020003,
Symbol_Epsilon : 0x00020004,
Symbol_Zeta : 0x00020005,
Symbol_Eta : 0x00020006,
Symbol_Theta : 0x00020007,
Symbol_Iota : 0x00020008,
Symbol_Kappa : 0x00020009,
Symbol_Lambda : 0x0002000a,
Symbol_Mu : 0x0002000b,
Symbol_Nu : 0x0002000c,
Symbol_Xsi : 0x0002000d,
Symbol_O : 0x0002000e,
Symbol_Pi : 0x0002000f,
Symbol_Rho : 0x00020010,
Symbol_Sigma : 0x00020011,
Symbol_Tau : 0x00020012,
Symbol_Upsilon : 0x00020013,
Symbol_Phi : 0x00020014,
Symbol_Chi : 0x00020015,
Symbol_Psi : 0x00020016,
Symbol_Omega : 0x00020017,
//----------------------------------------------------------------------------------------------------------------------
FractionVertical : 0x01000000, FractionVertical : 0x01000000,
FractionDiagonal : 0x01000001, FractionDiagonal : 0x01000001,
FractionHorizontal : 0x01000002, FractionHorizontal : 0x01000002,
......
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