Commit d7970b89 authored by Anna.Pavlova's avatar Anna.Pavlova

рефакторинг

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61061 954022d7-b5bf-4e40-9824-e11837661b57
parent 54682b13
......@@ -211,10 +211,9 @@ function ParaMath()
this.X = 0;
this.Y = 0;
this.LinesPositions = [];
this.FirstPage = 0;
this.LinesWidths = []; // в тч для отрисовки рамки
this.LinesPositions = [];
this.CurPageInfo =
{
......@@ -226,7 +225,6 @@ function ParaMath()
this.ParaMathRPI = new CMathRecalculateInfo();
this.bSelectionUse = false;
this.RecalcJustify = true;
this.Paragraph = null;
this.State = ALIGN_MARGIN_WRAP;
......
......@@ -21,7 +21,7 @@ function CMathBase(bInside)
this.nRow = 0;
this.nCol = 0;
this.bInside = bInside === true ? true: false;
this.bInside = bInside === true;
this.bMath_OneLine = true;
this.elements = [];
......@@ -58,21 +58,17 @@ function CMathBase(bInside)
return this;
}
CMathBase.prototype =
CMathBase.prototype.setContent = function()
{
constructor: CMathBase,
setContent: function()
{
for(var i=0; i < this.nRow; i++)
{
this.elements[i] = [];
for(var j = 0; j < this.nCol; j++)
this.elements[i][j] = new CMathContent();
}
},
setDimension: function(countRow, countCol)
{
};
CMathBase.prototype.setDimension = function(countRow, countCol)
{
this.nRow = countRow;
this.nCol = countCol;
......@@ -90,17 +86,17 @@ CMathBase.prototype =
this.alignment.hgt[j] = MCJC_CENTER;
}
},
///////// RunPrp, CtrPrp
setCtrPrp: function(txtPrp) // выставляем ctrPrp на чтение
{
};
///////// RunPrp, CtrPrp
CMathBase.prototype.setCtrPrp = function(txtPrp) // выставляем ctrPrp на чтение
{
if(txtPrp !== null && typeof(txtPrp) !== "undefined")
{
this.CtrPrp.Merge(txtPrp);
}
},
Get_CtrPrp: function()
{
};
CMathBase.prototype.Get_CtrPrp = function()
{
var CtrPrp;
if(this.bInside === true)
CtrPrp = this.Parent.Get_CtrPrp();
......@@ -108,9 +104,9 @@ CMathBase.prototype =
CtrPrp = this.CtrPrp.Copy();
return CtrPrp;
},
Get_CompiledCtrPrp: function(bAllowInline)
{
};
CMathBase.prototype.Get_CompiledCtrPrp = function(bAllowInline)
{
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
var CompiledCtrPrp;
......@@ -131,9 +127,9 @@ CMathBase.prototype =
CompiledCtrPrp.FontSize *= MatGetKoeffArgSize(CompiledCtrPrp.FontSize, this.ArgSize.value);// для настроек inline формул
return CompiledCtrPrp;
},
Get_CompiledCtrPrp_2: function() // without arg Size
{
};
CMathBase.prototype.Get_CompiledCtrPrp_2 = function() // without arg Size
{
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
var CompiledCtrPrp;
......@@ -144,26 +140,26 @@ CMathBase.prototype =
CompiledCtrPrp = this.CompiledCtrPrp.Copy();
return CompiledCtrPrp;
},
Get_CompiledArgSize: function()
{
};
CMathBase.prototype.Get_CompiledArgSize = function()
{
return this.Parent.Get_CompiledArgSize();
},
Get_TxtPrControlLetter: function(RPI) // TextPrControlLetter не копируются !
{
};
CMathBase.prototype.Get_TxtPrControlLetter = function(RPI) // TextPrControlLetter не копируются !
{
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath, RPI);
return this.TextPrControlLetter;
},
fillPlaceholders: function()
{
};
CMathBase.prototype.fillPlaceholders = function()
{
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].fillPlaceholders();
},
addMCToContent: function(elements)
{
};
CMathBase.prototype.addMCToContent = function(elements)
{
if(elements.length == this.nRow*this.nCol)
{
this.elements.length = 0;
......@@ -176,22 +172,22 @@ CMathBase.prototype =
}
else
this.setContent();
},
// эта функция здесь необходима для случая с n-арными операторами : когда передаем n-арный оператор с итераторами и аргумент
IsJustDraw: function()
{
};
// эта функция здесь необходима для случая с n-арными операторами : когда передаем n-арный оператор с итераторами и аргумент
CMathBase.prototype.IsJustDraw = function()
{
return false;
},
IsAccent: function()
{
};
CMathBase.prototype.IsAccent = function()
{
return false;
},
IsEqArray: function()
{
};
CMathBase.prototype.IsEqArray = function()
{
return false;
},
getWidthsHeights: function()
{
};
CMathBase.prototype.getWidthsHeights = function()
{
var Widths = [];
for(var tt = 0; tt < this.nCol; tt++ )
Widths[tt] = 0;
......@@ -221,9 +217,9 @@ CMathBase.prototype =
}
return { widths: Widths, heights: Heights };
},
align: function(pos_x, pos_y)
{
};
CMathBase.prototype.align = function(pos_x, pos_y)
{
var PosAlign = new CMathPosition();
if(this.alignment.hgt[pos_x] == MCJC_CENTER)
......@@ -279,9 +275,9 @@ CMathBase.prototype =
}
return PosAlign;
},
setPosition: function(pos, PDSE)
{
};
CMathBase.prototype.setPosition = function(pos, PDSE)
{
this.pos.x = pos.x;
if(this.bInside === true)
......@@ -317,9 +313,9 @@ CMathBase.prototype =
pos.x += this.size.width;
},
old_setPosition: function(pos)
{
};
CMathBase.prototype.old_setPosition = function(pos)
{
this.pos.x = pos.x;
if(this.bInside === true)
......@@ -347,9 +343,9 @@ CMathBase.prototype =
}
h += Heights[i];
}
},
draw: function(x, y, pGraphics, PDSE)
{
};
CMathBase.prototype.draw = function(x, y, pGraphics, PDSE)
{
this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp()); // для Just-Draw элементов
for(var i=0; i < this.nRow; i++)
......@@ -372,9 +368,9 @@ CMathBase.prototype =
this.elements[i][j].draw(x, y, pGraphics, PDSE);
}
},
Draw_Elements: function(PDSE)
{
};
CMathBase.prototype.Draw_Elements = function(PDSE)
{
var X = PDSE.X;
this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp()); // для Just-Draw элементов
......@@ -403,15 +399,15 @@ CMathBase.prototype =
}
PDSE.X = X + this.size.width;
},
remove: function(order)
{
};
CMathBase.prototype.remove = function(order)
{
return this.Parent.remove(order);
},
ApplyProperties: function(RPI)
{},
PreRecalc: function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
};
CMathBase.prototype.ApplyProperties = function(RPI)
{};
CMathBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
......@@ -427,9 +423,9 @@ CMathBase.prototype =
for(var j = 0; j < this.nCol; j++)
this.elements[i][j].PreRecalc(this, ParaMath, ArgSize, RPI);
},
recalculateSize: function(oMeasure, RPI)
{
};
CMathBase.prototype.recalculateSize = function(oMeasure, RPI)
{
var width = 0;
var height = 0;
......@@ -453,9 +449,9 @@ CMathBase.prototype =
var ascent = this.getAscent(oMeasure, height);
this.size = {width: width, height: height, ascent: ascent};
},
Resize: function(oMeasure, RPI)
{
}
CMathBase.prototype.Resize = function(oMeasure, RPI)
{
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
{
......@@ -479,16 +475,16 @@ CMathBase.prototype =
this.recalculateSize(oMeasure, RPI);
},
Resize_2: function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
};
CMathBase.prototype.Resize_2 = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].Resize_2(oMeasure, this, ParaMath, RPI, ArgSize);
},
Set_CompiledCtrPrp: function(Parent, ParaMath, RPI)
{
};
CMathBase.prototype.Set_CompiledCtrPrp = function(Parent, ParaMath, RPI)
{
if(this.RecalcInfo.bCtrPrp == true || (RPI !== null && RPI !== undefined && RPI.bRecalcCtrPrp == true))
{
if (undefined === ParaMath || null === ParaMath)
......@@ -548,9 +544,9 @@ CMathBase.prototype =
this.RecalcInfo.bCtrPrp = false;
}
},
getAscent: function(oMeasure, _height)
{
};
CMathBase.prototype.getAscent = function(oMeasure, _height)
{
var Ascent = 0;
if(this.nRow > 1)
{
......@@ -564,43 +560,43 @@ CMathBase.prototype =
Ascent = (this.elements[0][i].size.ascent > Ascent) ? this.elements[0][i].size.ascent : Ascent;
return Ascent;
},
alignHor: function(pos, coeff)
{
};
CMathBase.prototype.alignHor = function(pos, coeff)
{
if(pos!=-1)
this.alignment.wdt[pos] = coeff;
else
for(var j = 0; j< this.alignment.wdt.length; j++)
this.alignment.wdt[j] = coeff;
},
alignVer: function(pos, coeff)
{
}
CMathBase.prototype.alignVer = function(pos, coeff)
{
if(pos!=-1)
this.alignment.hgt[pos] = coeff;
else
for(var j = 0; j < this.alignment.hgt.length; j++)
this.alignment.hgt[j] = coeff;
},
setDistance: function()
{
};
CMathBase.prototype.setDistance = function()
{
},
hidePlaceholder: function(flag)
{
};
CMathBase.prototype.hidePlaceholder = function(flag)
{
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
{
if( this.elements[i][j].IsJustDraw() == false )
this.elements[i][j].hidePlaceholder(flag);
}
},
getElement: function(x, y)
{
};
CMathBase.prototype.getElement = function(x, y)
{
return this.elements[x][y];
},
IsOneLineText: function() // for degree
{
};
CMathBase.prototype.IsOneLineText = function() // for degree
{
var bOneLineText = true;
if(this.nRow == 1)
{
......@@ -618,11 +614,10 @@ CMathBase.prototype =
return bOneLineText;
},
//// For Edit /////
getGapsInside: function(GapsInfo)
{
};
//// For Edit /////
CMathBase.prototype.getGapsInside = function(GapsInfo)
{
var kind = this.kind;
var gaps = {left: 0, right: 0};
var checkBase = kind == MATH_DEGREE || kind == MATH_DEGREESubSup || kind == MATH_ACCENT || kind == MATH_RADICAL || kind == MATH_LIMIT || kind == MATH_BORDER_BOX || (kind == MATH_DELIMITER && this.Pr.grow == true);
......@@ -634,9 +629,9 @@ CMathBase.prototype =
}
return gaps;
},
SetGaps: function(GapsInfo)
{
};
CMathBase.prototype.SetGaps = function(GapsInfo)
{
//this.Parent = GapsInfo.Parent;
//this.ParaMath = GapsInfo.ParaMath;
......@@ -649,69 +644,29 @@ CMathBase.prototype =
GapsInfo.setGaps();
},
};
//////////////////////////////////
IsPlaceholder: function()
{
//////////////////////////////////
CMathBase.prototype.IsPlaceholder = function()
{
return false;
},
IsText: function()
{
};
CMathBase.prototype.IsText = function()
{
return false;
},
GetParent: function()
{
};
CMathBase.prototype.GetParent = function()
{
return (this.Parent.Type !== para_Math_Composition ? this : this.Parent.GetParent());
},
Get_TextPr: function(ContentPos, Depth)
{
};
CMathBase.prototype.Get_TextPr = function(ContentPos, Depth)
{
var pos = ContentPos.Get(Depth);
return this.Content[pos].Get_TextPr(ContentPos, Depth+1);
},
Get_CompiledTextPr_11100 : function(Copy)
{
var start_x = 0,
start_y = 0;
var TextPr = null;
while(start_x < this.nRow && start_y < this.nCol && (TextPr == null || this.elements[start_x][start_y].IsJustDraw() ))
{
if(!this.elements[start_x][start_y].IsJustDraw())
{
TextPr = this.elements[start_x][start_y].Get_CompiledTextPr(Copy, true);
break;
}
start_y++;
if(start_y == this.nCol)
{
start_x++;
start_y = 0;
}
}
for(var i=start_y; i < this.nRow; i++)
{
for(var j = start_x; j < this.nCol; j++)
{
if(!this.elements[i][j].IsJustDraw())
{
var CurTextPr = this.elements[i][j].Get_CompiledTextPr(true, true);
if ( null !== CurTextPr )
TextPr = TextPr.Compare( CurTextPr );
}
}
}
return TextPr;
},
Get_CompiledTextPr : function(Copy)
{
};
CMathBase.prototype.Get_CompiledTextPr = function(Copy)
{
var TextPr = this.Content[0].Get_CompiledTextPr(true, true);
for(var i = 1; i < this.Content.length; i++)
......@@ -723,13 +678,13 @@ CMathBase.prototype =
}
return TextPr;
},
Get_CompiledPr: function(Copy)
{
};
CMathBase.prototype.Get_CompiledPr = function(Copy)
{
return this.Get_CompiledTextPr(Copy);
},
Apply_TextPr: function(TextPr, IncFontSize, ApplyToAll)
{
};
CMathBase.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
{
if(ApplyToAll == true)
this.RecalcInfo.bCtrPrp = true;
......@@ -801,166 +756,166 @@ CMathBase.prototype =
}
}
},
GetMathTextPrForMenu: function(ContentPos, Depth)
{
};
CMathBase.prototype.GetMathTextPrForMenu = function(ContentPos, Depth)
{
var pos = ContentPos.Get(Depth);
return this.Content[pos].GetMathTextPrForMenu(ContentPos, Depth+1);
},
Set_MathTextPr2: function(TextPr, MathPr, bAll)
{
};
CMathBase.prototype.Set_MathTextPr2 = function(TextPr, MathPr, bAll)
{
this.Set_FontSizeCtrPrp(TextPr.FontSize);
for(var i = 0; i < this.Content.length; i++)
this.Content[i].Set_MathTextPr2(TextPr, MathPr, bAll);
},
Set_FontSizeCtrPrp: function(Value)
{
};
CMathBase.prototype.Set_FontSizeCtrPrp = function(Value)
{
if ( Value !== this.CtrPrp.FontSize )
{
History.Add(this, new CChangesMathFontSize(Value, this.CtrPrp.FontSize));
this.raw_SetFontSize(Value);
}
},
Set_Color: function(Value)
{
};
CMathBase.prototype.Set_Color = function(Value)
{
if ( ( undefined === Value && undefined !== this.CtrPrp.Color ) || ( Value instanceof CDocumentColor && ( undefined === this.CtrPrp.Color || false === Value.Compare(this.CtrPrp.Color) ) ) )
{
History.Add( this, new CChangesMathColor(Value, this.CtrPrp.Color));
this.raw_SetColor(Value);
}
},
Set_Unifill: function(Value)
{
};
CMathBase.prototype.Set_Unifill = function(Value)
{
if ( ( undefined === Value && undefined !== this.CtrPrp.Unifill ) || ( Value instanceof CUniFill && ( undefined === this.CtrPrp.Unifill || false === CompareUnifillBool(this.CtrPrp.Unifill, Value) ) ) )
{
History.Add(this, new CChangesMathUnifill(Value, this.CtrPrp.Unifill));
this.raw_SetUnifill(Value);
}
},
Set_Shd: function(Shd)
{
};
CMathBase.prototype.Set_Shd = function(Shd)
{
if ( !(undefined === this.CtrPrp.Shd && undefined === Shd) && !(undefined !== this.CtrPrp.Shd && undefined !== Shd && true === this.CtrPrp.Shd.Compare( Shd ) ) )
{
History.Add(this, new CChangesMathShd(Shd, this.CtrPrp.Shd));
this.raw_SetShd(Shd);
}
},
Set_Underline: function(Value)
{
};
CMathBase.prototype.Set_Underline = function(Value)
{
if ( Value !== this.CtrPrp.Underline )
{
History.Add(this, new CChangesMathUnderline(Value, this.CtrPrp.Underline));
this.raw_SetUnderline(Value);
}
},
Set_Strikeout: function(Value)
{
};
CMathBase.prototype.Set_Strikeout = function(Value)
{
if ( Value !== this.CtrPrp.Strikeout )
{
History.Add(this, new CChangesMathStrikeout(Value, this.CtrPrp.Strikeout));
this.raw_SetStrikeout(Value);
}
},
Set_DoubleStrikeout: function(Value)
{
};
CMathBase.prototype.Set_DoubleStrikeout = function(Value)
{
if(Value !== this.CtrPrp.DStrikeout)
{
History.Add(this, new CChangesMath_DoubleStrikeout(Value, this.CtrPrp.DStrikeout));
this.raw_Set_DoubleStrikeout(Value);
}
},
Set_Bold: function(Value)
{
};
CMathBase.prototype.Set_Bold = function(Value)
{
if(Value !== this.CtrPrp.Bold)
{
History.Add(this, new CChangesMathBold(Value, this.CtrPrp.Bold));
this.raw_SetBold(Value);
}
},
Set_Italic: function(Value)
{
};
CMathBase.prototype.Set_Italic = function(Value)
{
if(Value !== this.CtrPrp.Italic)
{
History.Add(this, new CChangesMathItalic(Value, this.CtrPrp.Italic));
this.raw_SetItalic(Value);
}
},
Set_RFonts_Ascii: function(Value)
{
};
CMathBase.prototype.Set_RFonts_Ascii = function(Value)
{
if(this.CtrPrp.RFonts.Ascii !== Value)
{
History.Add(this, new CChangesMath_RFontsAscii(Value, this.CtrPrp.RFonts.Ascii));
this.raw_SetRFontsAscii(Value);
}
},
Set_RFonts_HAnsi: function(Value)
{
};
CMathBase.prototype.Set_RFonts_HAnsi = function(Value)
{
if(this.CtrPrp.RFonts.HAnsi !== Value)
{
History.Add(this, new CChangesMath_RFontsHAnsi(Value, this.CtrPrp.RFonts.HAnsi));
this.raw_SetRFontsHAnsi(Value);
}
},
Set_RFonts_CS: function(Value)
{
};
CMathBase.prototype.Set_RFonts_CS = function(Value)
{
if(this.CtrPrp.RFonts.CS !== Value)
{
History.Add(this, new CChangesMath_RFontsCS(Value, this.CtrPrp.RFonts.CS));
this.raw_SetRFontsCS(Value);
}
},
Set_RFonts_EastAsia: function(Value)
{
};
CMathBase.prototype.Set_RFonts_EastAsia = function(Value)
{
if(this.CtrPrp.RFonts.EastAsia !== Value)
{
History.Add(this, new CChangesMath_RFontsEastAsia(Value, this.CtrPrp.RFonts.EastAsia));
this.raw_SetRFontsEastAsia(Value);
}
},
Set_RFonts_Hint: function(Value)
{
};
CMathBase.prototype.Set_RFonts_Hint = function(Value)
{
if(this.CtrPrp.RFonts.Hint !== Value)
{
History.Add(this, new CChangesMath_RFontsHint(Value, this.CtrPrp.RFonts.Hint));
this.raw_SetRFontsHint(Value);
}
},
raw_SetBold: function(Value)
{
};
CMathBase.prototype.raw_SetBold = function(Value)
{
this.CtrPrp.Bold = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetItalic: function(Value)
{
};
CMathBase.prototype.raw_SetItalic = function(Value)
{
this.CtrPrp.Italic = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetUnderline : function(Value)
{
};
CMathBase.prototype.raw_SetUnderline = function(Value)
{
this.CtrPrp.Underline = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetStrikeout: function(Value)
{
};
CMathBase.prototype.raw_SetStrikeout = function(Value)
{
this.CtrPrp.Strikeout = Value;
this.NeedUpdate_CtrPrp();
},
raw_Set_DoubleStrikeout: function(Value)
{
};
CMathBase.prototype.raw_Set_DoubleStrikeout = function(Value)
{
this.CtrPrp.DStrikeout = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetFontSize : function(Value)
{
};
CMathBase.prototype.raw_SetFontSize = function(Value)
{
this.CtrPrp.FontSize = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetShd: function(Shd)
{
};
CMathBase.prototype.raw_SetShd = function(Shd)
{
if ( undefined !== Shd )
{
this.CtrPrp.Shd = new CDocumentShd();
......@@ -970,19 +925,19 @@ CMathBase.prototype =
this.CtrPrp.Shd = undefined;
this.NeedUpdate_CtrPrp();
},
raw_SetColor: function(Value)
{
};
CMathBase.prototype.raw_SetColor = function(Value)
{
this.CtrPrp.Color = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetUnifill: function(Value)
{
};
CMathBase.prototype.raw_SetUnifill = function(Value)
{
this.CtrPrp.Unifill = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFonts: function(RFonts)
{
};
CMathBase.prototype.raw_SetRFonts = function(RFonts)
{
if ( undefined != RFonts )
{
if ( undefined != RFonts.Ascii )
......@@ -1008,46 +963,44 @@ CMathBase.prototype =
this.Set_RFonts_EastAsia( undefined );
this.Set_RFonts_Hint( undefined );
}
},
raw_SetRFontsAscii: function(Value)
{
};
CMathBase.prototype.raw_SetRFontsAscii = function(Value)
{
this.CtrPrp.RFonts.Ascii = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsHAnsi: function(Value)
{
};
CMathBase.prototype.raw_SetRFontsHAnsi = function(Value)
{
this.CtrPrp.RFonts.HAnsi = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsCS: function(Value)
{
};
CMathBase.prototype.raw_SetRFontsCS = function(Value)
{
this.CtrPrp.RFonts.CS = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsEastAsia: function(Value)
{
};
CMathBase.prototype.raw_SetRFontsEastAsia = function(Value)
{
this.CtrPrp.RFonts.EastAsia = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsHint: function(Value)
{
};
CMathBase.prototype.raw_SetRFontsHint = function(Value)
{
this.CtrPrp.RFonts.Hint = Value;
this.NeedUpdate_CtrPrp();
},
NeedUpdate_CtrPrp: function()
{
};
CMathBase.prototype.NeedUpdate_CtrPrp = function()
{
this.RecalcInfo.bCtrPrp = true;
if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
SelectToParent: function(bCorrect)
{
};
CMathBase.prototype.SelectToParent = function(bCorrect)
{
this.bSelectionUse = true;
this.Parent.SelectToParent(bCorrect);
}
//////////////////////////
};
CMathBase.prototype.Set_Paragraph = CParagraphContentWithParagraphLikeContent.prototype.Set_Paragraph;
CMathBase.prototype.Get_ElementByPos = CParagraphContentWithParagraphLikeContent.prototype.Get_ElementByPos;
......@@ -1708,8 +1661,6 @@ CMathBase.prototype.Is_EmptyRange = function()
{
return false;
};
CMathBase.prototype.Get_CurrentParaPos = CMathContent.prototype.Get_CurrentParaPos;
CMathBase.prototype.private_UpdatePosOnAdd = CMathContent.prototype.private_UpdatePosOnAdd;
CMathBase.prototype.private_UpdatePosOnRemove = CMathContent.prototype.private_UpdateOnRemove;
......@@ -1731,7 +1682,6 @@ CMathBase.prototype.private_CorrectCurPos = function()
}
};
CMathBase.prototype.Search = CParagraphContentWithParagraphLikeContent.prototype.Search;
CMathBase.prototype.Add_SearchResult = CParagraphContentWithParagraphLikeContent.prototype.Add_SearchResult;
CMathBase.prototype.Clear_SearchResults = CParagraphContentWithParagraphLikeContent.prototype.Clear_SearchResults;
......@@ -1778,7 +1728,7 @@ CMathBase.prototype.Is_ContentUse = function(MathContent)
function CMathBasePr()
{
};
}
CMathBasePr.prototype.Set_FromObject = function(Obj){};
CMathBasePr.prototype.Copy = function(){return new CMathBasePr();};
CMathBasePr.prototype.Write_ToBinary = function(Writer){};
......
......@@ -707,9 +707,7 @@ function CMathContent()
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id );
}
//Asc.extendClass(CMathContent, ParaHyperlink);
Asc.extendClass(CMathContent, CParagraphContentWithParagraphLikeContent);
CMathContent.prototype.init = function()
{
......@@ -729,35 +727,6 @@ CMathContent.prototype.fillPlaceholders = function()
};
//////////////////////////////////////
/*recalculateSize: function()
{
var width = 0 ;
var ascent = 0 ;
var descent = 0 ;
var oSize;
this.WidthToElement.length = 0;
for(var i = 0; i < this.Content.length; i++)
{
if(this.Content[i].Type == para_Math_Composition)
this.Content[i].ApplyGaps();
else if(this.Content[i].Type == para_Math_Run)
this.Content[i].Math_ApplyGaps();
this.WidthToElement[i] = width;
oSize = this.Content[i].size;
width += oSize.width;
ascent = ascent > oSize.ascent ? ascent : oSize.ascent;
var oDescent = oSize.height - oSize.ascent;
descent = descent < oDescent ? oDescent : descent;
}
this.size = {width: width, height: ascent + descent, ascent: ascent};
},*/
CMathContent.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
{
if(ArgSize !== null && ArgSize !== undefined)
......@@ -3163,19 +3132,6 @@ CMathContent.prototype.Add_MatrixWithBrackets = function(begChr, endChr, ctrPr,
var MathContent = Delimiter.getElementMathContent(0);
return MathContent.Add_Matrix(ctrPr, RowsCount, ColsCount, plcHide, aText);
};
/*CMathContent.prototype.Recalculate_Reset = function(StartRange, StartLine)
{
var CurLine = StartLine - this.StartLine;
var CurRange = ( 0 === CurLine ? StartRange - this.StartRange : StartRange );
var StartPos = this.protected_GetRangeStartPos(CurLine, CurRange);
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
for(var nPos = StartPos; nPos <= EndPos; nPos++)
{
this.Content[nPos].Recalculate_Reset(StartRange, StartLine);
}
};*/
CMathContent.prototype.old_Get_Bounds = function()
{
var X = 0, Y = 0, W = 0, H = 0;
......@@ -3202,26 +3158,6 @@ CMathContent.prototype.Get_Bounds = function()
return {X : X, Y : Y, W : W, H : H, Asc: Asc};
};
CMathContent.prototype.old_Recalculate_CurPos = function(_X, _Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget)
{
var X = this.pos.x + this.ParaMath.X;
var Y = this.pos.y + this.ParaMath.Y + this.size.ascent;
if(this.RecalcInfo.bEqArray)
{
for(var nPos = 0; nPos < this.CurPos; nPos++)
{
if(para_Math_Run === this.Content[nPos].Type)
X = this.Content[nPos].Recalculate_CurPos(X, Y, false, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget).X;
else
X += this.Content[nPos].size.width;
}
}
else
X += this.WidthToElement[this.CurPos];
return this.Content[this.CurPos].Recalculate_CurPos(X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget);
};
CMathContent.prototype.Recalculate_CurPos = function(_X, _Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget)
{
var CurLine = _CurLine - this.StartLine;
......@@ -4203,24 +4139,7 @@ CMathContent.prototype.IsFirstLine = function(Line)
{
var CurLine = Line - this.StartLine;
return CurLine == 0;
}
/*CMathContent.prototype.Is_CheckingNearestPos = ParaHyperlink.prototype.Is_CheckingNearestPos;
CMathContent.prototype.Search = ParaHyperlink.prototype.Search;
CMathContent.prototype.Add_SearchResult = ParaHyperlink.prototype.Add_SearchResult;
CMathContent.prototype.Clear_SearchResults = ParaHyperlink.prototype.Clear_SearchResults;
CMathContent.prototype.Remove_SearchResult = ParaHyperlink.prototype.Remove_SearchResult;
CMathContent.prototype.Search_GetId = ParaHyperlink.prototype.Search_GetId;
CMathContent.prototype.Recalc_RunsCompiledPr = ParaHyperlink.prototype.Recalc_RunsCompiledPr;
//CMathContent.prototype.Recalculate_Range = ParaHyperlink.prototype.Recalculate_Range;
CMathContent.prototype.protected_AddRange = ParaHyperlink.prototype.protected_AddRange;
CMathContent.prototype.protected_FillRange = ParaHyperlink.prototype.protected_FillRange;
CMathContent.prototype.protected_UpdateSpellChecking = ParaHyperlink.prototype.protected_UpdateSpellChecking;
CMathContent.prototype.Recalculate_Range_Width = ParaHyperlink.prototype.Recalculate_Range_Width;
CMathContent.prototype.Recalculate_Set_RangeEndPos = ParaHyperlink.prototype.Recalculate_Set_RangeEndPos;
CMathContent.prototype.Is_EmptyRange = ParaHyperlink.prototype.Is_EmptyRange;*/
};
CMathContent.prototype.Get_SelectionDirection = function()
{
......
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