Commit 2497b820 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #33355

parent 14e8577f
...@@ -400,6 +400,10 @@ ParaComment.prototype = ...@@ -400,6 +400,10 @@ ParaComment.prototype =
{ {
}, },
Get_EndRangePos2 : function(_CurLine, _CurRange, ContentPos, Depth)
{
},
Get_StartPos : function(ContentPos, Depth) Get_StartPos : function(ContentPos, Depth)
{ {
}, },
......
...@@ -1003,6 +1003,10 @@ ParaComment.prototype = ...@@ -1003,6 +1003,10 @@ ParaComment.prototype =
{ {
}, },
Get_EndRangePos2 : function(_CurLine, _CurRange, ContentPos, Depth)
{
},
Get_StartPos : function(ContentPos, Depth) Get_StartPos : function(ContentPos, Depth)
{ {
}, },
......
...@@ -2953,6 +2953,11 @@ ParaMath.prototype.Get_StartRangePos2 = function(_CurLine, _CurRange, ContentPos ...@@ -2953,6 +2953,11 @@ ParaMath.prototype.Get_StartRangePos2 = function(_CurLine, _CurRange, ContentPos
return this.Root.Get_StartRangePos2(_CurLine, _CurRange, ContentPos, Depth); return this.Root.Get_StartRangePos2(_CurLine, _CurRange, ContentPos, Depth);
}; };
ParaMath.prototype.Get_EndRangePos2 = function(_CurLine, _CurRange, ContentPos, Depth)
{
return this.Root.Get_EndRangePos2(_CurLine, _CurRange, ContentPos, Depth);
};
ParaMath.prototype.Get_StartPos = function(ContentPos, Depth) ParaMath.prototype.Get_StartPos = function(ContentPos, Depth)
{ {
this.Root.Get_StartPos(ContentPos, Depth); this.Root.Get_StartPos(ContentPos, Depth);
......
...@@ -4609,6 +4609,19 @@ Paragraph.prototype = ...@@ -4609,6 +4609,19 @@ Paragraph.prototype =
return ContentPos; return ContentPos;
}, },
Get_EndRangePos2 : function(CurLine, CurRange)
{
var ContentPos = new CParagraphContentPos();
if (!this.Lines[CurLine] || !this.Lines[CurLine].Ranges[CurRange])
return ContentPos;
var Depth = 0;
var Pos = this.Lines[CurLine].Ranges[CurRange].EndPos;
ContentPos.Update(Pos, Depth);
this.Content[Pos].Get_EndRangePos2(CurLine, CurRange, ContentPos, Depth + 1);
return ContentPos;
},
Get_StartPos : function() Get_StartPos : function()
{ {
var ContentPos = new CParagraphContentPos(); var ContentPos = new CParagraphContentPos();
...@@ -12214,6 +12227,17 @@ Paragraph.prototype.CheckParaEnd = function() ...@@ -12214,6 +12227,17 @@ Paragraph.prototype.CheckParaEnd = function()
this.Add_ToContent(this.Content.length, oEndRun); this.Add_ToContent(this.Content.length, oEndRun);
} }
}; };
Paragraph.prototype.GetLineEndPos = function(CurLine)
{
if (CurLine < 0 || CurLine >= this.Lines.length)
return new CParagraphContentPos();
var oLine = this.Lines[CurLine];
if (!oLine || oLine.Ranges.length <= 0)
return new CParagraphContentPos();
return this.Get_EndRangePos2(CurLine, oLine.Ranges.length - 1);
};
var pararecalc_0_All = 0; var pararecalc_0_All = 0;
var pararecalc_0_None = 1; var pararecalc_0_None = 1;
......
...@@ -1865,6 +1865,15 @@ CParagraphContentWithParagraphLikeContent.prototype.Get_StartRangePos2 = functio ...@@ -1865,6 +1865,15 @@ CParagraphContentWithParagraphLikeContent.prototype.Get_StartRangePos2 = functio
this.Content[Pos].Get_StartRangePos2( _CurLine, _CurRange, ContentPos, Depth + 1 ); this.Content[Pos].Get_StartRangePos2( _CurLine, _CurRange, ContentPos, Depth + 1 );
}; };
CParagraphContentWithParagraphLikeContent.prototype.Get_EndRangePos2 = function(_CurLine, _CurRange, ContentPos, Depth)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
var Pos = this.protected_GetRangeEndPos(CurLine, CurRange);
ContentPos.Update(Pos, Depth);
this.Content[Pos].Get_EndRangePos2(_CurLine, _CurRange, ContentPos, Depth + 1);
};
CParagraphContentWithParagraphLikeContent.prototype.Get_StartPos = function(ContentPos, Depth) CParagraphContentWithParagraphLikeContent.prototype.Get_StartPos = function(ContentPos, Depth)
{ {
if ( this.Content.length > 0 ) if ( this.Content.length > 0 )
......
...@@ -1835,15 +1835,16 @@ Paragraph.prototype.private_RecalculateLineCheckFootnotes = function(CurLine, Cu ...@@ -1835,15 +1835,16 @@ Paragraph.prototype.private_RecalculateLineCheckFootnotes = function(CurLine, Cu
if (PRS.Fast) if (PRS.Fast)
return true; return true;
var oTopDocument = PRS.TopDocument; var oTopDocument = PRS.TopDocument;
var arrFootnotes = []; var arrFootnotes = [];
var oLineBreakPos = this.GetLineEndPos(CurLine);
for (var nIndex = 0, nCount = PRS.Footnotes.length; nIndex < nCount; ++nIndex) for (var nIndex = 0, nCount = PRS.Footnotes.length; nIndex < nCount; ++nIndex)
{ {
var oFootnote = PRS.Footnotes[nIndex].FootnoteReference.Get_Footnote(); var oFootnote = PRS.Footnotes[nIndex].FootnoteReference.Get_Footnote();
var oPos = PRS.Footnotes[nIndex].Pos; var oPos = PRS.Footnotes[nIndex].Pos;
// Проверим позицию // Проверим позицию
if (true === PRS.MoveToLBP && PRS.LineBreakPos.Compare(oPos) <= 0) if (oLineBreakPos.Compare(oPos) <= 0)
continue; continue;
arrFootnotes.push(oFootnote); arrFootnotes.push(oFootnote);
......
...@@ -5662,6 +5662,14 @@ ParaRun.prototype.Get_StartRangePos2 = function(_CurLine, _CurRange, ContentPos, ...@@ -5662,6 +5662,14 @@ ParaRun.prototype.Get_StartRangePos2 = function(_CurLine, _CurRange, ContentPos,
ContentPos.Update( Pos, Depth ); ContentPos.Update( Pos, Depth );
}; };
ParaRun.prototype.Get_EndRangePos2 = function(_CurLine, _CurRange, ContentPos, Depth)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
var Pos = this.protected_GetRangeEndPos(CurLine, CurRange);
ContentPos.Update(Pos, Depth);
};
ParaRun.prototype.Get_StartPos = function(ContentPos, Depth) ParaRun.prototype.Get_StartPos = function(ContentPos, Depth)
{ {
ContentPos.Update( 0, Depth ); ContentPos.Update( 0, Depth );
......
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