Commit fb3e97df authored by Sergey.Tsarkov's avatar Sergey.Tsarkov Committed by Alexander.Trofimov

поправлено меню для формул

заглушки из чтения формул перекинуты в контролы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52801 954022d7-b5bf-4e40-9824-e11837661b57
parent df2939c5
...@@ -7124,13 +7124,6 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7124,13 +7124,6 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathDelimiterPr(t,l,props,oDelimiter); return oThis.ReadMathDelimiterPr(t,l,props,oDelimiter);
}); });
//заглушка для скобок и сепаратора
if ( !props.begChr )
props.begChrType = 0;
if ( !props.endChr )
props.endChrType = 1;
if ( !props.sepChr && props.column >1 )
props.sepChrType = 12;
} }
else if (c_oSer_OMathContentType.Element === type) else if (c_oSer_OMathContentType.Element === type)
{ {
...@@ -7393,9 +7386,7 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7393,9 +7386,7 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
{ {
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathFPr(t,l,props, oFraction); return oThis.ReadMathFPr(t,l,props, oFraction);
}); });
if (!props.type)
props.type = BAR_FRACTION;
} }
else if (c_oSer_OMathContentType.Den === type) else if (c_oSer_OMathContentType.Den === type)
{ {
......
...@@ -7,6 +7,8 @@ function CFraction() ...@@ -7,6 +7,8 @@ function CFraction()
extend(CFraction, CMathBase); extend(CFraction, CMathBase);
CFraction.prototype.init = function(props) CFraction.prototype.init = function(props)
{ {
if (props.type == undefined)
props.type = BAR_FRACTION;
var bValid = typeof(props.type) !== "undefined" && props.type !== null; var bValid = typeof(props.type) !== "undefined" && props.type !== null;
if(bValid) if(bValid)
......
...@@ -153,12 +153,12 @@ CNary.prototype.init = function(props) ...@@ -153,12 +153,12 @@ CNary.prototype.init = function(props)
} }
else if( this.supHide && !this.subHide ) else if( this.supHide && !this.subHide )
{ {
base = new CNaryUnd(); base = new CNaryOvr();
base.init(sign); base.init(sign);
} }
else if( !this.supHide && this.subHide ) else if( !this.supHide && this.subHide )
{ {
base = new CNaryOvr(); base = new CNaryUnd();
base.init(sign); base.init(sign);
} }
else else
...@@ -172,13 +172,13 @@ CNary.prototype.init = function(props) ...@@ -172,13 +172,13 @@ CNary.prototype.init = function(props)
if( this.supHide && !this.subHide ) if( this.supHide && !this.subHide )
{ {
base = new CDegree(); base = new CDegree();
var prp = {type: DEGREE_SUPERSCRIPT}; var prp = {type: DEGREE_SUBSCRIPT};
base.init_2(prp, sign); base.init_2(prp, sign);
} }
else if( !this.supHide && this.subHide ) else if( !this.supHide && this.subHide )
{ {
base = new CDegree(); base = new CDegree();
var prp = {type: DEGREE_SUBSCRIPT}; var prp = {type: DEGREE_SUPERSCRIPT};
base.init_2(prp, sign); base.init_2(prp, sign);
} }
else else
......
...@@ -2722,14 +2722,14 @@ CDelimiter.prototype.init = function(props) ...@@ -2722,14 +2722,14 @@ CDelimiter.prototype.init = function(props)
else if(props.grow == false || props.grow == 0) else if(props.grow == false || props.grow == 0)
this.grow = false; this.grow = false;
/*if(typeof(props.begChr) === "string" && props.begChr.length == 0) if(props.begChr == undefined)
props.begChrType = PARENTHESIS_LEFT; props.begChrType = PARENTHESIS_LEFT;
if(typeof(props.endChr) === "string" && props.endChr.length == 0) if(props.endChr == undefined)
props.endChrType = PARENTHESIS_RIGHT; props.endChrType = PARENTHESIS_RIGHT;
if(typeof(props.endChr) === "string" && props.endChr.length == 0) if(props.endChr == undefined && props.column >1)
props.sepChrType = DELIMITER_LINE;*/ props.sepChrType = DELIMITER_LINE;
var begPrp = var begPrp =
{ {
......
...@@ -3065,7 +3065,7 @@ ...@@ -3065,7 +3065,7 @@
<div style="float: left; background-image: url(Math/img/radical_equat.png); width: 160px; height: 104px; background-position: 320px 104px;" value="22"></div> <div style="float: left; background-image: url(Math/img/radical_equat.png); width: 160px; height: 104px; background-position: 320px 104px;" value="22"></div>
<div style="float: left; background-image: url(Math/img/radical_equat.png); width: 160px; height: 104px; background-position: 160px 104px;" value="23"></div> <div style="float: left; background-image: url(Math/img/radical_equat.png); width: 160px; height: 104px; background-position: 160px 104px;" value="23"></div>
</div> </div>
<div class="integral mathContainer" style="display:none;width:480px;background-color:#fff;top: 80px; right: -4px;z-index:100;position:absolute;padding-top: 5px;border: 4px ridge silver;overflow-y:scroll;"> <div class="integral mathContainer" style="display:none;width:480px;height:480px;background-color:#fff;top: 80px; right: -4px;z-index:100;position:absolute;padding-top: 5px;border: 4px ridge silver;overflow-y:scroll;">
<div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 240px 728px;" value="24"></div> <div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 240px 728px;" value="24"></div>
<div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 160px 728px;" value="25"></div> <div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 160px 728px;" value="25"></div>
<div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 80px 728px;" value="26"></div> <div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 80px 728px;" value="26"></div>
...@@ -3088,6 +3088,49 @@ ...@@ -3088,6 +3088,49 @@
<div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 160px 104px;" value="43"></div> <div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 160px 104px;" value="43"></div>
<div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 80px 104px;" value="44"></div> <div style="float: left; background-image: url(Math/img/integral.png); width: 80px; height: 104px; background-position: 80px 104px;" value="44"></div>
</div> </div>
<div class="nary mathContainer" style="display:none;width:480px;height:480px;background-color:#fff;top: 80px; right: -4px;z-index:100;position:absolute;padding-top: 5px;border: 4px ridge silver;overflow-y:scroll;">
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 400px 728px;" value="45"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 320px 728px;" value="46"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 240px 728px;" value="47"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 160px 728px;" value="48"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 80px 728px;" value="49"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 400px 624px;" value="50"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 320px 624px;" value="51"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 240px 624px;" value="52"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 160px 624px;" value="53"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 80px 624px;" value="54"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 400px 520px;" value="55"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 320px 520px;" value="56"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 240px 520px;" value="57"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 160px 520px;" value="58"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 80px 520px;" value="59"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 400px 416px;" value="60"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 320px 416px;" value="61"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 240px 416px;" value="62"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 160px 416px;" value="63"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 80px 416px;" value="64"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 400px 312px;" value="65"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 320px 312px;" value="66"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 240px 312px;" value="67"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 160px 312px;" value="68"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 80px 312px;" value="69"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 400px 208px;" value="70"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 320px 208px;" value="71"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 240px 208px;" value="72"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 160px 208px;" value="73"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 80px 208px;" value="74"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 400px 104px;" value="75"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 320px 104px;" value="76"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 240px 104px;" value="77"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 160px 104px;" value="78"></div>
<div style="float: left; background-image: url(Math/img/nary.png); width: 80px; height: 104px; background-position: 80px 104px;" value="79"></div>
<div style="float: left; background-image: url(Math/img/nary_1.png); width: 80px; height: 104px; background-position: 320px 104px;" value="80"></div>
<div style="float: left; background-image: url(Math/img/nary_1.png); width: 80px; height: 104px; background-position: 240px 104px;" value="81"></div>
<div style="float: left; background-image: url(Math/img/nary_2.png); width: 160px; height: 104px; background-position: 320px 104px;" value="82"></div>
<div style="float: left; background-image: url(Math/img/nary_1.png); width: 80px; height: 104px; background-position: 160px 104px;" value="83"></div>
<div style="float: left; background-image: url(Math/img/nary_2.png); width: 160px; height: 104px; background-position: 160px 104px;" value="84"></div>
</div>
</div> </div>
......
...@@ -7584,12 +7584,294 @@ asc_docs_api.prototype.asc_AddMath = function(Type) ...@@ -7584,12 +7584,294 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
var oNary = new CNary(); var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null); CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break; break;
case 42: props = {diff:1};
var sVal = "dx";
var oBox = new CBox();
CreateBox(oBox,MathElement.Math.Root,props,sVal);
break;
case 43: props = {diff:1};
var sVal = "dy";
var oBox = new CBox();
CreateBox(oBox,MathElement.Math.Root,props,sVal);
break;
case 44: props = {diff:1};
var sVal = "d" + String.fromCharCode(952);
var oBox = new CBox();
CreateBox(oBox,MathElement.Math.Root,props,sVal);
break;
case 45: var sChar = String.fromCharCode(8721);
props = {chr:sChar, limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 46: var sChar = String.fromCharCode(8721);
props = {chr:sChar, limLoc:NARY_UndOvr};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 47: var sChar = String.fromCharCode(8721);
props = {chr:sChar, limLoc:NARY_SubSup};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 48: var sChar = String.fromCharCode(8721);
props = {chr:sChar, limLoc:NARY_UndOvr, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 49: var sChar = String.fromCharCode(8721);
props = {chr:sChar, limLoc:NARY_SubSup, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 50: var sChar = String.fromCharCode(8719);
props = {chr:sChar, limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 51: var sChar = String.fromCharCode(8719);
props = {chr:sChar, limLoc:NARY_UndOvr};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 52: var sChar = String.fromCharCode(8719);
props = {chr:sChar, limLoc:NARY_SubSup};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 53: var sChar = String.fromCharCode(8719);
props = {chr:sChar, limLoc:NARY_UndOvr, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 54: var sChar = String.fromCharCode(8719);
props = {chr:sChar, limLoc:NARY_SubSup, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 55: var sChar = String.fromCharCode(8720);
props = {chr:sChar, limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 56: var sChar = String.fromCharCode(8720);
props = {chr:sChar, limLoc:NARY_UndOvr};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 57: var sChar = String.fromCharCode(8720);
props = {chr:sChar, limLoc:NARY_SubSup};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 58: var sChar = String.fromCharCode(8720);
props = {chr:sChar, limLoc:NARY_UndOvr, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 59: var sChar = String.fromCharCode(8720);
props = {chr:sChar, limLoc:NARY_SubSup, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 60: var sChar = String.fromCharCode(8899);
props = {chr:sChar, limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 61: var sChar = String.fromCharCode(8899);
props = {chr:sChar, limLoc:NARY_UndOvr};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 62: var sChar = String.fromCharCode(8899);
props = {chr:sChar, limLoc:NARY_SubSup};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 63: var sChar = String.fromCharCode(8899);
props = {chr:sChar, limLoc:NARY_UndOvr, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 64: var sChar = String.fromCharCode(8899);
props = {chr:sChar, limLoc:NARY_SubSup, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 65: var sChar = String.fromCharCode(8898);
props = {chr:sChar, limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 66: var sChar = String.fromCharCode(8898);
props = {chr:sChar, limLoc:NARY_UndOvr};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 67: var sChar = String.fromCharCode(8898);
props = {chr:sChar, limLoc:NARY_SubSup};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 68: var sChar = String.fromCharCode(8898);
props = {chr:sChar, limLoc:NARY_UndOvr, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 69: var sChar = String.fromCharCode(8898);
props = {chr:sChar, limLoc:NARY_SubSup, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 70: var sChar = String.fromCharCode(8897);
props = {chr:sChar, limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 71: var sChar = String.fromCharCode(8897);
props = {chr:sChar, limLoc:NARY_UndOvr};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 72: var sChar = String.fromCharCode(8897);
props = {chr:sChar, limLoc:NARY_SubSup};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 73: var sChar = String.fromCharCode(8897);
props = {chr:sChar, limLoc:NARY_UndOvr, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 74: var sChar = String.fromCharCode(8897);
props = {chr:sChar, limLoc:NARY_SubSup, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 75: var sChar = String.fromCharCode(8896);
props = {chr:sChar, limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 76: var sChar = String.fromCharCode(8896);
props = {chr:sChar, limLoc:NARY_UndOvr};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 77: var sChar = String.fromCharCode(8896);
props = {chr:sChar, limLoc:NARY_SubSup};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 78: var sChar = String.fromCharCode(8896);
props = {chr:sChar, limLoc:NARY_UndOvr, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 79: var sChar = String.fromCharCode(8896);
props = {chr:sChar, limLoc:NARY_SubSup, supHide:true};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
break;
case 80: var sChar = String.fromCharCode(8721);
props = {/*limLoc:NARY_UndOvr,*/ chr:sChar, supHide:true};
var oNary = new CNary();
CreateElem(oNary,MathElement.Math.Root,props);
var narySub = oNary.getLowerIterator();
AddText(narySub, "k");
var naryBase = oNary.getBase();
props = {column:1};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,naryBase,props);
var delimiterBase = oDelimiter.getBase(0);
props = {type:NO_BAR_FRACTION};
var oFraction = new CFraction();
CreateFraction(oFraction, delimiterBase, props, "n", "k");
break
case 81: var sChar = String.fromCharCode(8721);
props = {chr:sChar/*, limLoc:NARY_UndOvr*/};
var oNary = new CNary();
CreateNary(oNary,MathElement.Math.Root,props,null,"i=0","n");
break;
case 82: var sChar = String.fromCharCode(8721);
props = {chr:sChar, /*limLoc:NARY_UndOvr,*/ supHide:true};
var oNary = new CNary();
CreateElem(oNary,MathElement.Math.Root,props);
var narySub = oNary.getLowerIterator();
props = {row:2};
var oEqArr = new CEqArray();
CreateElem(oEqArr, narySub, props);
var eqarrElem0 = oEqArr.getElement(0);
AddText(eqarrElem0, "0≤ i ≤ m");
var eqarrElem1 = oEqArr.getElement(1);
AddText(eqarrElem1, "0< j < n");
var naryBase = oNary.getBase();
AddText(naryBase, "P");
props = {column:1};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,naryBase,props);
var delimiterBase = oDelimiter.getBase(0);
AddText(delimiterBase, "i,j");
break;
case 83: var sChar = String.fromCharCode(8719);
props = {/*limLoc:NARY_UndOvr,*/ chr:sChar};
var oNary = new CNary();
CreateElem(oNary, MathElement.Math.Root, props);
var narySup = oNary.getUpperIterator();
AddText(narySup, "n");
var narySub = oNary.getLowerIterator();
AddText(narySub, "k=1");
var naryBase = oNary.getBase();
props = {type:DEGREE_SUBSCRIPT};
var oSSub = new CDegree();
CreateDegree(oSSub, naryBase, props, "A", null, "k");
break;
case 84: var sChar = String.fromCharCode(8899);
props = {chr:sChar/*, limLoc:NARY_UndOvr*/};
var oNary = new CNary();
CreateElem(oNary,MathElement.Math.Root,props);
var narySub = oNary.getLowerIterator();
AddText(narySub, "n=1");
var narySup = oNary.getUpperIterator();
AddText(narySup, "m");
var naryBase = oNary.getBase();
props = {column:1};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,naryBase,props);
var delimiterBase = oDelimiter.getBase(0);
props = {type:DEGREE_SUBSCRIPT};
var oSSub0 = new CDegree();
CreateDegree(oSSub0, delimiterBase, props, "X", null, "n");
sChar = String.fromCharCode(8898);
AddText(delimiterBase, sChar);
props = {type:DEGREE_SUBSCRIPT};
var oSSub1 = new CDegree();
CreateDegree(oSSub1, delimiterBase, props, "Y", null, "n");
break;
} }
this.WordControl.m_oLogicDocument.Paragraph_Add( MathElement ); this.WordControl.m_oLogicDocument.Paragraph_Add( MathElement );
} }
} }
function CreateBox(oBox,oParentElem,props,sElemText)
{
CreateElem(oBox, oParentElem, props);
var oElem = oBox.getBase();
AddText(oElem, sElemText);
}
function CreateNary(oNary,oParentElem,props,sElemText,sSubText,sSupText) function CreateNary(oNary,oParentElem,props,sElemText,sSubText,sSupText)
{ {
CreateElem(oNary, oParentElem, props); CreateElem(oNary, oParentElem, props);
...@@ -7642,7 +7924,8 @@ function CreateElem(oElem, oParent, props) ...@@ -7642,7 +7924,8 @@ function CreateElem(oElem, oParent, props)
var ctrPrp = new CTextPr(); var ctrPrp = new CTextPr();
oElem.setCtrPrp(ctrPrp); oElem.setCtrPrp(ctrPrp);
oElem.init(props); oElem.init(props);
oParent.addElementToContent(oElem); if (oParent)
oParent.addElementToContent(oElem);
} }
function AddText(oElem, sText) function AddText(oElem, sText)
{ {
...@@ -7651,13 +7934,16 @@ function AddText(oElem, sText) ...@@ -7651,13 +7934,16 @@ function AddText(oElem, sText)
var ctrPrp = new CTextPr(); var ctrPrp = new CTextPr();
oMRun = new CMathRunPrp(); oMRun = new CMathRunPrp();
oMRun.setTxtPrp(ctrPrp); oMRun.setTxtPrp(ctrPrp);
oElem.addElementToContent(oMRun); if (oElem)
for (var i=0;i<sText.length;i++)
{ {
oText = new CMathText(); oElem.addElementToContent(oMRun);
oText.addTxt(sText[i]); for (var i=0;i<sText.length;i++)
oElem.addElementToContent(oText); {
} oText = new CMathText();
oText.addTxt(sText[i]);
oElem.addElementToContent(oText);
}
}
} }
} }
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