Commit a1df4cd1 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлены баги в совместном редкатировании классов CDegreeSubSup, CLimit, CMathFunc.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58690 954022d7-b5bf-4e40-9824-e11837661b57
parent 2f8d8ef2
......@@ -641,13 +641,6 @@ CAccent.prototype.setProperties = function(props)
this.RecalcInfo.bProps = true;
}
CAccent.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.init(props);
// Base
this.elements[0][0] = contents[0];
}
CAccent.prototype.Save_Changes = function(Data, Writer)
{
Writer.WriteLong( historyitem_type_acc );
......
......@@ -332,16 +332,21 @@ CDegree.prototype.Get_Id = function()
function CIterators()
{
CIterators.superclass.constructor.call(this);
this.lUp = 0; // центр основания
this.lD = 0; // высота - центр основания
this.upper = 0; // смещение сверху для позиции основания
CMathBase.call(this, true);
this.iterUp = new CMathContent();
this.iterDn = new CMathContent();
}
Asc.extendClass(CIterators, CMathBase);
CIterators.prototype.init = function()
{
this.setDimension(2, 1);
this.setContent();
this.elements[0][0] = this.iterUp;
this.elements[1][0] = this.iterDn;
};
CIterators.prototype.old_old_setDistanceIters = function(oMeasure)
{
......@@ -468,11 +473,6 @@ CIterators.prototype.Get_CompiledCtrPrp = function()
{
return this.Parent.Get_CompiledCtrPrp();
};
CIterators.prototype.fillMathComposition = function(upperIterator, lowerIterator)
{
this.elements[0][0] = upperIterator;
this.elements[1][0] = lowerIterator;
};
CIterators.prototype.alignIterators = function(mcJc)
{
this.alignment.wdt[0] = mcJc;
......@@ -481,6 +481,8 @@ CIterators.prototype.alignIterators = function(mcJc)
function CDegreeSubSup(props, bInside)
{
CDegreeSubSup.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_DEGREESubSup;
......@@ -492,11 +494,12 @@ function CDegreeSubSup(props, bInside)
alnScr: false
};
this.baseContent = new CMathContent();
this.iters = new CIterators();
//this.type = DEGREE_SubSup;
//this.alnScr = false; // не выровнены, итераторы идут в соответствии с наклоном буквы/мат. объекта
CMathBase.call(this, bInside);
if(props !== null && typeof(props) !== "undefined")
this.init(props);
......@@ -510,15 +513,14 @@ CDegreeSubSup.prototype.init = function(props)
};
CDegreeSubSup.prototype.fillContent = function()
{
var oBase = new CMathContent();
var oBase = this.baseContent;
var oIters = this.iters;
this.setDimension(1, 2);
var oIters = new CIterators();
oIters.init();
//oIters.decreaseArgSize();
oIters.lUp = 0;
oIters.lD = 0;
......@@ -999,28 +1001,6 @@ CDegreeSubSup.prototype.setProperties = function(props)
this.RecalcInfo.bProps = true;
};
CDegreeSubSup.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
if(this.Pr.type == DEGREE_SubSup)
{
// Base
this.elements[0][0] = contents[0];
// Iterators
this.elements[0][1].fillMathComposition(contents[1]/*upper iterator*/, contents[2]/*lower iterator*/);
}
else
{
// Base
this.elements[0][1] = contents[0];
// Iterators
this.elements[0][0].fillMathComposition(contents[1]/*upper iterator*/, contents[2]/*lower iterator*/);
}
};
CDegreeSubSup.prototype.getPropsForWrite = function()
{
return this.Pr;
......@@ -1038,9 +1018,10 @@ CDegreeSubSup.prototype.Refresh_RecalcData = function(Data)
CDegreeSubSup.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_deg_subsup );
Writer.WriteString2( this.getBase().Id );
Writer.WriteString2( this.getUpperIterator().Id );
Writer.WriteString2( this.getLowerIterator().Id );
Writer.WriteString2(this.Id);
Writer.WriteString2(this.baseContent.Id);
Writer.WriteString2(this.iters.iterDn.Id);
Writer.WriteString2(this.iters.iterUp.Id);
this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong( this.Pr.type );
......@@ -1062,13 +1043,13 @@ CDegreeSubSup.prototype.Write_ToBinary2 = function( Writer )
};
CDegreeSubSup.prototype.Read_FromBinary2 = function( Reader )
{
this.Id = Reader.GetString2();
this.baseContent = g_oTableId.Get_ById(Reader.GetString2());
this.iters.iterDn = g_oTableId.Get_ById(Reader.GetString2());
this.iters.iterUp = g_oTableId.Get_ById(Reader.GetString2());
var props = {ctrPrp: new CTextPr()};
var arrElems = [];
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
props.type = Reader.GetLong();
if ( props.type == DEGREE_SubSup )
......@@ -1077,7 +1058,9 @@ CDegreeSubSup.prototype.Read_FromBinary2 = function( Reader )
if ( Flags & 1 )
props.alnScr = Reader.GetBool();
}
this.fillMathComposition (props, arrElems);
this.init(props);
this.iters.init();
};
CDegreeSubSup.prototype.Get_Id = function()
{
......
......@@ -488,10 +488,6 @@ CFractionBase.prototype.Get_Id = function()
{
return this.elements[0][0].Get_Id();
};
CFractionBase.prototype.fillMathComposition = function(content)
{
this.elements[0][0] = content;
}
function CNumerator()
{
......
......@@ -2,11 +2,13 @@
function CLimit(props)
{
CLimit.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_LIMIT;
this.ContentFName = new CMathContent();
this.ContentFName = new CMathContent();
this.ContentIterator = new CMathContent();
this.Pr =
......@@ -14,8 +16,6 @@ function CLimit(props)
type: LIMIT_LOW
};
CMathBase.call(this);
if(props !== null && typeof(props) !== "undefined")
this.init(props);
......@@ -44,18 +44,6 @@ CLimit.prototype.setProperties = function(props)
this.setCtrPrp(props.ctrPrp);
}
CLimit.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.FName = null;
this.Iterator = null;
this.ContentFName = contents[0];
this.ContentIterator = contents[1];
this.RecalcInfo.bProps = true;
}
CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
......@@ -186,24 +174,24 @@ CLimit.prototype.Refresh_RecalcData = function(Data)
CLimit.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_lim );
Writer.WriteString2( this.getFName().Id );
Writer.WriteString2( this.getIterator().Id );
Writer.WriteString2(this.Id);
Writer.WriteString2(this.getFName().Id);
Writer.WriteString2(this.getIterator().Id);
this.CtrPrp.Write_ToBinary(Writer);
Writer.WriteLong(this.Pr.type);
}
CLimit.prototype.Read_FromBinary2 = function( Reader )
{
{
this.Id = Reader.GetString2();
this.ContentFName = g_oTableId.Get_ById(Reader.GetString2());
this.ContentIterator = g_oTableId.Get_ById(Reader.GetString2());
var props = {ctrPrp: new CTextPr()};
var arrElems = [];
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
props.type = Reader.GetLong();
this.fillMathComposition (props, arrElems);
this.init(props);
}
CLimit.prototype.Get_Id = function()
{
......@@ -212,12 +200,15 @@ CLimit.prototype.Get_Id = function()
function CMathFunc(props)
{
CMathFunc.superclass.constructor.call(this);
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_FUNCTION;
this.Pr = {};
CMathBase.call(this);
this.fnameContent = new CMathContent();
this.argumentContent = new CMathContent();
if(props !== null && typeof(props) !== "undefined")
this.init(props);
......@@ -258,19 +249,8 @@ CMathFunc.prototype.setProperties = function(props)
CMathFunc.prototype.fillContent = function()
{
this.setDimension(1, 2);
this.setContent();
}
CMathFunc.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
// FName
this.elements[0][0] = contents[0];
// Argument
this.elements[0][1] = contents[1];
this.elements[0][0] = this.fnameContent;
this.elements[0][1] = this.argumentContent;
}
CMathFunc.prototype.getPropsForWrite = function()
{
......@@ -289,22 +269,22 @@ CMathFunc.prototype.Refresh_RecalcData = function(Data)
CMathFunc.prototype.Write_ToBinary2 = function( Writer )
{
Writer.WriteLong( historyitem_type_mathFunc );
Writer.WriteString2( this.getFName().Id );
Writer.WriteString2( this.getArgument().Id );
Writer.WriteString2(this.Id);
Writer.WriteString2(this.fnameContent.Id);
Writer.WriteString2(this.argumentContent.Id);
this.CtrPrp.Write_ToBinary(Writer);
}
CMathFunc.prototype.Read_FromBinary2 = function( Reader )
{
this.Id = Reader.GetString2();
this.fnameContent = g_oTableId.Get_ById(Reader.GetString2());
this.argumentContent = g_oTableId.Get_ById(Reader.GetString2());
var props = {ctrPrp: new CTextPr()};
var arrElems = [];
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
arrElems.push(g_oTableId.Get_ById( Reader.GetString2()));
props.ctrPrp.Read_FromBinary(Reader);
this.fillMathComposition (props, arrElems);
this.init(props);
}
CMathFunc.prototype.Get_Id = function()
{
......
......@@ -17,14 +17,6 @@ var DIV_CENT = 0.1386;
var StartTextElement = 0x2B1A; // Cambria Math
// смена хентов
// editor.SetFontRenderingMode(2);
//change FontSize
//editor.put_TextPrFontSize(parseInt("37"));
function CMathSize()
{
this.width = 0;
......
......@@ -197,14 +197,4 @@ var STY_BI = 1;
var STY_ITALIC = 2;
var STY_PLAIN = 3;
/////////////////////////////////////////
var extend = function(Child, Parent)
{
var F = function() { };
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.superclass = Parent.prototype;
}
/////////////////////////////////////////
\ No newline at end of file
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