Commit 27af9326 authored by Ilya Kirillov's avatar Ilya Kirillov

Fix bug #32589 Исправлен баг с чтением документов, у которых стоит флаг...

Fix bug #32589 Исправлен баг с чтением документов, у которых стоит флаг "колонки разной ширины", но при этом ни одной колонки не задано.
parent c5072d9a
......@@ -1888,8 +1888,8 @@ CSectionColumn.prototype.Write_ToBinary = function(Writer)
// Double : W
// Double : Space
Writer.WriteDouble( this.W );
Writer.WriteDouble( this.Space );
Writer.WriteDouble(this.W);
Writer.WriteDouble(this.Space);
};
CSectionColumn.prototype.Read_FromBinary = function(Reader)
{
......@@ -1921,15 +1921,15 @@ CSectionColumns.prototype.Write_ToBinary = function(Writer)
// Long : Количество колонок
// Variable : Сами колонки
Writer.WriteBool( this.EqualWidth );
Writer.WriteLong( this.Num );
Writer.WriteBool( this.Sep );
Writer.WriteDouble( this.Space );
Writer.WriteBool(this.EqualWidth);
Writer.WriteLong(this.Num);
Writer.WriteBool(this.Sep);
Writer.WriteDouble(this.Space);
var Count = this.Cols.length;
Writer.WriteLong( Count );
Writer.WriteLong(Count);
for ( var Pos = 0; Pos < Count; Pos++ )
for (var Pos = 0; Pos < Count; Pos++)
{
this.Cols[Pos].Write_ToBinary(Writer);
}
......@@ -1952,18 +1952,25 @@ CSectionColumns.prototype.Read_FromBinary = function(Reader)
var Count = Reader.GetLong();
this.Cols = [];
for ( var Pos = 0; Pos < Count; Pos++ )
for (var Pos = 0; Pos < Count; Pos++)
{
this.Cols[Pos] = new CSectionColumn();
this.Cols[Pos].Read_FromBinary( Reader );
this.Cols[Pos].Read_FromBinary(Reader);
}
};
CSectionColumns.prototype.Get_Count = function()
{
if (true === this.EqualWidth)
{
return this.Num;
}
else
{
if (this.Cols.length <= 0)
return 1;
return this.Cols.length;
}
};
CSectionColumns.prototype.Get_ColumnWidth = function(ColIndex)
{
......@@ -1976,6 +1983,9 @@ CSectionColumns.prototype.Get_ColumnWidth = function(ColIndex)
}
else
{
if (this.Cols.length <= 0)
return 0;
ColIndex = Math.max(0, Math.min(this.Cols.length - 1, ColIndex));
if (ColIndex < 0)
return 0;
......@@ -1991,6 +2001,9 @@ CSectionColumns.prototype.Get_ColumnSpace = function(ColIndex)
}
else
{
if (this.Cols.length <= 0)
return this.Space;
ColIndex = Math.max(0, Math.min(this.Cols.length - 1, ColIndex));
if (ColIndex < 0)
return this.Space;
......
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