Commit 7a2d333c authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Прокинула ctrPrp в конструктур для мат объектов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56087 954022d7-b5bf-4e40-9824-e11837661b57
parent 8ae1c698
...@@ -155,6 +155,7 @@ ParaMath.prototype = ...@@ -155,6 +155,7 @@ ParaMath.prototype =
var oMRun = new ParaRun(null, true); var oMRun = new ParaRun(null, true);
oMRun.Pr = oStartContent.Pr; oMRun.Pr = oStartContent.Pr;
for (i=nPosStart; i<nLenStart; i++) for (i=nPosStart; i<nLenStart; i++)
{ {
var Pos = oMRun.Content.length; var Pos = oMRun.Content.length;
...@@ -288,10 +289,25 @@ ParaMath.prototype = ...@@ -288,10 +289,25 @@ ParaMath.prototype =
return this.RemoveElem(oContent, Direction, bOnAddText); return this.RemoveElem(oContent, Direction, bOnAddText);
}, },
RemoveElem: function(oContent, nCount, bOnAdd) RemoveElem: function(oContent, Direction, bOnAdd)
{
var start = oContent.Start,
end = oContent.End,
oMathContent = oContent.Content;
if(start == end)
{
var elem = oMathContent.content[start];
if(elem.typeObj == MATH_PARA_RUN && elem.Is_Empty())
{ {
}
}
History.Create_NewPoint(); History.Create_NewPoint();
var oStartContent = oContent.Content.content[oContent.Start]; var oStartContent = oContent.Content.content[oContent.Start];
var oEndContent = oContent.Content.content[oContent.End]; var oEndContent = oContent.Content.content[oContent.End];
var Items = new Array(); var Items = new Array();
...@@ -302,6 +318,14 @@ ParaMath.prototype = ...@@ -302,6 +318,14 @@ ParaMath.prototype =
} }
History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: oContent.Start}); History.Add(oContent.Content, {Type: historyitem_Math_RemoveItem, Items:Items, Pos: oContent.Start});
return; return;
},
SetSelectionForRemove: function(Content, pos)
{
this.bSelectionUse = true;
}, },
GetSelectContent: function() GetSelectContent: function()
...@@ -324,8 +348,6 @@ ParaMath.prototype = ...@@ -324,8 +348,6 @@ ParaMath.prototype =
{ {
// TODO: ParaMath.Apply_TextPr // TODO: ParaMath.Apply_TextPr
}, },
Clear_TextPr : function() Clear_TextPr : function()
...@@ -1287,7 +1309,6 @@ ParaMath.prototype = ...@@ -1287,7 +1309,6 @@ ParaMath.prototype =
// TODO: ParaMath.Set_SelectionContentPos // TODO: ParaMath.Set_SelectionContentPos
this.Root.Set_SelectionContentPos(StartContentPos, EndContentPos, Depth, StartFlag, EndFlag); this.Root.Set_SelectionContentPos(StartContentPos, EndContentPos, Depth, StartFlag, EndFlag);
this.bSelectionUse = true; this.bSelectionUse = true;
}, },
......
...@@ -1013,6 +1013,7 @@ function CAccent(props) ...@@ -1013,6 +1013,7 @@ function CAccent(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CAccent, CMathBase); extend(CAccent, CMathBase);
CAccent.prototype.init = function(props) CAccent.prototype.init = function(props)
......
...@@ -1600,7 +1600,7 @@ CMathBase.prototype = ...@@ -1600,7 +1600,7 @@ CMathBase.prototype =
start_y++; start_y++;
if(start_x >= this.nCol) if(start_y >= this.nCol)
{ {
start_x++; start_x++;
start_y = 0; start_y = 0;
...@@ -1622,6 +1622,10 @@ CMathBase.prototype = ...@@ -1622,6 +1622,10 @@ CMathBase.prototype =
} }
return TextPr; return TextPr;
},
Get_CompiledPr: function(Copy)
{
return this.Get_CompiledTextPr(Copy);
} }
////////////////////////// //////////////////////////
......
...@@ -30,6 +30,7 @@ function CBorderBox(props) ...@@ -30,6 +30,7 @@ function CBorderBox(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CBorderBox, CMathBase); extend(CBorderBox, CMathBase);
CBorderBox.prototype.init = function(props) CBorderBox.prototype.init = function(props)
...@@ -315,6 +316,7 @@ function CBox(props) ...@@ -315,6 +316,7 @@ function CBox(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CBox, CMathBase); extend(CBox, CMathBase);
CBox.prototype.init = function(props) CBox.prototype.init = function(props)
...@@ -371,6 +373,7 @@ function CBar(props) ...@@ -371,6 +373,7 @@ function CBar(props)
CCharacter.call(this); CCharacter.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CBar, CCharacter); extend(CBar, CCharacter);
CBar.prototype.init = function(props) CBar.prototype.init = function(props)
...@@ -434,6 +437,7 @@ function CPhantom(props) ...@@ -434,6 +437,7 @@ function CPhantom(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CPhantom, CMathBase); extend(CPhantom, CMathBase);
CPhantom.prototype.init = function(props) CPhantom.prototype.init = function(props)
......
...@@ -10,6 +10,7 @@ function CDegree(props) ...@@ -10,6 +10,7 @@ function CDegree(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CDegree, CMathBase); extend(CDegree, CMathBase);
CDegree.prototype.init = function(props) CDegree.prototype.init = function(props)
...@@ -625,6 +626,7 @@ function CDegreeSubSup(props) ...@@ -625,6 +626,7 @@ function CDegreeSubSup(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CDegreeSubSup, CMathBase); extend(CDegreeSubSup, CMathBase);
CDegreeSubSup.prototype.init = function(props) CDegreeSubSup.prototype.init = function(props)
......
...@@ -8,6 +8,7 @@ function CFraction(props) ...@@ -8,6 +8,7 @@ function CFraction(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CFraction, CMathBase); extend(CFraction, CMathBase);
CFraction.prototype.init = function(props) CFraction.prototype.init = function(props)
......
...@@ -6,6 +6,7 @@ function CLimit(props) ...@@ -6,6 +6,7 @@ function CLimit(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CLimit, CMathBase); extend(CLimit, CMathBase);
CLimit.prototype.init = function(props) CLimit.prototype.init = function(props)
...@@ -72,10 +73,13 @@ CLimit.prototype.getPropsForWrite = function() ...@@ -72,10 +73,13 @@ CLimit.prototype.getPropsForWrite = function()
return props; return props;
} }
function CMathFunc() function CMathFunc(props)
{ {
this.kind = MATH_FUNCTION; this.kind = MATH_FUNCTION;
CMathBase.call(this); CMathBase.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CMathFunc, CMathBase); extend(CMathFunc, CMathBase);
CMathFunc.prototype.init = function() CMathFunc.prototype.init = function()
......
...@@ -6263,8 +6263,9 @@ CMathContent.prototype = ...@@ -6263,8 +6263,9 @@ CMathContent.prototype =
for ( var CurPos = StartPos; CurPos <= EndPos; CurPos++ ) for ( var CurPos = StartPos; CurPos <= EndPos; CurPos++ )
{ {
var CurTextPr = this.content[CurPos].Get_CompiledPr(false); var CurTextPr;
CurTextPr = this.content[CurPos].Get_CompiledPr(false);
if ( null !== CurTextPr ) if ( null !== CurTextPr )
TextPr = TextPr.Compare( CurTextPr ); TextPr = TextPr.Compare( CurTextPr );
} }
......
...@@ -39,6 +39,7 @@ function CMathMatrix(props) ...@@ -39,6 +39,7 @@ function CMathMatrix(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CMathMatrix, CMathBase); extend(CMathMatrix, CMathBase);
CMathMatrix.prototype.init = function(props) CMathMatrix.prototype.init = function(props)
...@@ -501,7 +502,7 @@ CMathMatrix.prototype.getPropsForWrite = function() ...@@ -501,7 +502,7 @@ CMathMatrix.prototype.getPropsForWrite = function()
} }
//// ////
function CEqArray() function CEqArray(props)
{ {
this.kind = MATH_EQ_ARRAY; this.kind = MATH_EQ_ARRAY;
...@@ -509,6 +510,9 @@ function CEqArray() ...@@ -509,6 +510,9 @@ function CEqArray()
this.objDist = 0; this.objDist = 0;
CMathMatrix.call(this); CMathMatrix.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CEqArray, CMathMatrix); extend(CEqArray, CMathMatrix);
CEqArray.prototype.init = function(props) CEqArray.prototype.init = function(props)
......
...@@ -23,6 +23,7 @@ function CNary(props) ...@@ -23,6 +23,7 @@ function CNary(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CNary, CMathBase); extend(CNary, CMathBase);
CNary.prototype.init = function(props) CNary.prototype.init = function(props)
...@@ -186,23 +187,19 @@ CNary.prototype.init = function(props) ...@@ -186,23 +187,19 @@ CNary.prototype.init = function(props)
{ {
if( this.supHide && !this.subHide ) if( this.supHide && !this.subHide )
{ {
base = new CDegree();
var prp = {type: DEGREE_SUBSCRIPT, indef: 2, oBase: sign}; var prp = {type: DEGREE_SUBSCRIPT, indef: 2, oBase: sign};
//base.init_2(prp, sign); base = new CDegree(prp);
} }
else if( !this.supHide && this.subHide ) else if( !this.supHide && this.subHide )
{ {
base = new CDegree();
var prp = {type: DEGREE_SUPERSCRIPT, indef: 2, oBase: sign}; var prp = {type: DEGREE_SUPERSCRIPT, indef: 2, oBase: sign};
//base.init_2(prp, sign); base = new CDegree(prp);
} }
else else
{ {
base = new CDegreeSubSup();
var prp = {type: DEGREE_SubSup, indef: 2, oBase: sign}; var prp = {type: DEGREE_SubSup, indef: 2, oBase: sign};
//base.init_2(prp, sign); base = new CDegreeSubSup(prp);
} }
} }
if(!this.supHide || !this.subHide) if(!this.supHide || !this.subHide)
......
...@@ -3305,6 +3305,7 @@ function CDelimiter(props) ...@@ -3305,6 +3305,7 @@ function CDelimiter(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CDelimiter, CMathBase); extend(CDelimiter, CMathBase);
CDelimiter.prototype.init = function(props) CDelimiter.prototype.init = function(props)
...@@ -4114,7 +4115,7 @@ CCharacter.prototype.getBase = function() ...@@ -4114,7 +4115,7 @@ CCharacter.prototype.getBase = function()
function CGroupCharacter() function CGroupCharacter(props)
{ {
this.kind = MATH_GROUP_CHARACTER; this.kind = MATH_GROUP_CHARACTER;
...@@ -4122,6 +4123,9 @@ function CGroupCharacter() ...@@ -4122,6 +4123,9 @@ function CGroupCharacter()
this.loc = LOCATION_BOT; this.loc = LOCATION_BOT;
CCharacter.call(this); CCharacter.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CGroupCharacter, CCharacter); extend(CGroupCharacter, CCharacter);
CGroupCharacter.prototype.init = function(props) CGroupCharacter.prototype.init = function(props)
......
...@@ -895,6 +895,7 @@ function CRadical(props) ...@@ -895,6 +895,7 @@ function CRadical(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
} }
extend(CRadical, CMathBase); extend(CRadical, CMathBase);
CRadical.prototype.init = function(props) CRadical.prototype.init = function(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