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

Исправлен баг с определением высоты особенных "пустых" строк (баг 18277).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48124 954022d7-b5bf-4e40-9824-e11837661b57
parent 84639943
......@@ -171,6 +171,20 @@ CDocumentContent.prototype =
return { X : X_Left_Field, Y : Y_Top_Field, XLimit : X_Right_Field, YLimit : Y_Bottom_Field };
},
Get_EmptyHeight : function()
{
var Count = this.Content.length;
if ( Count <= 0 )
return 0;
var Element = this.Content[Count - 1];
if ( type_Paragraph === Element.GetType() )
return Element.Get_EmptyHeight();
else
return 0;
},
// Inner = true - запрос пришел из содержимого,
// false - запрос пришел от родительского класса
// Запрос от родительского класса нужен, например, для колонтитулов, потому
......
......@@ -211,7 +211,13 @@ Paragraph.prototype =
Get_EmptyHeight : function()
{
var EndTextPr = this.Get_CompiledPr2(false).TextPr.Copy();
EndTextPr.Merge( this.TextPr.Value );
g_oTextMeasurer.SetTextPr( EndTextPr );
g_oTextMeasurer.SetFontSlot( fontslot_ASCII );
return g_oTextMeasurer.GetHeight();
},
Reset : function (X,Y, XLimit, YLimit, PageNum)
......
......@@ -16333,10 +16333,13 @@ CTable.prototype =
// Сначала пробежимся по строкам и узнаем, какие строки нужно удалить
var Rows_to_Delete = new Array();
var Rows_to_CalcH = new Array();
var Rows_to_CalcH2 = new Array();
for ( var CurRow = 0; CurRow < this.Content.length; CurRow++ )
{
var Row = this.Content[CurRow];
var bVmerge_Restart = false;
var bVmerge_Continue = false;
var bNeedDeleteRow = true;
var bNeedCalcHeight = false;
......@@ -16350,24 +16353,55 @@ CTable.prototype =
if ( VMerge != vmerge_Continue )
{
var VMergeCount = this.Internal_GetVertMergeCount( CurRow, Row.Get_CellInfo( CurCell ).StartGridCol, Cell.Get_GridSpan() );
if ( VMergeCount > 1 )
bVmerge_Restart = true;
bNeedDeleteRow = false;
if ( true === bNeedCalcHeight )
{
var VMergeCount = this.Internal_GetVertMergeCount( CurRow, Row.Get_CellInfo( CurCell ).StartGridCol, Cell.Get_GridSpan() );
if ( 1 === VMergeCount )
bNeedCalcHeight = false;
}
else
break;
}
else
bVmerge_Continue = true;
}
if ( true === bVmerge_Continue && true === bVmerge_Restart )
Rows_to_CalcH2.push( CurRow );
else if ( true === bNeedCalcHeight )
Rows_to_CalcH.push( CurRow );
if ( true === bNeedDeleteRow )
Rows_to_Delete.push( CurRow );
}
if ( true === bNeedCalcHeight )
Rows_to_CalcH.push( CurRow );
// Сначала разберемся со строками, у которых надо проставить минимальную высоту
for ( var Index = 0; Index < Rows_to_CalcH2.length; Index++ )
{
var RowIndex = Rows_to_CalcH2[Index];
var MinHeight = -1;
var Row = this.Content[RowIndex];
var CellsCount = Row.Get_CellsCount()
for ( var CurCell = 0; CurCell < CellsCount; CurCell++ )
{
var Cell = Row.Get_Cell( CurCell );
var VMerge = Cell.Get_VMerge();
if ( vmerge_Restart === VMerge )
{
var CurMinHeight = Cell.Content.Get_EmptyHeight();
if ( CurMinHeight < MinHeight || MinHeight === -1 )
MinHeight = CurMinHeight;
}
}
var OldHeight = this.Content[RowIndex].Get_Height();
if ( undefined === OldHeight || heightrule_Auto == OldHeight.HRule || ( MinHeight > OldHeight.Value ) )
this.Content[RowIndex].Set_Height( MinHeight, heightrule_AtLeast );
}
if ( Rows_to_Delete.length <= 0 )
......
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