Commit 94247fac 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@53433 954022d7-b5bf-4e40-9824-e11837661b57
parent eb745277
......@@ -2328,7 +2328,7 @@ function Binary_oMathWriter(memory, oMathPara)
if (null != oSSub.CtrPrp)
this.bs.WriteItem(c_oSer_OMathBottomNodesType.CtrlPr, function(){oThis.WriteCtrlPr(oSSub);});
}
this.WriteSubSup = function(oSSubSup)
this.WriteSSubSup = function(oSSubSup)
{
var oThis = this;
var oSub = oSSubSup.getLowerIterator();
......@@ -7494,7 +7494,7 @@ function Binary_oMathReader(stream)
oMathAcc.init(props);
oElem.addElementToContent(oMathAcc);
var oElem = oMathAcc.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -7774,7 +7774,7 @@ function Binary_oMathReader(stream)
oBar.init(props);
oElem.addElementToContent(oBar);
var oElem = oBar.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -7841,7 +7841,7 @@ function Binary_oMathReader(stream)
oBorderBox.init(props);
oElem.addElementToContent(oBorderBox);
var oElem = oBorderBox.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -7928,7 +7928,7 @@ function Binary_oMathReader(stream)
oBox.init(props);
oElem.addElementToContent(oBox);
var oElem = oBox.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8092,7 +8092,7 @@ function Binary_oMathReader(stream)
}
var lColumn = oDelimiter.column;
var oElem = oDelimiter.getBase(lColumn);
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8198,7 +8198,7 @@ function Binary_oMathReader(stream)
}
var lRow = oEqArr.row;
var oElem = oEqArr.getElement(lRow);
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8287,7 +8287,7 @@ function Binary_oMathReader(stream)
oGroupChr.init(props);
oElem.addElementToContent(oGroupChr);
var oElem = oGroupChr.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8360,7 +8360,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElemDen = oFraction.getDenominator();
if (length == 0)
if (oElemDen && length == 0)
oElemDen.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElemDen);
......@@ -8374,7 +8374,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElemNum = oFraction.getNumerator();
if (length == 0)
if (oElemNum && length == 0)
oElemNum.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElemNum);
......@@ -8423,7 +8423,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oFunc.getArgument();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8438,7 +8438,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oFName = oFunc.getFName();
if (length == 0)
if (oFName && length == 0)
oFName.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oFName);
......@@ -8548,7 +8548,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oLimLow.getFName();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8563,7 +8563,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oLim = oLimLow.getIterator();
if (length == 0)
if (oLim && length == 0)
oLim.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oLim);
......@@ -8607,7 +8607,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oLimUpp.getFName();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8622,7 +8622,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oLim = oLimUpp.getIterator();
if (length == 0)
if (oLim && length == 0)
oLim.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oLim);
......@@ -8852,7 +8852,7 @@ function Binary_oMathReader(stream)
var lRow = oMatrix.row;
var lColumn = oMatrix.column;
var oElem = oMatrix.getElement(lRow,lColumn);
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -8991,7 +8991,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSub = oNary.getLowerIterator();
if (length == 0)
if (oSub && length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub);
......@@ -9006,7 +9006,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSup = oNary.getUpperIterator();
if (length == 0)
if (oSup && length == 0)
oSup.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSup);
......@@ -9021,7 +9021,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oNary.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -9173,7 +9173,7 @@ function Binary_oMathReader(stream)
oPhant.init(props);
oElem.addElementToContent(oPhant);
var oElem = oPhant.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -9277,7 +9277,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oDeg = oRad.getDegree();
if (length == 0)
if (oDeg && length == 0)
oDeg.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oDeg);
......@@ -9293,7 +9293,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oRad.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -9444,7 +9444,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSub = oSPre.getLowerIterator();
if (length == 0)
if (oSub && length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub);
......@@ -9459,7 +9459,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSup = oSPre.getUpperIterator();
if (length == 0)
if (oSup && length == 0)
oSup.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSup);
......@@ -9474,7 +9474,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oSPre.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -9518,7 +9518,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSub = oSSub.getLowerIterator();
if (length == 0)
if (oSub && length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub);
......@@ -9533,7 +9533,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oSSub.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......@@ -9577,7 +9577,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSub = oSSubSup.getLowerIterator();
if (length == 0)
if (oSub && length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub);
......@@ -9592,6 +9592,8 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSup = oSSubSup.getUpperIterator();
if (oSup && length == 0)
oSup.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSup);
});
......@@ -9604,6 +9606,8 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oSSubSup.getBase();
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
});
......@@ -9652,8 +9656,8 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oSup = oSSup.getUpperIterator();
if (length == 0)
oESup.fillPlaceholders();
if (oSup && length == 0)
oSup.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSup);
});
......@@ -9667,7 +9671,7 @@ function Binary_oMathReader(stream)
props.init = true;
}
var oElem = oSSup.getBase();
if (length == 0)
if (oElem && length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem);
......
......@@ -7419,12 +7419,22 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
case 12: props = {type:DEGREE_SubSup};
var oDegree = new CDegreeSubSup();
MathElement.CreateDegree(oDegree, MathElement.Math.Root, props, null, null, null);
oDegree.fillPlaceholders();
var oSub = oDegree.getLowerIterator();
oSub.fillPlaceholders();
var oSup = oDegree.getUpperIterator();
oSup.fillPlaceholders();
var oElem = oDegree.getBase();
oElem.fillPlaceholders();
break;
case 13: props = {type:DEGREE_PreSubSup};
var oDegree = new CDegreeSubSup();
MathElement.CreateDegree(oDegree, MathElement.Math.Root, props, null, null, null);
oDegree.fillPlaceholders();
var oSub = oDegree.getLowerIterator();
oSub.fillPlaceholders();
var oSup = oDegree.getUpperIterator();
oSup.fillPlaceholders();
var oElem = oDegree.getBase();
oElem.fillPlaceholders();
break;
case 14: props = {type:DEGREE_SUBSCRIPT};
var oDegree = new CDegree();
......@@ -7526,7 +7536,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
var oDegree2 = new CDegree();
MathElement.CreateDegree(oDegree2, oElem, props, sBase, sSup, null);
break;
case 24: props = {limLoc:NARY_SubSup, subHide:true, supHide:true};
case 24: props = {limLoc:NARY_UndOvr, subHide:true, supHide:true};
var oNary = new CNary();
MathElement.CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
var oElem = oNary.getBase();
......@@ -7553,7 +7563,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
oSup.fillPlaceholders();
break;
case 27: var sVal = String.fromCharCode(8748);
props = {limLoc:NARY_SubSup, subHide:true, supHide:true, chr:sVal};
props = {limLoc:NARY_UndOvr, subHide:true, supHide:true, chr:sVal};
var oNary = new CNary();
MathElement.CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
var oElem = oNary.getBase();
......@@ -7582,7 +7592,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
oSup.fillPlaceholders();
break;
case 30: var sVal = String.fromCharCode(8749);
props = {limLoc:NARY_SubSup, subHide:true, supHide:true, chr:sVal};
props = {limLoc:NARY_UndOvr, subHide:true, supHide:true, chr:sVal};
var oNary = new CNary();
MathElement.CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
var oElem = oNary.getBase();
......@@ -7611,7 +7621,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
oSup.fillPlaceholders();
break;
case 33: var sVal = String.fromCharCode(8750);
props = {limLoc:NARY_SubSup, subHide:true, supHide:true, chr:sVal};
props = {limLoc:NARY_UndOvr, subHide:true, supHide:true, chr:sVal};
var oNary = new CNary();
MathElement.CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
var oElem = oNary.getBase();
......@@ -7640,7 +7650,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
oSup.fillPlaceholders();
break;
case 36: var sVal = String.fromCharCode(8751);
props = {limLoc:NARY_SubSup, subHide:true, supHide:true, chr:sVal};
props = {limLoc:NARY_UndOvr, subHide:true, supHide:true, chr:sVal};
var oNary = new CNary();
MathElement.CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
var oElem = oNary.getBase();
......@@ -7669,7 +7679,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
oSup.fillPlaceholders();
break;
case 39: var sVal = String.fromCharCode(8752);
props = {limLoc:NARY_SubSup, subHide:true, supHide:true, chr:sVal};
props = {limLoc:NARY_UndOvr, subHide:true, supHide:true, chr:sVal};
var oNary = new CNary();
MathElement.CreateNary(oNary,MathElement.Math.Root,props,null,null,null);
var oElem = oNary.getBase();
......
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