Commit 30fd9de5 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@53200 954022d7-b5bf-4e40-9824-e11837661b57
parent 254154ae
......@@ -2443,6 +2443,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
var oThis = this;
var nStart = 0;
var nEnd = oOMath.content.length - 1;
var nCurPos = 0;
var oText = "";
for(var i = nStart; i <= nEnd; i++)
......@@ -2499,21 +2500,29 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
break;
}
case MATH_RUN_PRP:
{
{
nCurPos = this.bs.WriteItemWithLengthStart();
this.memory.WriteByte(c_oSer_OMathContentType.MRun);
var props = item.getPropsForWrite();
oThis.bs.WriteItem(c_oSerRunType.rPr, function(){oThis.brPrs.Write_rPr(props.textPrp);}); // w:rPr
if ( props.mathRunPrp != null)
this.bs.WriteItem(c_oSer_OMathContentType.MRPr, function(){oThis.WriteMathMRPr(props.mathRunPrp);}); // m:rPr
oText = "";
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
this.bs.WriteItemEnd(nCurPos);
nCurPos = 0;
}
}
break;
case MATH_PLACEHOLDER:
......@@ -2672,6 +2681,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(Chr);
}
this.WriteMathCount = function(Count)
{
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(Count);
}
this.WriteMathCSp = function(CSp)
{
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
......@@ -2789,13 +2804,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
var oThis = this;
var oFName = oFunc.getFName();
var oElem = oFunc.getArgument();
var props = oFunc.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.FPr, function(){oThis.WriteMathFuncPr(props, oFunc);});
this.bs.WriteItem(c_oSer_OMathContentType.FPr, function(){oThis.WriteMathFuncPr(oFunc);});
this.bs.WriteItem(c_oSer_OMathContentType.FName, function(){oThis.WriteMathArgNodes(oFName);});
this.bs.WriteItem(c_oSer_OMathContentType.Element, function(){oThis.WriteMathArgNodes(oElem);});
}
this.WriteMathFuncPr = function(props,oFunc)
this.WriteMathFuncPr = function(oFunc)
{
var oThis = this;
if (null != oFunc.CtrPrp)
......@@ -2804,7 +2818,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
this.WriteMathGroupChr = function(oGroupChr)
{
var oThis = this;
var oElem = oGroupChr.getArgument();
var oElem = oGroupChr.getBase();
var props = oGroupChr.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.GroupChrPr, function(){oThis.WriteMathGroupChrPr(props, oGroupChr);});
......@@ -2869,13 +2883,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
var oThis = this;
var oElem = oLimLow.getFName();
var oLim = oLimLow.getIterator();
var props = oLimLow.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.LimLowPr, function(){oThis.WriteMathLimLowPr(props, oLimLow);});
this.bs.WriteItem(c_oSer_OMathContentType.LimLowPr, function(){oThis.WriteMathLimLowPr(oLimLow);});
this.bs.WriteItem(c_oSer_OMathContentType.Element, function(){oThis.WriteMathArgNodes(oElem);});
this.bs.WriteItem(c_oSer_OMathContentType.Lim, function(){oThis.WriteMathArgNodes(oLim);});
}
this.WriteMathLimLowPr = function(props,oLimLow)
this.WriteMathLimLowPr = function(oLimLow)
{
var oThis = this;
if (null != oLimLow.CtrPrp)
......@@ -2886,13 +2899,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
var oThis = this;
var oElem = oLimUpp.getFName();
var oLim = oLimUpp.getIterator();
var props = oLimUpp.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.LimUppPr, function(){oThis.WriteMathLimUppPr(props, oLimUpp);});
this.bs.WriteItem(c_oSer_OMathContentType.LimUppPr, function(){oThis.WriteMathLimUppPr(oLimUpp);});
this.bs.WriteItem(c_oSer_OMathContentType.Element, function(){oThis.WriteMathArgNodes(oElem);});
this.bs.WriteItem(c_oSer_OMathContentType.Lim, function(){oThis.WriteMathArgNodes(oLim);});
}
this.WriteMathLimUppPr = function(props,oLimUpp)
this.WriteMathLimUppPr = function(oLimUpp)
{
var oThis = this;
if (null != oLimUpp.CtrPrp)
......@@ -2914,7 +2926,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
{
var oThis = this;
var nStart = 0;
var nEnd = oMatrix.props.row;
var nEnd = oMatrix.nRow;
var props = oMatrix.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.MatrixPr, function(){oThis.WriteMathMPr(props, oMatrix);});
......@@ -2968,11 +2980,11 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
{
var oThis = this;
var nStart = 0;
var nEnd = oMatrix.props.column;
var nEnd = oMatrix.nCol;
for(var i = nStart; i < nEnd; i++)
{
var oElem = oMatrix.getBase(nRow,i);
var oElem = oMatrix.getElement(nRow,i);
this.bs.WriteItem(c_oSer_OMathContentType.Element, function(){oThis.WriteMathArgNodes(oElem);});
}
}
......
......@@ -260,6 +260,20 @@ CBorderBox.prototype.getBase = function()
{
return this.elements[0][0];
}
CBorderBox.prototype.getPropsForWrite = function()
{
var props = {
hideBot: !this.bBot,
hideLeft: !this.bLeft,
hideRight: !this.bRight,
hideTop: !this.bTop,
strikeBLTR: this.bLDiag,
strikeH: this.bHor,
strikeTLBR: this.bRDiag,
strikeV: this.bVert
};
return props;
}
function CBox()
......@@ -291,6 +305,17 @@ CBox.prototype.getBase = function()
{
return this.elements[0][0];
}
CBox.prototype.getPropsForWrite = function()
{
var props = {
aln: null,
brk: null,
diff: this.diff,
noBreak: this.noBreak,
opEmu: this.opEmu
};
return props;
}
function CBar()
{
......
......@@ -143,14 +143,6 @@ CDegree.prototype.getBase = function()
{
return this.elements[0][0];
}
CDegree.prototype.getPropsForWrite = function()
{
var props = {};
props.type = this.type;
return props;
}
function CIterators()
{
......@@ -312,11 +304,9 @@ CDegreeSubSup.prototype.getLowerIterator = function()
}
CDegreeSubSup.prototype.getPropsForWrite = function()
{
var props = {};
props.type = this.type;
props.alnScr = this.alnScr;
var props = {
alnScr: this.alnScr
};
return props;
}
......
......@@ -386,9 +386,19 @@ CFraction.prototype.findDisposition = function( mCoord )
}
CFraction.prototype.getPropsForWrite = function()
{
var props = {};
props.type = this.type;
var type = null;
if (this.type == BAR_FRACTION)
type = 0;
else if (this.type == LINEAR_FRACTION)
type = 1;
else if (this.type == NO_BAR_FRACTION)
type = 2;
else if (this.type == SKEWED_FRACTION)
type = 3;
var props = {
type: type
};
return props;
}
......
......@@ -466,6 +466,20 @@ CMathMatrix.prototype.baseJustification = function(type)
this.baseJc = type;
}
CMathMatrix.prototype.getPropsForWrite = function()
{
var props = {
baseJc: this.baseJc,
cGp: this.spaceColumn.gap,
cGpRule: this.spaceColumn.rule,
cSp: null,
column: this.nCol,
plcHide: this.plcHide,
rSp: null,
rSpRule: null
};
return props;
}
////
......
......@@ -214,16 +214,20 @@ CNary.prototype.getLowerIterator = function()
if (!this.subHide)
return this.elements[0][0].getLowerIterator();
}
CNary.prototype.getPropsForWhite = function()
{
var props = {};
props.limLoc = (this.limLoc == NARY_UndOvr) ? NARY_UndOvr : NARY_SubSup;
props.chr = String.fromCharCode(this.code);
props.supHide = this.supHide === true ? 1: 0;
props.subHide = this.subHide === true ? 1: 0;
props.grow = this.grow === true ? 1 : 0;
CNary.prototype.getPropsForWrite = function()
{
var limloc = null;
if (this.limLoc == NARY_SubSup)
limLoc = 0;
else if (this.limLoc == NARY_UndOvr)
limLoc = 1;
var props = {
chr: String.fromCharCode(this.code),
grow: this.grow,
limLoc: limLoc,
subHide: this.subHide,
supHide: this.supHide
};
return props;
}
......
......@@ -3673,4 +3673,26 @@ CGroupCharacter.prototype.old_getGlyph = function(code, type)
}
return glyph;
}
CGroupCharacter.prototype.getPropsForWrite = function()
{
var vertJc = null;
if (this.vertJc == VJUST_BOT)
vertJc = 0;
else if ( this.vertJc == VJUST_TOP)
vertJc = 1;
var pos = null;
if (this.loc == LOCATION_BOT)
pos = 0;
else if ( this.loc == LOCATION_TOP)
pos = 1;
var props = {
chr: String.fromCharCode(this.operator.code),
pos: pos,
vertJc: vertJc
};
return props;
}
\ No newline at end of file
......@@ -439,7 +439,7 @@ CRadical.prototype.getDegree = function()
return this.elements[0][0];
}
CRadical.prototype.getPropsForWhite = function()
CRadical.prototype.getPropsForWrite = function()
{
var props = {};
......
......@@ -7481,7 +7481,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
var sText = "-b" + String.fromCharCode(177);
MathElement.AddText(oElemNum, sText);
props = {type:SQUARE_RADICAL, degHede:true};
props = {type:DEGREE_RADICAL, degHede:true};
var oRadical = new CRadical();
MathElement.CreateElem(oRadical, oElemNum, props);
var oElem = oRadical.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