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

m:run для формул при чтении

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55167 954022d7-b5bf-4e40-9824-e11837661b57
parent 338158f7
...@@ -8060,6 +8060,7 @@ function Binary_oMathReader(stream) ...@@ -8060,6 +8060,7 @@ function Binary_oMathReader(stream)
var oThis = this; var oThis = this;
var props = new Object(); var props = new Object();
props.init = false; props.init = false;
//props.bCollaborative = false;
if (c_oSer_OMathContentType.Acc === type) if (c_oSer_OMathContentType.Acc === type)
{ {
var oMathAcc = new CAccent(); var oMathAcc = new CAccent();
...@@ -8179,11 +8180,10 @@ function Binary_oMathReader(stream) ...@@ -8179,11 +8180,10 @@ function Binary_oMathReader(stream)
} }
else if (c_oSer_OMathContentType.MRun === type) else if (c_oSer_OMathContentType.MRun === type)
{ {
//этой обертки пока нет
var rpr = new CTextPr();
var props = new Object(); var props = new Object();
var oMRun = new ParaRun();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathMRun(t,l,oElem,rpr,props); return oThis.ReadMathMRun(t,l,oMRun,props,oElem);
}); });
} }
else if (c_oSer_OMathContentType.Rad === type) else if (c_oSer_OMathContentType.Rad === type)
...@@ -8231,6 +8231,7 @@ function Binary_oMathReader(stream) ...@@ -8231,6 +8231,7 @@ function Binary_oMathReader(stream)
var oThis = this; var oThis = this;
var props = new Object(); var props = new Object();
props.init = false; props.init = false;
//props.bCollaborative = true;
if (c_oSer_OMathContentType.Acc === type) if (c_oSer_OMathContentType.Acc === type)
{ {
var oMathAcc = new CAccent(); var oMathAcc = new CAccent();
...@@ -9196,7 +9197,7 @@ function Binary_oMathReader(stream) ...@@ -9196,7 +9197,7 @@ function Binary_oMathReader(stream)
{ {
if (!props.init) if (!props.init)
{ {
oFraction.init(props,true); oFraction.init(props);
oParent.addElementToContent(oFraction); oParent.addElementToContent(oFraction);
props.init = true; props.init = true;
} }
...@@ -9268,7 +9269,7 @@ function Binary_oMathReader(stream) ...@@ -9268,7 +9269,7 @@ function Binary_oMathReader(stream)
{ {
if(!props.init) if(!props.init)
{ {
oFunc.init(); oFunc.init(props);
oParent.addElementToContent(oFunc); oParent.addElementToContent(oFunc);
props.init = true; props.init = true;
} }
...@@ -9283,7 +9284,7 @@ function Binary_oMathReader(stream) ...@@ -9283,7 +9284,7 @@ function Binary_oMathReader(stream)
{ {
if(!props.init) if(!props.init)
{ {
oFunc.init(); oFunc.init(props);
oParent.addElementToContent(oFunc); oParent.addElementToContent(oFunc);
props.init = true; props.init = true;
} }
...@@ -9316,7 +9317,7 @@ function Binary_oMathReader(stream) ...@@ -9316,7 +9317,7 @@ function Binary_oMathReader(stream)
{ {
if(!props.init) if(!props.init)
{ {
oFunc.init(); oFunc.init(props);
oParent.addElementToContent(oFunc); oParent.addElementToContent(oFunc);
props.init = true; props.init = true;
} }
...@@ -9335,7 +9336,7 @@ function Binary_oMathReader(stream) ...@@ -9335,7 +9336,7 @@ function Binary_oMathReader(stream)
{ {
if(!props.init) if(!props.init)
{ {
oFunc.init(); oFunc.init(props);
oParent.addElementToContent(oFunc); oParent.addElementToContent(oFunc);
props.init = true; props.init = true;
} }
...@@ -10056,19 +10057,13 @@ function Binary_oMathReader(stream) ...@@ -10056,19 +10057,13 @@ function Binary_oMathReader(stream)
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
}; };
this.ReadMathMRun = function(type, length, oElem, rPrp, props) this.ReadMathMRun = function(type, length, oMRun, props, oParent)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this; var oThis = this;
if (c_oSer_OMathContentType.MText === type) if (c_oSer_OMathContentType.MText === type)
{ {
var oMRun = new CMathRunPrp();
oMRun.setMathRunPrp(props);
oMRun.setTxtPrp(rPrp);
oElem.addElementToContent(oMRun);
var text = this.stream.GetString2LE(length); var text = this.stream.GetString2LE(length);
var str = ""; var str = "";
for (var i = 0; i < text.length; ++i) for (var i = 0; i < text.length; ++i)
...@@ -10079,17 +10074,12 @@ function Binary_oMathReader(stream) ...@@ -10079,17 +10074,12 @@ function Binary_oMathReader(stream)
if (0x001F < text[i].charCodeAt(0)) if (0x001F < text[i].charCodeAt(0))
{ {
var oText = new CMathText(); var oText = new CMathText();
/*text[i].Replace("&", "&amp;");
text[i].Replace("'", "&apos;");
text[i].Replace("<", "&lt;");
text[i].Replace(">", "&gt;");
text[i].Replace("\"", "&quot;");*/
oText.addTxt(text[i]); oText.addTxt(text[i]);
oElem.addElementToContent(oText); oMRun.Content.splice( i, 0, oText );
} }
} }
} }
oParent.addElementToContent(oMRun);
} }
else if (c_oSer_OMathContentType.MRPr === type) else if (c_oSer_OMathContentType.MRPr === type)
{ {
...@@ -10101,7 +10091,9 @@ function Binary_oMathReader(stream) ...@@ -10101,7 +10091,9 @@ function Binary_oMathReader(stream)
else if (c_oSer_OMathContentType.RPr === type) else if (c_oSer_OMathContentType.RPr === type)
{ {
//<w:rPr> //<w:rPr>
res = this.brPrr.Read(length, rPrp); var rPr = new CTextPr();
res = this.brPrr.Read(length, rPr);
oMRun.Pr = rPr;
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
......
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