Commit 7caab76d 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@53040 954022d7-b5bf-4e40-9824-e11837661b57
parent 7c7b151f
...@@ -7704,6 +7704,100 @@ ParaMath.prototype = ...@@ -7704,6 +7704,100 @@ ParaMath.prototype =
} }
}, },
AddText : function(oElem, sText, props)
{
if(sText)
{
var rPr = new CTextPr();
var oMRun = new CMathRunPrp();
if (props)
oMRun.setMathRunPrp(props);
oMRun.setTxtPrp(rPr);
if (oElem)
{
oElem.addElementToContent(oMRun);
for (var i=0;i<sText.length;i++)
{
/*text[i].replace("&", "&amp;");
text[i].Replace("'", "&apos;");
text[i].Replace("<", "&lt;");
text[i].Replace(">", "&gt;");
text[i].Replace("\"", "&quot;");*/
oText = new CMathText();
oText.addTxt(sText[i]);
oElem.addElementToContent(oText);
}
}
}
},
CreateElem : function (oElem, oParent, props)
{
var ctrPrp = new CTextPr();
oElem.setCtrPrp(ctrPrp);
oElem.init(props);
if (oParent)
oParent.addElementToContent(oElem);
},
CreateFraction : function (oFraction,oParentElem,props,sNumText,sDenText)
{
this.CreateElem(oFraction, oParentElem, props);
var oElemDen = oFraction.getDenominator();
this.AddText(oElemDen, sDenText);
var oElemNum = oFraction.getNumerator();
this.AddText(oElemNum, sNumText);
},
CreateDegree : function (oDegree, oParentElem,props,sBaseText,sSupText,sSubText)
{
this.CreateElem(oDegree, oParentElem, props);
var oElem = oDegree.getBase();
this.AddText(oElem, sBaseText);
var oSup = oDegree.getUpperIterator();
this.AddText(oSup, sSupText);
var oSub = oDegree.getLowerIterator();
this.AddText(oSub, sSubText);
},
CreateRadical : function (oRad,oParentElem,props,sElemText,sDegText)
{
this.CreateElem(oRad, oParentElem, props);
var oElem = oRad.getBase();
this.AddText(oElem, sElemText);
var oDeg = oRad.getDegree();
this.AddText(oDeg, sDegText);
},
CreateNary : function (oNary,oParentElem,props,sElemText,sSubText,sSupText)
{
this.CreateElem(oNary, oParentElem, props);
var oElem = oNary.getBase();
this.AddText(oElem, sElemText);
var oSub = oNary.getLowerIterator();
this.AddText(oSub, sSubText);
var oSup = oNary.getUpperIterator();
this.AddText(oSup, sSupText);
},
CreateBox : function (oBox,oParentElem,props,sElemText)
{
this.CreateElem(oBox, oParentElem, props);
var oElem = oBox.getBase();
this.AddText(oElem, sElemText);
},
Is_Empty : function() Is_Empty : function()
{ {
return this.Math.Is_Empty(); return this.Math.Is_Empty();
......
...@@ -6545,6 +6545,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -6545,6 +6545,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oMathAcc.init(props); oMathAcc.init(props);
oElem.addElementToContent(oMathAcc); oElem.addElementToContent(oMathAcc);
var oElem = oMathAcc.getBase(); var oElem = oMathAcc.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -6823,6 +6825,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -6823,6 +6825,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oBar.init(props); oBar.init(props);
oElem.addElementToContent(oBar); oElem.addElementToContent(oBar);
var oElem = oBar.getBase(); var oElem = oBar.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -6888,6 +6892,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -6888,6 +6892,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oBorderBox.init(props); oBorderBox.init(props);
oElem.addElementToContent(oBorderBox); oElem.addElementToContent(oBorderBox);
var oElem = oBorderBox.getBase(); var oElem = oBorderBox.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -6973,6 +6979,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -6973,6 +6979,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oBox.init(props); oBox.init(props);
oElem.addElementToContent(oBox); oElem.addElementToContent(oBox);
var oElem = oBox.getBase(); var oElem = oBox.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -7135,6 +7143,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7135,6 +7143,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
} }
var lColumn = oDelimiter.column; var lColumn = oDelimiter.column;
var oElem = oDelimiter.getBase(lColumn); var oElem = oDelimiter.getBase(lColumn);
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -7239,6 +7249,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7239,6 +7249,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
} }
var lRow = oEqArr.row; var lRow = oEqArr.row;
var oElem = oEqArr.getElement(lRow); var oElem = oEqArr.getElement(lRow);
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -7326,6 +7338,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7326,6 +7338,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oGroupChr.init(props); oGroupChr.init(props);
oElem.addElementToContent(oGroupChr); oElem.addElementToContent(oGroupChr);
var oElem = oGroupChr.getArgument(); var oElem = oGroupChr.getArgument();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -7397,6 +7411,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7397,6 +7411,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElemDen = oFraction.getDenominator(); var oElemDen = oFraction.getDenominator();
if (length == 0)
oElemDen.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElemDen); return oThis.ReadMathArg(t,l,oElemDen);
}); });
...@@ -7409,6 +7425,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7409,6 +7425,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElemNum = oFraction.getNumerator(); var oElemNum = oFraction.getNumerator();
if (length == 0)
oElemNum.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElemNum); return oThis.ReadMathArg(t,l,oElemNum);
}); });
...@@ -7456,6 +7474,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7456,6 +7474,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oFunc.getArgument(); var oElem = oFunc.getArgument();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -7469,6 +7489,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7469,6 +7489,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oFName = oFunc.getFName(); var oFName = oFunc.getFName();
if (length == 0)
oFName.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oFName); return oThis.ReadMathArg(t,l,oFName);
}); });
...@@ -7577,6 +7599,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7577,6 +7599,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oLimLow.getFName(); var oElem = oLimLow.getFName();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -7590,6 +7614,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7590,6 +7614,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oLim = oLimLow.getIterator(); var oLim = oLimLow.getIterator();
if (length == 0)
oLim.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oLim); return oThis.ReadMathArg(t,l,oLim);
}); });
...@@ -7632,6 +7658,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7632,6 +7658,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oLimUpp.getFName(); var oElem = oLimUpp.getFName();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -7645,6 +7673,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7645,6 +7673,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oLim = oLimUpp.getIterator(); var oLim = oLimUpp.getIterator();
if (length == 0)
oLim.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oLim); return oThis.ReadMathArg(t,l,oLim);
}); });
...@@ -7873,6 +7903,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7873,6 +7903,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
var lRow = oMatrix.row; var lRow = oMatrix.row;
var lColumn = oMatrix.column; var lColumn = oMatrix.column;
var oElem = oMatrix.getElement(lRow,lColumn); var oElem = oMatrix.getElement(lRow,lColumn);
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -8010,6 +8042,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8010,6 +8042,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oSub = oNary.getLowerIterator(); var oSub = oNary.getLowerIterator();
if (length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub); return oThis.ReadMathArg(t,l,oSub);
}); });
...@@ -8023,6 +8057,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8023,6 +8057,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oSup = oNary.getUpperIterator(); var oSup = oNary.getUpperIterator();
if (length == 0)
oSup.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSup); return oThis.ReadMathArg(t,l,oSup);
}); });
...@@ -8036,6 +8072,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8036,6 +8072,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oNary.getBase(); var oElem = oNary.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -8186,6 +8224,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8186,6 +8224,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oPhant.init(props); oPhant.init(props);
oElem.addElementToContent(oPhant); oElem.addElementToContent(oPhant);
var oElem = oPhant.getBase(); var oElem = oPhant.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -8288,6 +8328,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8288,6 +8328,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oDeg = oRad.getDegree(); var oDeg = oRad.getDegree();
if (length == 0)
oDeg.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oDeg); return oThis.ReadMathArg(t,l,oDeg);
}); });
...@@ -8302,6 +8344,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8302,6 +8344,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oRad.getBase(); var oElem = oRad.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -8451,6 +8495,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8451,6 +8495,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oSub = oSPre.getLowerIterator(); var oSub = oSPre.getLowerIterator();
if (length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub); return oThis.ReadMathArg(t,l,oSub);
}); });
...@@ -8464,6 +8510,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8464,6 +8510,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oSup = oSPre.getUpperIterator(); var oSup = oSPre.getUpperIterator();
if (length == 0)
oSup.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSup); return oThis.ReadMathArg(t,l,oSup);
}); });
...@@ -8477,6 +8525,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8477,6 +8525,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oSPre.getBase(); var oElem = oSPre.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -8519,6 +8569,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8519,6 +8569,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oSub = oSSub.getLowerIterator(); var oSub = oSSub.getLowerIterator();
if (length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub); return oThis.ReadMathArg(t,l,oSub);
}); });
...@@ -8532,6 +8584,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8532,6 +8584,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oSSub.getBase(); var oElem = oSSub.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
...@@ -8574,6 +8628,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8574,6 +8628,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oSub = oSSubSup.getLowerIterator(); var oSub = oSSubSup.getLowerIterator();
if (length == 0)
oSub.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSub); return oThis.ReadMathArg(t,l,oSub);
}); });
...@@ -8647,6 +8703,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8647,6 +8703,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oSup = oSSup.getUpperIterator(); var oSup = oSSup.getUpperIterator();
if (length == 0)
oESup.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oSup); return oThis.ReadMathArg(t,l,oSup);
}); });
...@@ -8660,6 +8718,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8660,6 +8718,8 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
props.init = true; props.init = true;
} }
var oElem = oSSup.getBase(); var oElem = oSSup.getBase();
if (length == 0)
oElem.fillPlaceholders();
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.ReadMathArg(t,l,oElem); return oThis.ReadMathArg(t,l,oElem);
}); });
......
...@@ -550,7 +550,7 @@ CSign.prototype.setSign = function(props) ...@@ -550,7 +550,7 @@ CSign.prototype.setSign = function(props)
else else
{ {
this.type = ACCENT_TEXT; this.type = ACCENT_TEXT;
this.sign.add(sign.code); this.sign.add(props.code);
} }
} }
CSign.prototype.setPosition = function(pos) CSign.prototype.setPosition = function(pos)
......
...@@ -670,9 +670,6 @@ CMathContent.prototype = ...@@ -670,9 +670,6 @@ CMathContent.prototype =
pos++; pos++;
this.CurPos = pos; this.CurPos = pos;
//History.Add(this.Composition.CurrentContent, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: EndPos});
return middleContent; return middleContent;
}, },
setComposition: function(Composition) setComposition: function(Composition)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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