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

Сделала смещение номера страницы у Bounds, если формула находится в таблице

Переделала Shift_Range в классе CMathBase

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63452 954022d7-b5bf-4e40-9824-e11837661b57
parent dc75e6f7
......@@ -542,6 +542,8 @@ function ParaMath()
this.Paragraph = null;
this.bFastRecalculate = true;
this.AbsolutePage = 0;
this.NearPosArray = [];
this.Width = 0;
......@@ -1146,6 +1148,8 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var ParaRange = PRS.Range;
var Page = AbsolutePage + PRS.Page;
this.AbsolutePage = AbsolutePage;
if(this.ParaMathRPI.CheckPrevLine(ParaLine, ParaRange))
{
this.UpdateInfoForBreak(PRS, ParaLine);
......@@ -1158,7 +1162,7 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var bUpdateWrapMath = PRS.Ranges.length > 0 && this.ParaMathRPI.bInline == false;
// первый пересчет
if(PrevLineObject == null && true == bFirstRange && PRS.bFastRecalculate == false && PRS.RecalcResult == recalcresult_NextLine)
if(PrevLineObject == null && true == bFirstRange && PRS.bFastRecalculate == false/*&& PRS.RecalcResult == recalcresult_NextLine*/)
{
// информация о пересчете
var RPI = new CRPI();
......@@ -1643,6 +1647,13 @@ ParaMath.prototype.Is_BrkBinBefore = function()
ParaMath.prototype.Shift_Range = function(Dx, Dy, _CurLine, _CurRange)
{
this.Root.Shift_Range(Dx, Dy, _CurLine, _CurRange);
var CurrentAbsolutePage = this.Paragraph.Get_StartPage_Absolute();
if(this.Paragraph !== null && this.AbsolutePage !== CurrentAbsolutePage)
{
this.Root.ChangePage(CurrentAbsolutePage - this.AbsolutePage);
this.AbsolutePage = CurrentAbsolutePage;
}
};
//-----------------------------------------------------------------------------------
// Функция для работы с формулой
......@@ -3547,7 +3558,6 @@ CMathRecalculateObject.prototype.Compare = function(PageInfo)
{
var result = true;
if(this.bFastRecalculate == false)
result = false;
......
......@@ -359,6 +359,46 @@ CMathBase.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
}
};
CMathBase.prototype.ChangePage = function(Dx)
{
this.Bounds.ChangePage(Dx);
for(var i=0; i < this.nRow; i++)
{
for(var j = 0; j < this.nCol; j++)
{
var Item = this.elements[i][j];
if(false == Item.IsJustDraw())
Item.ChangePage(Dx);
}
}
};
CMathBase.prototype.Shift_Range = function(Dx, Dy, _CurLine, _CurRange)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
if(this.bOneLine)
{
this.Bounds.ShiftPos(CurLine, CurRange, Dx, Dy);
for(var i=0; i < this.nRow; i++)
{
for(var j = 0; j < this.nCol; j++)
{
var Item = this.elements[i][j];
if(false == Item.IsJustDraw())
Item.Shift_Range(Dx, Dy, _CurLine, _CurRange);
}
}
}
else
{
this.Bounds.ShiftPos(CurLine, CurRange, Dx, Dy);
CMathBase.superclass.Shift_Range.call(this, Dx, Dy, _CurLine, _CurRange);
}
};
CMathBase.prototype.UpdatePosBound = function(pos, PRSA, Line, Range, Page)
{
var CurLine = Line - this.StartLine;
......@@ -2153,7 +2193,6 @@ CMathBase.prototype.private_UpdatePosOnAdd = CMathContent.prototype.private
CMathBase.prototype.private_UpdatePosOnRemove = CMathContent.prototype.private_UpdateOnRemove;
CMathBase.prototype.private_CorrectSelectionPos = CMathContent.prototype.private_CorrectSelectionPos;
CMathBase.prototype.private_CorrectSelectionPos = CMathContent.prototype.private_CorrectSelectionPos;
CMathBase.prototype.Shift_Range = CMathContent.prototype.Shift_Range;
CMathBase.prototype.private_CorrectCurPos = function()
{
if (this.CurPos > this.Content.length - 1)
......@@ -2290,8 +2329,6 @@ CMathBounds.prototype.GetPos = function(Line, Range)
return Pos;
};
function CMathBoundsMeasures()
{
this.Type = MATH_BOUNDS_MEASURES;
......
......@@ -835,6 +835,16 @@ CMathContent.prototype.GetWidthLine = function(_CurLine, _CurRange)
return W;
};
CMathContent.prototype.ChangePage = function(Dx)
{
this.Bounds.ChangePage(Dx);
for(var Pos = 0; Pos < this.Content.length; Pos++)
{
if(this.Content[Pos].Type === para_Math_Composition)
this.Content[Pos].ChangePage(Dx);
}
};
CMathContent.prototype.Get_CompiledArgSize = function()
{
return this.Compiled_ArgSz;
......
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