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

Разделены omath и omathpara

переделано св-во brk

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58760 954022d7-b5bf-4e40-9824-e11837661b57
parent 9ca170be
...@@ -2041,7 +2041,7 @@ function Binary_oMathWriter(memory, oMathPara) ...@@ -2041,7 +2041,7 @@ function Binary_oMathWriter(memory, oMathPara)
var oElem = oBox.getBase(); var oElem = oBox.getBase();
var props = oBox.getPropsForWrite(); var props = oBox.getPropsForWrite();
this.bs.WriteItem(c_oSer_OMathContentType.BorderBoxPr, function(){oThis.WriteBoxPr(props, oBox);}); this.bs.WriteItem(c_oSer_OMathContentType.BoxPr, function(){oThis.WriteBoxPr(props, oBox);});
this.bs.WriteItem(c_oSer_OMathContentType.Element, function(){oThis.WriteArgNodes(oElem);}); this.bs.WriteItem(c_oSer_OMathContentType.Element, function(){oThis.WriteArgNodes(oElem);});
} }
this.WriteBoxPr = function(props,oBox) this.WriteBoxPr = function(props,oBox)
...@@ -2062,9 +2062,18 @@ function Binary_oMathWriter(memory, oMathPara) ...@@ -2062,9 +2062,18 @@ function Binary_oMathWriter(memory, oMathPara)
} }
this.WriteBrk = function(Brk) this.WriteBrk = function(Brk)
{ {
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.AlnAt); if (Brk.alnAt)
this.memory.WriteByte(c_oSerPropLenType.Long); {
this.memory.WriteLong(Brk); this.memory.WriteByte(c_oSer_OMathBottomNodesValType.AlnAt);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(Brk.alnAt);
}
else
{
this.memory.WriteByte(c_oSer_OMathBottomNodesValType.Val);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(false);
}
} }
this.WriteCGp = function(CGp) this.WriteCGp = function(CGp)
{ {
...@@ -7424,21 +7433,19 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7424,21 +7433,19 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
} }
} }
else if ( c_oSerParType.OMathPara == type ) else if ( c_oSerParType.OMathPara == type )
{ {
var oMathPara = new ParaMath(); var props = {};
oParStruct.addToContent(oMathPara);
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.boMathr.ReadMathOMathPara(t,l,oMathPara); return oThis.boMathr.ReadMathOMathPara(t,l,oParStruct, props);
}); });
} }
else if ( c_oSerParType.OMath == type ) else if ( c_oSerParType.OMath == type )
{ {
var oMathPara = new ParaMath(); var oMath = new ParaMath();
oParStruct.addToContent(oMathPara); oParStruct.addToContent(oMath);
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.boMathr.ReadMathArg(t,l,oMathPara.Root); return oThis.boMathr.ReadMathArg(t,l,oMath.Root);
}); });
} }
else if (c_oSerParType.Hyperlink == type) { else if (c_oSerParType.Hyperlink == type) {
...@@ -8524,6 +8531,8 @@ function Binary_oMathReader(stream) ...@@ -8524,6 +8531,8 @@ function Binary_oMathReader(stream)
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathMRun(t,l,oMRun,props,oElem); return oThis.ReadMathMRun(t,l,oMRun,props,oElem);
}); });
if (oElem)
oElem.addElementToContent(oMRun);
} }
else if (c_oSer_OMathContentType.Rad === type) else if (c_oSer_OMathContentType.Rad === type)
{ {
...@@ -8849,11 +8858,13 @@ function Binary_oMathReader(stream) ...@@ -8849,11 +8858,13 @@ function Binary_oMathReader(stream)
var oThis = this; var oThis = this;
if (c_oSer_OMathBottomNodesValType.Val === type) if (c_oSer_OMathBottomNodesValType.Val === type)
{ {
props.brk = this.stream.GetBool(); var brk = this.stream.GetBool();
props.brk = {brk: true };
} }
else if (c_oSer_OMathBottomNodesValType.AlnAt === type) else if (c_oSer_OMathBottomNodesValType.AlnAt === type)
{ {
props.alnAt = this.stream.GetULongLE(); var aln = this.stream.GetULongLE();
props.brk = {brk: true, alnAt:aln};
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
...@@ -9508,11 +9519,16 @@ function Binary_oMathReader(stream) ...@@ -9508,11 +9519,16 @@ function Binary_oMathReader(stream)
oMatr.content.row = 0; oMatr.content.row = 0;
oMatr.content.column = 0; oMatr.content.column = 0;
var column = 0;
for (var i=0; i<props.mcs.length; i++)
column += props.mcs[i].count;
for(var i=0; i<props.row; i++) for(var i=0; i<props.row; i++)
{ {
arrContent[i] = []; arrContent[i] = [];
for(var j=0; j<props.column; j++) for(var j=0; j<column; j++)
arrContent[i][j] = oMatrix.getElement(i,j); arrContent[i][j] = oMatrix.getElement(i,j);
} }
} }
...@@ -9627,12 +9643,6 @@ function Binary_oMathReader(stream) ...@@ -9627,12 +9643,6 @@ function Binary_oMathReader(stream)
res = this.bcr.Read2(length, function(t, l){ res = this.bcr.Read2(length, function(t, l){
return oThis.ReadMathRow(t,l,props); return oThis.ReadMathRow(t,l,props);
}); });
}
else if (c_oSer_OMathBottomNodesType.Column === type)
{
res = this.bcr.Read2(length, function(t, l){
return oThis.ReadMathColumn(t,l,props);
});
} }
else if (c_oSer_OMathBottomNodesType.BaseJc === type) else if (c_oSer_OMathBottomNodesType.BaseJc === type)
{ {
...@@ -9754,9 +9764,6 @@ function Binary_oMathReader(stream) ...@@ -9754,9 +9764,6 @@ function Binary_oMathReader(stream)
if (oText) if (oText)
oMRun.Add_ToContent(i, oText, false, true); oMRun.Add_ToContent(i, oText, false, true);
} }
if (oParent)
oParent.addElementToContent(oMRun);
} }
else if (c_oSer_OMathContentType.MRPr === type) else if (c_oSer_OMathContentType.MRPr === type)
{ {
...@@ -9970,20 +9977,21 @@ function Binary_oMathReader(stream) ...@@ -9970,20 +9977,21 @@ function Binary_oMathReader(stream)
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
}; };
this.ReadMathOMathPara = function(type, length, oOMathPara) this.ReadMathOMathPara = function(type, length, oParStruct, props)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this; var oThis = this;
if (c_oSer_OMathContentType.OMath === type) if (c_oSer_OMathContentType.OMath === type)
{ {
var oMath = new ParaMath(props);
oParStruct.addToContent(oMath);
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oOMathPara.Root); return oThis.ReadMathArg(t,l,oMath.Root);
}); });
} }
else if (c_oSer_OMathContentType.OMathParaPr === type) else if (c_oSer_OMathContentType.OMathParaPr === type)
{ {
var props = {};
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathOMathParaPr(t,l,props); return oThis.ReadMathOMathParaPr(t,l,props);
}); });
......
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