Commit 27708a1b authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #33633 Fixed an issue with save/load the changes of table cell related with borders.

parent 6fe412aa
...@@ -1572,19 +1572,19 @@ CTableCell.prototype = ...@@ -1572,19 +1572,19 @@ CTableCell.prototype =
} }
case 1 : case 1 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Right, Border)); History.Add(new CChangesTableCellBorderRight(this, this.Pr.TableCellBorders.Right, Border));
this.Pr.TableCellBorders.Right = undefined; this.Pr.TableCellBorders.Right = undefined;
break; break;
} }
case 2 : case 2 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Bottom, Border)); History.Add(new CChangesTableCellBorderBottom(this, this.Pr.TableCellBorders.Bottom, Border));
this.Pr.TableCellBorders.Bottom = undefined; this.Pr.TableCellBorders.Bottom = undefined;
break; break;
} }
case 3 : case 3 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Left, Border)); History.Add(new CChangesTableCellBorderLeft(this, this.Pr.TableCellBorders.Left, Border));
this.Pr.TableCellBorders.Left = undefined; this.Pr.TableCellBorders.Left = undefined;
break; break;
} }
...@@ -1613,19 +1613,19 @@ CTableCell.prototype = ...@@ -1613,19 +1613,19 @@ CTableCell.prototype =
} }
case 1 : case 1 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Right, NewBorder)); History.Add(new CChangesTableCellBorderRight(this, this.Pr.TableCellBorders.Right, NewBorder));
this.Pr.TableCellBorders.Right = NewBorder; this.Pr.TableCellBorders.Right = NewBorder;
break; break;
} }
case 2 : case 2 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Bottom, NewBorder)); History.Add(new CChangesTableCellBorderBottom(this, this.Pr.TableCellBorders.Bottom, NewBorder));
this.Pr.TableCellBorders.Bottom = NewBorder; this.Pr.TableCellBorders.Bottom = NewBorder;
break; break;
} }
case 3 : case 3 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Left, NewBorder)); History.Add(new CChangesTableCellBorderLeft(this, this.Pr.TableCellBorders.Left, NewBorder));
this.Pr.TableCellBorders.Left = NewBorder; this.Pr.TableCellBorders.Left = NewBorder;
break; break;
} }
...@@ -1658,19 +1658,19 @@ CTableCell.prototype = ...@@ -1658,19 +1658,19 @@ CTableCell.prototype =
} }
case 1 : case 1 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Right, NewBorder)); History.Add(new CChangesTableCellBorderRight(this, this.Pr.TableCellBorders.Right, NewBorder));
this.Pr.TableCellBorders.Right = NewBorder; this.Pr.TableCellBorders.Right = NewBorder;
break; break;
} }
case 2 : case 2 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Bottom, NewBorder)); History.Add(new CChangesTableCellBorderBottom(this, this.Pr.TableCellBorders.Bottom, NewBorder));
this.Pr.TableCellBorders.Bottom = NewBorder; this.Pr.TableCellBorders.Bottom = NewBorder;
break; break;
} }
case 3 : case 3 :
{ {
History.Add(new CChangesTableCellBorderTop(this, this.Pr.TableCellBorders.Left, NewBorder)); History.Add(new CChangesTableCellBorderLeft(this, this.Pr.TableCellBorders.Left, NewBorder));
this.Pr.TableCellBorders.Left = NewBorder; this.Pr.TableCellBorders.Left = NewBorder;
break; break;
} }
......
...@@ -352,16 +352,10 @@ CChangesTableCellBorderLeft.prototype.WriteToBinary = function(Writer) ...@@ -352,16 +352,10 @@ CChangesTableCellBorderLeft.prototype.WriteToBinary = function(Writer)
Writer.WriteLong(nFlags); Writer.WriteLong(nFlags);
if (undefined !== this.New && null !== this.New) if (undefined !== this.New && null !== this.New)
{
this.New = new CDocumentBorder();
this.New.Write_ToBinary(Writer); this.New.Write_ToBinary(Writer);
}
if (undefined !== this.Old && null !== this.Old) if (undefined !== this.Old && null !== this.Old)
{
this.Old = new CDocumentBorder();
this.Old.Write_ToBinary(Writer); this.Old.Write_ToBinary(Writer);
}
}; };
CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader) CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader)
{ {
...@@ -371,14 +365,8 @@ CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader) ...@@ -371,14 +365,8 @@ CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader)
// 3-bit : Is Old undefined? // 3-bit : Is Old undefined?
// 4-bit : Is Old null? // 4-bit : Is Old null?
// CTableMeasure : New.Left // CDocumentBorder : New
// CTableMeasure : New.Top // CDocumentBorder : Old
// CTableMeasure : New.Right
// CTableMeasure : New.Bottom
// CTableMeasure : Old.Left
// CTableMeasure : Old.Top
// CTableMeasure : Old.Right
// CTableMeasure : Old.Bottom
var nFlags = Reader.GetLong(); var nFlags = Reader.GetLong();
...@@ -392,17 +380,8 @@ CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader) ...@@ -392,17 +380,8 @@ CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.New = { this.New = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.New.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.New.Left.Read_FromBinary(Reader);
this.New.Top.Read_FromBinary(Reader);
this.New.Right.Read_FromBinary(Reader);
this.New.Bottom.Read_FromBinary(Reader);
} }
if (nFlags & 4) if (nFlags & 4)
...@@ -415,17 +394,8 @@ CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader) ...@@ -415,17 +394,8 @@ CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.Old = { this.Old = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.Old.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.Old.Left.Read_FromBinary(Reader);
this.Old.Top.Read_FromBinary(Reader);
this.Old.Right.Read_FromBinary(Reader);
this.Old.Bottom.Read_FromBinary(Reader);
} }
}; };
CChangesTableCellBorderLeft.prototype.private_SetValue = function(Value) CChangesTableCellBorderLeft.prototype.private_SetValue = function(Value)
...@@ -470,16 +440,10 @@ CChangesTableCellBorderTop.prototype.WriteToBinary = function(Writer) ...@@ -470,16 +440,10 @@ CChangesTableCellBorderTop.prototype.WriteToBinary = function(Writer)
Writer.WriteLong(nFlags); Writer.WriteLong(nFlags);
if (undefined !== this.New && null !== this.New) if (undefined !== this.New && null !== this.New)
{
this.New = new CDocumentBorder();
this.New.Write_ToBinary(Writer); this.New.Write_ToBinary(Writer);
}
if (undefined !== this.Old && null !== this.Old) if (undefined !== this.Old && null !== this.Old)
{
this.Old = new CDocumentBorder();
this.Old.Write_ToBinary(Writer); this.Old.Write_ToBinary(Writer);
}
}; };
CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader) CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader)
{ {
...@@ -489,14 +453,8 @@ CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader) ...@@ -489,14 +453,8 @@ CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader)
// 3-bit : Is Old undefined? // 3-bit : Is Old undefined?
// 4-bit : Is Old null? // 4-bit : Is Old null?
// CTableMeasure : New.Left // CDocumentBorder : New
// CTableMeasure : New.Top // CDocumentBorder : Old
// CTableMeasure : New.Right
// CTableMeasure : New.Bottom
// CTableMeasure : Old.Left
// CTableMeasure : Old.Top
// CTableMeasure : Old.Right
// CTableMeasure : Old.Bottom
var nFlags = Reader.GetLong(); var nFlags = Reader.GetLong();
...@@ -510,17 +468,8 @@ CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader) ...@@ -510,17 +468,8 @@ CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.New = { this.New = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.New.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.New.Left.Read_FromBinary(Reader);
this.New.Top.Read_FromBinary(Reader);
this.New.Right.Read_FromBinary(Reader);
this.New.Bottom.Read_FromBinary(Reader);
} }
if (nFlags & 4) if (nFlags & 4)
...@@ -533,17 +482,8 @@ CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader) ...@@ -533,17 +482,8 @@ CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.Old = { this.Old = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.Old.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.Old.Left.Read_FromBinary(Reader);
this.Old.Top.Read_FromBinary(Reader);
this.Old.Right.Read_FromBinary(Reader);
this.Old.Bottom.Read_FromBinary(Reader);
} }
}; };
CChangesTableCellBorderTop.prototype.private_SetValue = function(Value) CChangesTableCellBorderTop.prototype.private_SetValue = function(Value)
...@@ -588,16 +528,10 @@ CChangesTableCellBorderRight.prototype.WriteToBinary = function(Writer) ...@@ -588,16 +528,10 @@ CChangesTableCellBorderRight.prototype.WriteToBinary = function(Writer)
Writer.WriteLong(nFlags); Writer.WriteLong(nFlags);
if (undefined !== this.New && null !== this.New) if (undefined !== this.New && null !== this.New)
{
this.New = new CDocumentBorder();
this.New.Write_ToBinary(Writer); this.New.Write_ToBinary(Writer);
}
if (undefined !== this.Old && null !== this.Old) if (undefined !== this.Old && null !== this.Old)
{
this.Old = new CDocumentBorder();
this.Old.Write_ToBinary(Writer); this.Old.Write_ToBinary(Writer);
}
}; };
CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader) CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader)
{ {
...@@ -607,14 +541,8 @@ CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader) ...@@ -607,14 +541,8 @@ CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader)
// 3-bit : Is Old undefined? // 3-bit : Is Old undefined?
// 4-bit : Is Old null? // 4-bit : Is Old null?
// CTableMeasure : New.Left // CDocumentBorder : New
// CTableMeasure : New.Top // CDocumentBorder : Old
// CTableMeasure : New.Right
// CTableMeasure : New.Bottom
// CTableMeasure : Old.Left
// CTableMeasure : Old.Top
// CTableMeasure : Old.Right
// CTableMeasure : Old.Bottom
var nFlags = Reader.GetLong(); var nFlags = Reader.GetLong();
...@@ -628,17 +556,8 @@ CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader) ...@@ -628,17 +556,8 @@ CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.New = { this.New = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.New.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.New.Left.Read_FromBinary(Reader);
this.New.Top.Read_FromBinary(Reader);
this.New.Right.Read_FromBinary(Reader);
this.New.Bottom.Read_FromBinary(Reader);
} }
if (nFlags & 4) if (nFlags & 4)
...@@ -651,17 +570,8 @@ CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader) ...@@ -651,17 +570,8 @@ CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.Old = { this.Old = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.Old.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.Old.Left.Read_FromBinary(Reader);
this.Old.Top.Read_FromBinary(Reader);
this.Old.Right.Read_FromBinary(Reader);
this.Old.Bottom.Read_FromBinary(Reader);
} }
}; };
CChangesTableCellBorderRight.prototype.private_SetValue = function(Value) CChangesTableCellBorderRight.prototype.private_SetValue = function(Value)
...@@ -706,16 +616,10 @@ CChangesTableCellBorderBottom.prototype.WriteToBinary = function(Writer) ...@@ -706,16 +616,10 @@ CChangesTableCellBorderBottom.prototype.WriteToBinary = function(Writer)
Writer.WriteLong(nFlags); Writer.WriteLong(nFlags);
if (undefined !== this.New && null !== this.New) if (undefined !== this.New && null !== this.New)
{
this.New = new CDocumentBorder();
this.New.Write_ToBinary(Writer); this.New.Write_ToBinary(Writer);
}
if (undefined !== this.Old && null !== this.Old) if (undefined !== this.Old && null !== this.Old)
{
this.Old = new CDocumentBorder();
this.Old.Write_ToBinary(Writer); this.Old.Write_ToBinary(Writer);
}
}; };
CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader) CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader)
{ {
...@@ -725,14 +629,8 @@ CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader) ...@@ -725,14 +629,8 @@ CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader)
// 3-bit : Is Old undefined? // 3-bit : Is Old undefined?
// 4-bit : Is Old null? // 4-bit : Is Old null?
// CTableMeasure : New.Left // CDocumentBorder : New
// CTableMeasure : New.Top // CDocumentBorder : Old
// CTableMeasure : New.Right
// CTableMeasure : New.Bottom
// CTableMeasure : Old.Left
// CTableMeasure : Old.Top
// CTableMeasure : Old.Right
// CTableMeasure : Old.Bottom
var nFlags = Reader.GetLong(); var nFlags = Reader.GetLong();
...@@ -746,17 +644,8 @@ CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader) ...@@ -746,17 +644,8 @@ CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.New = { this.New = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.New.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.New.Left.Read_FromBinary(Reader);
this.New.Top.Read_FromBinary(Reader);
this.New.Right.Read_FromBinary(Reader);
this.New.Bottom.Read_FromBinary(Reader);
} }
if (nFlags & 4) if (nFlags & 4)
...@@ -769,17 +658,8 @@ CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader) ...@@ -769,17 +658,8 @@ CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader)
} }
else else
{ {
this.Old = { this.Old = new CDocumentBorder();
Left : new CTableMeasurement(tblwidth_Auto, 0), this.Old.Read_FromBinary(Reader);
Top : new CTableMeasurement(tblwidth_Auto, 0),
Right : new CTableMeasurement(tblwidth_Auto, 0),
Bottom : new CTableMeasurement(tblwidth_Auto, 0)
};
this.Old.Left.Read_FromBinary(Reader);
this.Old.Top.Read_FromBinary(Reader);
this.Old.Right.Read_FromBinary(Reader);
this.Old.Bottom.Read_FromBinary(Reader);
} }
}; };
CChangesTableCellBorderBottom.prototype.private_SetValue = function(Value) CChangesTableCellBorderBottom.prototype.private_SetValue = function(Value)
......
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