Commit 82074258 authored by Ilya Kirillov's avatar Ilya Kirillov

Fix bug# 32519 Исправлен баг с отображением границ ячеек таблиц в интерфейсе.

parent 064dfa40
...@@ -528,137 +528,123 @@ CTable.prototype = ...@@ -528,137 +528,123 @@ CTable.prototype =
Pr.CellsWidth = -CellW.W; Pr.CellsWidth = -CellW.W;
var Spacing = this.Content[0].Get_CellSpacing(); var Spacing = this.Content[0].Get_CellSpacing();
if ( null === Spacing )
{
Pr.CellBorders =
{
Left : CellBorders.Left.Copy(),
Right : CellBorders.Right.Copy(),
Top : CellBorders.Top.Copy(),
Bottom : CellBorders.Bottom.Copy(),
InsideH : null,
InsideV : null
};
}
else
{
var Border_left = null;
var Border_right = null;
var Border_top = null;
var Border_bottom = null;
var Border_insideH = null;
var Border_insideV = null;
var CellShd = null;
for ( var CurRow = 0; CurRow < this.Content.length; CurRow++ )
{
var Row = this.Content[CurRow];
var Cells_Count = Row.Get_CellsCount();
for ( var CurCell = 0; CurCell < Cells_Count; CurCell++ )
{
var Cell = Row.Get_Cell( CurCell );
var Cell_borders = Cell.Get_Borders();
var Cell_shd = Cell.Get_Shd();
if ( 0 === CurCell && Cells_Count )
{
CellShd = Cell_shd;
}
else
{
if ( null != CellShd && ( CellShd.Value != Cell_shd.Value || CellShd.Color.r != Cell_shd.Color.r || CellShd.Color.g != Cell_shd.Color.g || CellShd.Color.b != Cell_shd.Color.b ) )
CellShd = null;
}
// Крайняя левая ли данная ячейка в выделении? var Border_left = null;
if ( 0 === CurCell ) var Border_right = null;
{ var Border_top = null;
if ( null === Border_left ) var Border_bottom = null;
Border_left = Cell_borders.Left; var Border_insideH = null;
else var Border_insideV = null;
Border_left = this.Internal_CompareBorders2( Border_left, Cell_borders.Left );
} var CellShd = null;
else
{ for ( var CurRow = 0; CurRow < this.Content.length; CurRow++ )
if ( null === Border_insideV ) {
Border_insideV = Cell_borders.Left; var Row = this.Content[CurRow];
else var Cells_Count = Row.Get_CellsCount();
Border_insideV = this.Internal_CompareBorders2( Border_insideV, Cell_borders.Left );
} for ( var CurCell = 0; CurCell < Cells_Count; CurCell++ )
{
// Крайняя правая ли данная ячейка в выделении? var Cell = Row.Get_Cell( CurCell );
if ( Cells_Count - 1 === CurCell ) var Cell_borders = Cell.Get_Borders();
{ var Cell_shd = Cell.Get_Shd();
if ( null === Border_right )
Border_right = Cell_borders.Right; if ( 0 === CurCell && Cells_Count )
else {
Border_right = this.Internal_CompareBorders2( Border_right, Cell_borders.Right ); CellShd = Cell_shd;
} }
else else
{ {
if ( null === Border_insideV ) if ( null != CellShd && ( CellShd.Value != Cell_shd.Value || CellShd.Color.r != Cell_shd.Color.r || CellShd.Color.g != Cell_shd.Color.g || CellShd.Color.b != Cell_shd.Color.b ) )
Border_insideV = Cell_borders.Right; CellShd = null;
else }
Border_insideV = this.Internal_CompareBorders2( Border_insideV, Cell_borders.Right );
} // Крайняя левая ли данная ячейка в выделении?
if ( 0 === CurCell )
if ( 0 === CurCell ) {
{ if ( null === Border_left )
if ( 0 != CurRow ) Border_left = Cell_borders.Left;
{ else
if ( null === Border_insideH ) Border_left = this.Internal_CompareBorders2( Border_left, Cell_borders.Left );
{ }
Border_insideH = Border_bottom; else
Border_insideH = this.Internal_CompareBorders2( Border_insideH, Cell_borders.Top ); {
} if ( null === Border_insideV )
else Border_insideV = Cell_borders.Left;
{ else
Border_insideH = this.Internal_CompareBorders2( Border_insideH, Border_bottom ); Border_insideV = this.Internal_CompareBorders2( Border_insideV, Cell_borders.Left );
Border_insideH = this.Internal_CompareBorders2( Border_insideH, Cell_borders.Top ); }
}
} // Крайняя правая ли данная ячейка в выделении?
else if ( Cells_Count - 1 === CurCell )
{ {
if ( null === Border_top ) if ( null === Border_right )
Border_top = Cell_borders.Top; Border_right = Cell_borders.Right;
} else
Border_right = this.Internal_CompareBorders2( Border_right, Cell_borders.Right );
Border_bottom = Cell_borders.Bottom; }
} else
else {
{ if ( null === Border_insideV )
if ( 0 != bFirstRow ) Border_insideV = Cell_borders.Right;
{ else
if ( null === Border_insideH ) Border_insideV = this.Internal_CompareBorders2( Border_insideV, Cell_borders.Right );
Border_insideH = Cell_borders.Top; }
else
Border_insideH = this.Internal_CompareBorders2( Border_insideH, Cell_borders.Top ); if ( 0 === CurCell )
} {
else if ( 0 != CurRow )
{ {
if ( null === Border_top ) if ( null === Border_insideH )
Border_top = Cell_borders.Top; {
else Border_insideH = Border_bottom;
Border_top = this.Internal_CompareBorders2( Border_top, Cell_borders.Top ); Border_insideH = this.Internal_CompareBorders2( Border_insideH, Cell_borders.Top );
} }
else
Border_bottom = this.Internal_CompareBorders2( Border_bottom, Cell_borders.Bottom ); {
} Border_insideH = this.Internal_CompareBorders2( Border_insideH, Border_bottom );
} Border_insideH = this.Internal_CompareBorders2( Border_insideH, Cell_borders.Top );
} }
}
Pr.CellBorders = else
{ {
Left : Border_left.Copy(), if ( null === Border_top )
Right : Border_right.Copy(), Border_top = Cell_borders.Top;
Top : Border_top.Copy(), }
Bottom : Border_bottom.Copy(),
InsideH : null === Border_insideH ? null : Border_insideH.Copy(), Border_bottom = Cell_borders.Bottom;
InsideV : null === Border_insideV ? null : Border_insideV.Copy() }
}; else
} {
if ( 0 != CurRow )
{
if ( null === Border_insideH )
Border_insideH = Cell_borders.Top;
else
Border_insideH = this.Internal_CompareBorders2( Border_insideH, Cell_borders.Top );
}
else
{
if ( null === Border_top )
Border_top = Cell_borders.Top;
else
Border_top = this.Internal_CompareBorders2( Border_top, Cell_borders.Top );
}
Border_bottom = this.Internal_CompareBorders2( Border_bottom, Cell_borders.Bottom );
}
}
}
Pr.CellBorders =
{
Left : Border_left.Copy(),
Right : Border_right.Copy(),
Top : Border_top.Copy(),
Bottom : Border_bottom.Copy(),
InsideH : null === Border_insideH ? null : Border_insideH.Copy(),
InsideV : null === Border_insideV ? null : Border_insideV.Copy()
};
} }
switch(Pr.CellsVAlign) switch(Pr.CellsVAlign)
......
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