Commit d371c284 authored by Ilya Kirillov's avatar Ilya Kirillov

Исправлен баг с компиляцией стиля ячейки у первого столбца таблицы.

parent 68c68375
......@@ -6961,6 +6961,24 @@ CTableCellPr.prototype =
this.NoWrap = Reader.GetBool();
}
};
CTableCellPr.prototype.Is_Empty = function()
{
if (undefined !== this.GridSpan
|| undefined !== this.Shd
|| undefined !== this.TableCellMar
|| undefined !== this.TableCellBorders.Bottom
|| undefined !== this.TableCellBorders.Left
|| undefined !== this.TableCellBorders.Right
|| undefined !== this.TableCellBorders.Top
|| undefined !== this.TableCellW
|| undefined !== this.VAlign
|| undefined !== this.VMerge
|| undefined !== this.TextDirection
|| undefined !== this.NoWrap)
return false;
return true;
};
function CRFonts()
{
......@@ -7232,6 +7250,17 @@ CRFonts.prototype =
return true;
}
};
CRFonts.prototype.Is_Empty = function()
{
if (undefined !== this.Ascii
|| undefined !== this.EastAsia
|| undefined !== this.HAnsi
|| undefined !== this.CS
|| undefined !== this.Hint)
return false;
return true;
};
function CLang()
{
......@@ -7349,6 +7378,15 @@ CLang.prototype =
return true;
}
};
CLang.prototype.Is_Empty = function()
{
if (undefined !== this.Bidi
|| undefined !== this.EastAsia
|| undefined !== this.Val)
return false;
return true;
};
function CTextPr()
{
......@@ -8747,6 +8785,40 @@ CTextPr.prototype =
return Description;
}
};
CTextPr.prototype.Is_Empty = function()
{
if (undefined !== this.Bold
|| undefined !== this.Italic
|| undefined !== this.Strikeout
|| undefined !== this.Underline
|| undefined !== this.FontFamily
|| undefined !== this.FontSize
|| undefined !== this.Color
|| undefined !== this.VertAlign
|| undefined !== this.HighLight
|| undefined !== this.RStyle
|| undefined !== this.Spacing
|| undefined !== this.DStrikeout
|| undefined !== this.Caps
|| undefined !== this.SmallCaps
|| undefined !== this.Position
|| true !== this.RFonts.Is_Empty()
|| undefined !== this.BoldCS
|| undefined !== this.ItalicCS
|| undefined !== this.FontSizeCS
|| undefined !== this.CS
|| undefined !== this.RTL
|| true !== this.Lang.Is_Empty()
|| undefined !== this.Unifill
|| undefined !== this.FontRef
|| undefined !== this.Shd
|| undefined !== this.Vanish
|| undefined !== this.TextOutline
|| undefined !== this.TextFill)
return false;
return true;
};
CTextPr.prototype.Get_Bold = function()
{
return this.Bold;
......@@ -9120,6 +9192,15 @@ CParaInd.prototype =
this.FirstLine = Reader.GetDouble();
}
};
CParaInd.prototype.Is_Empty = function()
{
if (undefined !== this.Left
|| undefined !== this.Right
|| undefined !== this.FirstLine)
return false;
return true;
};
CParaInd.prototype.Get_Diff = function(Ind)
{
var DiffInd = new CParaInd();
......@@ -9299,6 +9380,18 @@ CParaSpacing.prototype.Get_Diff = function(Spacing)
return DiffSpacing;
};
CParaSpacing.prototype.Is_Empty = function()
{
if (undefined !== this.Line
|| undefined !== this.LineRule
|| undefined !== this.Before
|| undefined !== this.BeforeAutoSpacing
|| undefined !== this.After
|| undefined !== this.AfterAutoSpacing)
return false;
return true;
};
function CNumPr()
{
......@@ -10497,6 +10590,31 @@ CParaPr.prototype =
delete this.ReviewInfo;
}
};
CParaPr.prototype.Is_Empty = function()
{
if (undefined !== this.ContextualSpacing
|| true !== this.Ind.Is_Empty()
|| undefined !== this.Jc
|| undefined !== this.KeepLines
|| undefined !== this.KeepNext
|| undefined !== this.PageBreakBefore
|| true !== this.Spacing.Is_Empty()
|| undefined !== this.Shd
|| undefined !== this.Brd.First
|| undefined !== this.Brd.Last
|| undefined !== this.Brd.Between
|| undefined !== this.Brd.Bottom
|| undefined !== this.Brd.Left
|| undefined !== this.Brd.Right
|| undefined !== this.Brd.Top
|| undefined !== this.WidowControl
|| undefined !== this.Tabs
|| undefined !== this.NumPr
|| undefined !== this.PStyle)
return false;
return true;
};
CParaPr.prototype.Get_DiffPrChange = function()
{
var ParaPr = new CParaPr();
......
......@@ -277,7 +277,7 @@ CTableCell.prototype =
if ( true === TableLook.Is_BandHor() )
{
var RowBandSize = TablePr.TablePr.TableStyleRowBandSize;
var __RowIndex = ( true != TableLook.Is_FirstRow() ? RowIndex : RowIndex - 1 )
var __RowIndex = ( true != TableLook.Is_FirstRow() ? RowIndex : RowIndex - 1 );
var _RowIndex = ( 1 != RowBandSize ? Math.floor( __RowIndex / RowBandSize ) : __RowIndex );
var TableBandStyle = null;
if ( 0 === _RowIndex % 2 )
......@@ -291,22 +291,38 @@ CTableCell.prototype =
}
// Совместим с настройками для групп колонок
// Согласно спецификации DOCX, совмещать надо всегда, но для первой и последней колонок Word
// не совмещает, поэтому делаем также.
if ( true === TableLook.Is_BandVer() && !( (true === TableLook.Is_LastCol() && this.Row.Get_CellsCount() - 1 === CellIndex) || (true === TableLook.Is_FirstCol() && 0 === CellIndex) ) )
// Согласно спецификации DOCX, совмещать надо всегда. Word проверяет наличие первой колонки не только
// через флаг TableLook.Is_FirstCol(), но и самим наличием непустого стиля для первой колонки.
if (true === TableLook.Is_BandVer())
{
var bFirstCol = false;
if (true === TableLook.Is_FirstCol())
{
var oTableStyle = this.Get_Styles().Get(this.Row.Table.Get_TableStyle());
if (oTableStyle && styletype_Table === oTableStyle.Get_Type() && oTableStyle.TableFirstCol)
{
var oCondStyle = oTableStyle.TableFirstCol;
if (true !== oCondStyle.TableCellPr.Is_Empty()
|| true !== oCondStyle.ParaPr.Is_Empty()
|| true !== oCondStyle.TextPr.Is_Empty())
{
bFirstCol = true;
}
}
}
var ColBandSize = TablePr.TablePr.TableStyleColBandSize;
var _ColIndex = ( true != TableLook.Is_FirstCol() ? CellIndex : CellIndex - 1 )
var ColIndex = ( 1 != ColBandSize ? Math.floor( _ColIndex / ColBandSize ) : _ColIndex );
var _ColIndex = ( true != bFirstCol ? CellIndex : CellIndex - 1 );
var ColIndex = ( 1 != ColBandSize ? Math.floor(_ColIndex / ColBandSize) : _ColIndex );
var TableBandStyle = null;
if ( 0 === ColIndex % 2 )
if (0 === ColIndex % 2)
TableBandStyle = TablePr.TableBand1Vert;
else
TableBandStyle = TablePr.TableBand2Vert;
CellPr.Merge( TableBandStyle.TableCellPr );
TextPr.Merge( TableBandStyle.TextPr );
ParaPr.Merge( TableBandStyle.ParaPr );
CellPr.Merge(TableBandStyle.TableCellPr);
TextPr.Merge(TableBandStyle.TextPr);
ParaPr.Merge(TableBandStyle.ParaPr);
}
......
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