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

сохранение формул в xml поправлены баги

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53270 954022d7-b5bf-4e40-9824-e11837661b57
parent d1a368bb
...@@ -2438,98 +2438,94 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -2438,98 +2438,94 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
}); });
} }
}; };
this.WriteMathArgNodes = function(oOMath) this.WriteMathArgNodes = function(oElem)
{ {
var oThis = this; if (oElem)
var nStart = 0; {
var nEnd = oOMath.content.length - 1; var oThis = this;
var nCurPos = 0; var nStart = 0;
var nEnd = oElem.content.length - 1;
var oText = ""; var nCurPos = 0;
for(var i = nStart; i <= nEnd; i++)
{
var item = oOMath.content[i].value;
var nextItem = null; for(var i = nStart; i <= nEnd; i++)
if ( oOMath.content[i+1] != null) {
nextItem = oOMath.content[i+1].value; var item = oElem.content[i].value;
switch ( item.typeObj) switch ( item.typeObj)
{ {
case MATH_COMP: case MATH_COMP:
{
switch (item.kind)
{ {
case MATH_ACCENT : this.bs.WriteItem(c_oSer_OMathContentType.Acc, function(){oThis.WriteMathAcc(item);}); break; switch (item.kind)
case "ArgPr" : this.bs.WriteItem(c_oSer_OMathContentType.ArgPr, function(){oThis.WriteMathArgPr(item);}); break;//нет обертки {
case MATH_BAR : this.bs.WriteItem(c_oSer_OMathContentType.Bar, function(){oThis.WriteMathBar(item);}); break; case MATH_ACCENT : this.bs.WriteItem(c_oSer_OMathContentType.Acc, function(){oThis.WriteMathAcc(item);}); break;
case MATH_BORDER_BOX : this.bs.WriteItem(c_oSer_OMathContentType.BorderBox, function(){oThis.WriteMathBorderBox(item);});break; case "ArgPr" : this.bs.WriteItem(c_oSer_OMathContentType.ArgPr, function(){oThis.WriteMathArgPr(item);}); break;//нет обертки
case MATH_BOX : this.bs.WriteItem(c_oSer_OMathContentType.Box, function(){oThis.WriteMathBox(item);}); break; case MATH_BAR : this.bs.WriteItem(c_oSer_OMathContentType.Bar, function(){oThis.WriteMathBar(item);}); break;
case "CCtrlPr" : this.bs.WriteItem(c_oSer_OMathContentType.CtrlPr, function(){oThis.WriteMathCtrlPr(item);}); break; case MATH_BORDER_BOX : this.bs.WriteItem(c_oSer_OMathContentType.BorderBox, function(){oThis.WriteMathBorderBox(item);});break;
case MATH_DELIMITER : this.bs.WriteItem(c_oSer_OMathContentType.Delimiter, function(){oThis.WriteMathDelimiter(item);});break; case MATH_BOX : this.bs.WriteItem(c_oSer_OMathContentType.Box, function(){oThis.WriteMathBox(item);}); break;
case MATH_EQ_ARRAY : this.bs.WriteItem(c_oSer_OMathContentType.EqArr, function(){oThis.WriteMathEqArr(item);}); break; case "CCtrlPr" : this.bs.WriteItem(c_oSer_OMathContentType.CtrlPr, function(){oThis.WriteMathCtrlPr(item);}); break;
case MATH_FRACTION : this.bs.WriteItem(c_oSer_OMathContentType.Fraction, function(){oThis.WriteMathFraction(item);}); break; case MATH_DELIMITER : this.bs.WriteItem(c_oSer_OMathContentType.Delimiter, function(){oThis.WriteMathDelimiter(item);});break;
case MATH_FUNCTION : this.bs.WriteItem(c_oSer_OMathContentType.Func, function(){oThis.WriteMathFunc(item);}); break; case MATH_EQ_ARRAY : this.bs.WriteItem(c_oSer_OMathContentType.EqArr, function(){oThis.WriteMathEqArr(item);}); break;
case MATH_GROUP_CHARACTER : this.bs.WriteItem(c_oSer_OMathContentType.GroupChr, function(){oThis.WriteMathGroupChr(item);}); break; case MATH_FRACTION : this.bs.WriteItem(c_oSer_OMathContentType.Fraction, function(){oThis.WriteMathFraction(item);}); break;
case MATH_LIMIT : case MATH_FUNCTION : this.bs.WriteItem(c_oSer_OMathContentType.Func, function(){oThis.WriteMathFunc(item);}); break;
if (LIMIT_LOW == item.type) case MATH_GROUP_CHARACTER : this.bs.WriteItem(c_oSer_OMathContentType.GroupChr, function(){oThis.WriteMathGroupChr(item);}); break;
this.bs.WriteItem(c_oSer_OMathContentType.LimLow, function(){oThis.WriteMathLimLow(item);}); case MATH_LIMIT :
else if (LIMIT_UP == item.type) if (LIMIT_LOW == item.type)
this.bs.WriteItem(c_oSer_OMathContentType.LimUpp, function(){oThis.WriteMathLimUpp(item);}); this.bs.WriteItem(c_oSer_OMathContentType.LimLow, function(){oThis.WriteMathLimLow(item);});
break; else if (LIMIT_UP == item.type)
case MATH_MATRIX : this.bs.WriteItem(c_oSer_OMathContentType.Matrix, function(){oThis.WriteMathMatrix(item);}); break; this.bs.WriteItem(c_oSer_OMathContentType.LimUpp, function(){oThis.WriteMathLimUpp(item);});
case MATH_NARY : this.bs.WriteItem(c_oSer_OMathContentType.Nary, function(){oThis.WriteMathNary(item);}); break; break;
case "OMath" : this.bs.WriteItem(c_oSer_OMathContentType.OMath, function(){oThis.WriteMathArgNodes(item);}); break; case MATH_MATRIX : this.bs.WriteItem(c_oSer_OMathContentType.Matrix, function(){oThis.WriteMathMatrix(item);}); break;
case "OMathPara" : this.bs.WriteItem(c_oSer_OMathContentType.OMathPara, function(){oThis.WriteMathOMathPara(item);});break; case MATH_NARY : this.bs.WriteItem(c_oSer_OMathContentType.Nary, function(){oThis.WriteMathNary(item);}); break;
case MATH_PHANTOM : this.bs.WriteItem(c_oSer_OMathContentType.Phant, function(){oThis.WriteMathPhant(item);}); break; case "OMath" : this.bs.WriteItem(c_oSer_OMathContentType.OMath, function(){oThis.WriteMathArgNodes(item);}); break;
//case "MRun" : this.bs.WriteItem(c_oSer_OMathContentType.MRun, function(){oThis.WriteMathMRun(item);}); break; case "OMathPara" : this.bs.WriteItem(c_oSer_OMathContentType.OMathPara, function(){oThis.WriteMathOMathPara(item);});break;
case MATH_RADICAL : this.bs.WriteItem(c_oSer_OMathContentType.Rad, function(){oThis.WriteMathRad(item);}); break; case MATH_PHANTOM : this.bs.WriteItem(c_oSer_OMathContentType.Phant, function(){oThis.WriteMathPhant(item);}); break;
case MATH_DEGREESubSup : //case "MRun" : this.bs.WriteItem(c_oSer_OMathContentType.MRun, function(){oThis.WriteMathMRun(item);}); break;
if (DEGREE_PreSubSup == item.type) case MATH_RADICAL : this.bs.WriteItem(c_oSer_OMathContentType.Rad, function(){oThis.WriteMathRad(item);}); break;
this.bs.WriteItem(c_oSer_OMathContentType.SPre, function(){oThis.WriteMathSPre(item);}); case MATH_DEGREESubSup :
else if (DEGREE_SubSup == item.type) if (DEGREE_PreSubSup == item.type)
this.bs.WriteItem(c_oSer_OMathContentType.SSubSup, function(){oThis.WriteMathSSubSup(item);}); this.bs.WriteItem(c_oSer_OMathContentType.SPre, function(){oThis.WriteMathSPre(item);});
break; else if (DEGREE_SubSup == item.type)
case MATH_DEGREE : this.bs.WriteItem(c_oSer_OMathContentType.SSubSup, function(){oThis.WriteMathSSubSup(item);});
if (DEGREE_SUBSCRIPT == item.type) break;
this.bs.WriteItem(c_oSer_OMathContentType.SSub, function(){oThis.WriteMathSSub(item);}); case MATH_DEGREE :
else if (DEGREE_SUPERSCRIPT == item.type) if (DEGREE_SUBSCRIPT == item.type)
this.bs.WriteItem(c_oSer_OMathContentType.SSup, function(){oThis.WriteMathSSup(item);}); this.bs.WriteItem(c_oSer_OMathContentType.SSub, function(){oThis.WriteMathSSub(item);});
break; else if (DEGREE_SUPERSCRIPT == item.type)
this.bs.WriteItem(c_oSer_OMathContentType.SSup, function(){oThis.WriteMathSSup(item);});
break;
}
break;
} }
break; case MATH_RUN_PRP:
} {
case MATH_RUN_PRP: this.memory.WriteByte(c_oSer_OMathContentType.MRun);
{ nCurPos = this.bs.WriteItemWithLengthStart();
nCurPos = this.bs.WriteItemWithLengthStart();
this.memory.WriteByte(c_oSer_OMathContentType.MRun);
var props = item.getPropsForWrite();
var props = item.getPropsForWrite(); oThis.bs.WriteItem(c_oSerRunType.rPr, function(){oThis.brPrs.Write_rPr(props.textPrp);}); // w:rPr
oThis.bs.WriteItem(c_oSerRunType.rPr, function(){oThis.brPrs.Write_rPr(props.textPrp);}); // w:rPr if ( props.mathRunPrp != null)
if ( props.mathRunPrp != null) this.bs.WriteItem(c_oSer_OMathContentType.MRPr, function(){oThis.WriteMathMRPr(props.mathRunPrp);}); // m:rPr
this.bs.WriteItem(c_oSer_OMathContentType.MRPr, function(){oThis.WriteMathMRPr(props.mathRunPrp);}); // m:rPr
oText = "";
}
break;
case MATH_TEXT:
{
oText += String.fromCharCode(item.value);
if (nextItem == null || nextItem.typeObj == MATH_RUN_PRP)
{
if (null != oText)
this.bs.WriteItem(c_oSer_OMathContentType.MText, function(){ oThis.memory.WriteString2(oText.toString());}); //m:t
var oText = "";
while (oElem.content[i+1] != null && oElem.content[i+1].value.typeObj == MATH_TEXT)
{
oText += String.fromCharCode(oElem.content[i+1].value.value);
i++
}
if (null != oText)
this.bs.WriteItem(c_oSer_OMathContentType.MText, function(){ oThis.memory.WriteString2(oText);}); //m:t
this.bs.WriteItemEnd(nCurPos); this.bs.WriteItemEnd(nCurPos);
nCurPos = 0;
} }
} break;
break; case MATH_TEXT:
case MATH_PLACEHOLDER: case MATH_PLACEHOLDER:
case MATH_EMPTY: case MATH_EMPTY:
break; break;
}
} }
} }
}; };
this.WriteMathAcc = function(oAcc) this.WriteMathAcc = function(oAcc)
...@@ -2714,7 +2710,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -2714,7 +2710,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
{ {
var oThis = this; var oThis = this;
var nStart = 0; var nStart = 0;
var nEnd = oDelimiter.elements.length; var nEnd = oDelimiter.nCol;
var props = oDelimiter.getPropsForWrite(); var props = oDelimiter.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.DelimiterPr, function(){oThis.WriteMathDelimiterPr(props, oDelimiter);}); this.bs.WriteItem(c_oSer_OMathContentType.DelimiterPr, function(){oThis.WriteMathDelimiterPr(props, oDelimiter);});
...@@ -2838,33 +2834,48 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -2838,33 +2834,48 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
} }
this.WriteMathGrow = function(Grow) this.WriteMathGrow = function(Grow)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (!Grow)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(Grow); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(Grow);
}
} }
this.WriteMathHideBot = function(HideBot) this.WriteMathHideBot = function(HideBot)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (HideBot)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(HideBot); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(HideBot);
}
} }
this.WriteMathHideLeft = function(HideLeft) this.WriteMathHideLeft = function(HideLeft)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (HideLeft)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(HideLeft); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(HideLeft);
}
} }
this.WriteMathHideRight = function(HideRight) this.WriteMathHideRight = function(HideRight)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (HideRight)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(HideRight); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(HideRight);
}
} }
this.WriteMathHideTop = function(HideTop) this.WriteMathHideTop = function(HideTop)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (HideTop)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(HideTop); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(HideTop);
}
} }
this.WriteMathMJc = function(MJc) this.WriteMathMJc = function(MJc)
{ {
...@@ -2874,9 +2885,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -2874,9 +2885,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
} }
this.WriteMathLimLoc = function(LimLoc) this.WriteMathLimLoc = function(LimLoc)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (LimLoc != 1)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteByte(LimLoc); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(LimLoc);
}
} }
this.WriteMathLimLow = function(oLimLow) this.WriteMathLimLow = function(oLimLow)
{ {
...@@ -2929,7 +2943,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -2929,7 +2943,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
var nEnd = oMatrix.nRow; var nEnd = oMatrix.nRow;
var props = oMatrix.getPropsForWrite(); var props = oMatrix.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.MatrixPr, function(){oThis.WriteMathMPr(props, oMatrix);}); this.bs.WriteItem(c_oSer_OMathContentType.MPr, function(){oThis.WriteMathMPr(props, oMatrix);});
for(var i = nStart; i < nEnd; i++) for(var i = nStart; i < nEnd; i++)
{ {
...@@ -3157,11 +3171,14 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -3157,11 +3171,14 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(Show); this.memory.WriteBool(Show);
} }
this.WriteMathShp = function(Show) this.WriteMathShp = function(Shp)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (Shp != 1)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteByte(Show); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(Shp);
}
} }
this.WriteMathSPre = function(oSPre) this.WriteMathSPre = function(oSPre)
{ {
...@@ -3236,27 +3253,39 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -3236,27 +3253,39 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
} }
this.WriteMathStrikeBLTR = function(StrikeBLTR) this.WriteMathStrikeBLTR = function(StrikeBLTR)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (StrikeBLTR)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(StrikeBLTR); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(StrikeBLTR);
}
} }
this.WriteMathStrikeH = function(StrikeH) this.WriteMathStrikeH = function(StrikeH)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (StrikeH)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(StrikeH); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(StrikeH);
}
} }
this.WriteMathStrikeTLBR = function(StrikeTLBR) this.WriteMathStrikeTLBR = function(StrikeTLBR)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (StrikeTLBR)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(StrikeTLBR); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(StrikeTLBR);
}
} }
this.WriteMathStrikeV = function(StrikeV) this.WriteMathStrikeV = function(StrikeV)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (StrikeV)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(StrikeV); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(StrikeV);
}
} }
this.WriteMathSty = function(Sty) this.WriteMathSty = function(Sty)
{ {
...@@ -3266,15 +3295,21 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -3266,15 +3295,21 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
} }
this.WriteMathSubHide = function(SubHide) this.WriteMathSubHide = function(SubHide)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (SubHide)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(SubHide); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(SubHide);
}
} }
this.WriteMathSupHide = function(SupHide) this.WriteMathSupHide = function(SupHide)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if (SupHide)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteBool(SupHide); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(SupHide);
}
} }
this.WriteMathTransp = function(Transp) this.WriteMathTransp = function(Transp)
{ {
...@@ -3284,9 +3319,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -3284,9 +3319,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
} }
this.WriteMathType = function(Type) this.WriteMathType = function(Type)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val); if ( Type != 0)
this.memory.WriteByte(c_oSerPropLenType.Byte); {
this.memory.WriteByte(Type); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(Type);
}
} }
this.WriteMathVertJc = function(VertJc) this.WriteMathVertJc = function(VertJc)
{ {
......
...@@ -72,7 +72,7 @@ CMathMatrix.prototype.init = function(props) ...@@ -72,7 +72,7 @@ CMathMatrix.prototype.init = function(props)
this.setRuleGap(this.spaceColumn, props.cGpRule, props.cGp, props.cSp); this.setRuleGap(this.spaceColumn, props.cGpRule, props.cGp, props.cSp);
this.setRuleGap(this.spaceRow, props.rSpRule, props.rSp); this.setRuleGap(this.spaceRow, props.rSpRule, props.rSp);
if(props.plcHide === true) if(props.plcHide === true || props.plcHide === 1)
{ {
this.plcHide = true; this.plcHide = true;
this.hidePlaceholder(true); this.hidePlaceholder(true);
......
...@@ -20,7 +20,7 @@ function CNary() ...@@ -20,7 +20,7 @@ function CNary()
this.grow = false; this.grow = false;
this.supHide = false; this.supHide = false;
this.subHide = false; this.subHide = false;
this.limLoc = NARY_SubSup; this.limLoc = NARY_UndOvr;
CSubMathBase.call(this); CSubMathBase.call(this);
} }
extend(CNary, CSubMathBase); extend(CNary, CSubMathBase);
......
...@@ -2966,7 +2966,9 @@ COperator.prototype.getChr = function() ...@@ -2966,7 +2966,9 @@ COperator.prototype.getChr = function()
var chr = null; //если operator не определен, то this.code = null var chr = null; //если operator не определен, то this.code = null
if(this.code !== null) if(this.code !== null)
chr = this.typeOper == this.defaultType ? "" : String.fromCharCode(this.code); chr = this.typeOper == this.defaultType ? null : String.fromCharCode(this.code);
if (this.operator == OPERATOR_EMPTY)
chr = "";
return chr; return chr;
} }
...@@ -3527,7 +3529,13 @@ CDelimiter.prototype.getPropsForWrite = function() ...@@ -3527,7 +3529,13 @@ CDelimiter.prototype.getPropsForWrite = function()
props.grow = this.grow == true ? 1 : 0; props.grow = this.grow == true ? 1 : 0;
props.column = this.nCol; props.column = this.nCol;
props.shp = this.shape;
var shp = null
if ( this.shape == DELIMITER_SHAPE_MATH)
shp = 0;
else if ( this.shape == DELIMITER_SHAPE_CENTERED )
shp = 1;
props.shp = shp;
props.begChr = this.begOper.getChr(); // default: PARENTHESIS_LEFT props.begChr = this.begOper.getChr(); // default: PARENTHESIS_LEFT
props.endChr = this.endOper.getChr(); // default: PARENTHESIS_RIGHT props.endChr = this.endOper.getChr(); // default: PARENTHESIS_RIGHT
...@@ -3886,10 +3894,10 @@ CGroupCharacter.prototype.old_getGlyph = function(code, type) ...@@ -3886,10 +3894,10 @@ CGroupCharacter.prototype.old_getGlyph = function(code, type)
CGroupCharacter.prototype.getPropsForWrite = function() CGroupCharacter.prototype.getPropsForWrite = function()
{ {
var vertJc = null; var vertJc = null;
if (this.vertJc == VJUST_BOT) if (this.vertJc == VJUST_TOP)
vertJc = 0;
else if ( this.vertJc == VJUST_TOP)
vertJc = 1; vertJc = 1;
else
vertJc = 0;
var pos = null; var pos = null;
if (this.loc == LOCATION_BOT) if (this.loc == LOCATION_BOT)
......
...@@ -8838,7 +8838,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type) ...@@ -8838,7 +8838,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
var oDegree2 = new CDegree(); var oDegree2 = new CDegree();
MathElement.CreateDegree(oDegree2, oElem, props, "c", "2", null); MathElement.CreateDegree(oDegree2, oElem, props, "c", "2", null);
break; break;
case 175: props = {pos:"top"}; case 175: props = {pos:LOCATION_TOP};
var oBar = new CBar(); var oBar = new CBar();
MathElement.CreateElem(oBar,MathElement.Math.Root,props); MathElement.CreateElem(oBar,MathElement.Math.Root,props);
oBar.fillPlaceholders(); oBar.fillPlaceholders();
...@@ -8847,19 +8847,19 @@ asc_docs_api.prototype.asc_AddMath = function(Type) ...@@ -8847,19 +8847,19 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
MathElement.CreateElem(oBar,MathElement.Math.Root,props); MathElement.CreateElem(oBar,MathElement.Math.Root,props);
oBar.fillPlaceholders(); oBar.fillPlaceholders();
break; break;
case 177: props = {pos:"top"}; case 177: props = {pos:LOCATION_TOP};
var oBar = new CBar(); var oBar = new CBar();
MathElement.CreateElem(oBar,MathElement.Math.Root,props); MathElement.CreateElem(oBar,MathElement.Math.Root,props);
oElem = oBar.getBase(); oElem = oBar.getBase();
MathElement.AddText(oElem, "A"); MathElement.AddText(oElem, "A");
break; break;
case 178: props = {pos:"top"}; case 178: props = {pos:LOCATION_TOP};
var oBar = new CBar(); var oBar = new CBar();
MathElement.CreateElem(oBar,MathElement.Math.Root,props); MathElement.CreateElem(oBar,MathElement.Math.Root,props);
oElem = oBar.getBase(); oElem = oBar.getBase();
MathElement.AddText(oElem, "ABC"); MathElement.AddText(oElem, "ABC");
break; break;
case 179: props = {pos:"top"}; case 179: props = {pos:LOCATION_TOP};
var oBar = new CBar(); var oBar = new CBar();
MathElement.CreateElem(oBar,MathElement.Math.Root,props); MathElement.CreateElem(oBar,MathElement.Math.Root,props);
oElem = oBar.getBase(); oElem = oBar.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