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

Исправлен баг с рассчетом метрики строки (баг 28499).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61108 954022d7-b5bf-4e40-9824-e11837661b57
parent bc612387
......@@ -1006,6 +1006,10 @@ ParaComment.prototype =
{
},
Recalculate_LineMetrics : function(PRS, _CurLine, _CurRange)
{
},
Recalculate_Range_Width : function(PRSC, _CurLine, _CurRange)
{
},
......
......@@ -13043,7 +13043,7 @@ CDocument.prototype =
if ( false === Pos )
continue;
Pos = Math.min(Pos, this.Content.length - 1);
//Pos = Math.min(Pos, this.Content.length - 1);
this.Content.splice(Pos, 1);
......
......@@ -904,6 +904,10 @@ ParaMath.prototype.Recalculate_Reset = function(CurRange, CurLine)
ParaMath.prototype.Recalculate_Set_RangeEndPos = function(PRS, PRP, Depth)
{
this.Root.Recalculate_Set_RangeEndPos(PRS, PRP, Depth);
};
ParaMath.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRange)
{
};
ParaMath.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
{
......
......@@ -1058,6 +1058,19 @@ CParagraphContentWithParagraphLikeContent.prototype.Recalculate_Set_RangeEndPos
this.Content[CurPos].Recalculate_Set_RangeEndPos( PRS, PRP, Depth + 1 );
};
CParagraphContentWithParagraphLikeContent.prototype.Recalculate_LineMetrics = function(PRS, _CurLine, _CurRange)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
var StartPos = this.protected_GetRangeStartPos(CurLine, CurRange);
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
for (var CurPos = StartPos; CurPos <= EndPos; CurPos++)
{
this.Content[CurPos].Recalculate_LineMetrics(PRSC, _CurLine, _CurRange);
}
};
CParagraphContentWithParagraphLikeContent.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
{
var CurLine = _CurLine - this.StartLine;
......
......@@ -899,6 +899,22 @@ Paragraph.prototype.private_RecalculateLineInfo = function(CurLine, CurPa
Paragraph.prototype.private_RecalculateLineMetrics = function(CurLine, CurPage, PRS, ParaPr)
{
var Line = this.Lines[CurLine];
var RangesCount = Line.Ranges.length;
for (var CurRange = 0; CurRange < RangesCount; CurRange++)
{
var Range = Line.Ranges[CurRange];
var StartPos = Range.StartPos;
var EndPos = Range.EndPos;
for (var Pos = StartPos; Pos <= EndPos; Pos++)
{
this.Content[Pos].Recalculate_LineMetrics(PRS, ParaPr, CurLine, CurRange);
}
}
// Строка пустая, у нее надо выставить ненулевую высоту. Делаем как Word, выставляем высоту по размеру
// текста, на котором закончилась данная строка.
if ( true === PRS.EmptyLine || PRS.LineAscent < 0.001 )
......
This diff is collapsed.
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