Commit b00733f2 authored by KirillovIlya's avatar KirillovIlya

Добавлено новое свойство NoWrap для ячейки (пока без обработки): сделано его...

Добавлено новое свойство NoWrap для ячейки (пока без обработки): сделано его выставление у теблицы, и сделана работа в апи.
parent b9deb300
/*
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
......@@ -1109,6 +1109,7 @@ var historyitem_TableCell_VAlign = 9; // Изменяем вертика
var historyitem_TableCell_W = 10; // Изменяем ширину ячейки
var historyitem_TableCell_Pr = 11; // Изменяем настройки целиком
var historyitem_TableCell_TextDirection = 12; // Изменяем направление текста
var historyitem_TableCell_NoWrap = 13; // Изменяем настройку NoWrap
// Типы изменений в классе CDocumentContent
var historyitem_DocumentContent_AddItem = 1; // Добавляем элемент в документ
......
......@@ -6433,6 +6433,7 @@ function CTableCellPr()
this.VAlign = undefined;
this.VMerge = undefined;
this.TextDirection = undefined;
this.NoWrap = undefined;
}
CTableCellPr.prototype =
......@@ -6477,6 +6478,7 @@ CTableCellPr.prototype =
CellPr.VAlign = this.VAlign;
CellPr.VMerge = this.VMerge;
CellPr.TextDirection = this.TextDirection;
CellPr.NoWrap = this.NoWrap;
return CellPr;
},
......@@ -6525,6 +6527,9 @@ CTableCellPr.prototype =
if (undefined != CellPr.TextDirection)
this.TextDirection = CellPr.TextDirection;
if (undefined !== CellPr.NoWrap)
this.NoWrap = CellPr.NoWrap;
},
Is_Equal : function(CellPr)
......@@ -6552,7 +6557,8 @@ CTableCellPr.prototype =
|| true !== IsEqualStyleObjects(this.TableCellW, CellPr.TableCellW)
|| this.VAlign !== CellPr.VAlign
|| this.VMerge !== CellPr.VMerge
|| this.TextDirection !== CellPr.TextDirection)
|| this.TextDirection !== CellPr.TextDirection
|| this.NoWrap !== CellPr.NoWrap)
return false;
return true;
......@@ -6571,6 +6577,7 @@ CTableCellPr.prototype =
this.VAlign = vertalignjc_Top;
this.VMerge = vmerge_Restart;
this.TextDirection = textdirection_LRTB;
this.NoWrap = false;
},
Set_FromObject : function(CellPr)
......@@ -6665,6 +6672,7 @@ CTableCellPr.prototype =
this.VAlign = CellPr.VAlign;
this.VMerge = CellPr.VMerge;
this.TextDirection = CellPr.TextDirection;
this.NoWrap = CellPr.NoWrap;
},
Check_PresentationPr : function(Theme)
......@@ -6793,6 +6801,12 @@ CTableCellPr.prototype =
Flags |= 32768;
}
if (undefined !== this.NoWrap)
{
Writer.WriteBool(this.NoWrap);
Flags |= 65536;
}
var EndPos = Writer.GetCurPosition();
Writer.Seek( StartPos );
Writer.WriteLong( Flags );
......@@ -6880,6 +6894,9 @@ CTableCellPr.prototype =
if (32768 & Flags)
this.TextDirection = Reader.GetLong();
if (65536 & Flags)
this.NoWrap = Reader.GetBool();
}
};
......
......@@ -294,6 +294,7 @@ CTable.prototype =
var VAlign = null;
var TextDirection = null;
var NoWrap = null;
for ( var Index = 0; Index < this.Selection.Data.length; Index++ )
{
......@@ -308,14 +309,18 @@ CTable.prototype =
{
VAlign = Cell.Get_VAlign();
TextDirection = Cell.Get_TextDirection();
NoWrap = Cell.Get_NoWrap();
}
else
{
if ( VAlign != Cell.Get_VAlign() )
if (VAlign !== Cell.Get_VAlign())
VAlign = null;
if (TextDirection !== Cell.Get_TextDirection())
TextDirection = null;
if (NoWrap !== Cell.Get_NoWrap())
NoWrap = null;
}
if ( 0 === Index )
......@@ -436,6 +441,7 @@ CTable.prototype =
Pr.CellsVAlign = VAlign;
Pr.CellsTextDirection = TextDirection;
Pr.CellsNoWrap = NoWrap;
Pr.CellBorders =
{
......@@ -504,10 +510,11 @@ CTable.prototype =
}
Pr.CellsVAlign = Cell.Get_VAlign();
Pr.CellsTextDirection = Cell.Get_TextDirection();
Pr.CellsNoWrap = Cell.Get_NoWrap();
Pr.CellsBackground = CellShd.Copy();
Pr.CellsTextDirection = Cell.Get_TextDirection();
var Spacing = this.Content[0].Get_CellSpacing();
if ( null === Spacing )
......@@ -1909,6 +1916,25 @@ CTable.prototype =
}
}
// CellsNoWrap
if (undefined !== Props.CellsNoWrap && null !== Props.CellsNoWrap)
{
if (this.Selection.Use === true && table_Selection_Cell === this.Selection.Type)
{
var Count = this.Selection.Data.length;
for (var Index = 0; Index < Count; ++Index)
{
var Pos = this.Selection.Data[Index];
var Cell = this.Content[Pos.Row].Get_Cell(Pos.Cell);
Cell.Set_NoWrap(Props.CellsNoWrap);
}
}
else
{
this.CurCell.Set_NoWrap(Props.CellsNoWrap);
}
}
return true;
},
......
......@@ -1111,6 +1111,9 @@ CTableCell.prototype =
// TextDirection
this.Set_TextDirection(OtherPr.TextDirection);
// NoWrap
this.Set_NoWrap(OtherPr.NoWrap);
},
Get_W : function()
......@@ -1386,6 +1389,21 @@ CTableCell.prototype =
}
},
Get_NoWrap : function()
{
return this.Get_CompiledPr(false).NoWrap;
},
Set_NoWrap : function(Value)
{
if (this.Pr.NoWrap !== Value)
{
History.Add(this, {Type : historyitem_TableCell_NoWrap, Old : this.Pr.NoWrap, New : Value});
this.Pr.NoWrap = Value;
this.Recalc_CompiledPr();
}
},
Is_VerticalText : function()
{
var TextDirection = this.Get_TextDirection();
......@@ -1781,6 +1799,13 @@ CTableCell.prototype =
this.Recalc_CompiledPr();
break;
}
case historyitem_TableCell_NoWrap:
{
this.Pr.NoWrap = Data.Old;
this.Recalc_CompiledPr();
break;
}
}
},
......@@ -1912,6 +1937,12 @@ CTableCell.prototype =
this.Recalc_CompiledPr();
break;
}
case historyitem_TableCell_NoWrap:
{
this.Pr.NoWrap = Data.New;
this.Recalc_CompiledPr();
break;
}
}
},
......@@ -1938,6 +1969,7 @@ CTableCell.prototype =
case historyitem_TableCell_W:
case historyitem_TableCell_Pr:
case historyitem_TableCell_TextDirection:
case historyitem_TableCell_NoWrap:
{
bNeedRecalc = true;
break;
......@@ -2162,6 +2194,23 @@ CTableCell.prototype =
Writer.WriteLong(Data.New);
}
}
case historyitem_TableCell_NoWrap:
{
// Bool : IsUndefined
// false - > Bool : NoWrap
if (undefined === Data.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Writer.WriteBool(Data.New);
}
break;
}
}
return Writer;
......@@ -2451,6 +2500,20 @@ CTableCell.prototype =
this.Recalc_CompiledPr();
break;
}
case historyitem_TableCell_NoWrap:
{
// Bool : IsUndefined
// false - > Bool : NoWrap
if (true === Reader.GetBool())
this.Pr.NoWrap = undefined;
else
this.Pr.NoWrap = Reader.GetBool();
this.Recalc_CompiledPr();
break;
}
}
},
......
/*
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
......@@ -4111,21 +4111,21 @@ function CTableProp (tblProp)
this.CellSelect = (undefined != tblProp.CellSelect) ? tblProp.CellSelect : false;
this.TableWidth = (undefined != tblProp.TableWidth) ? tblProp.TableWidth : null;
this.TableSpacing = (undefined != tblProp.TableSpacing) ? tblProp.TableSpacing : null;
this.TableDefaultMargins = (undefined != tblProp.TableDefaultMargins && null != tblProp.TableDefaultMargins) ? new asc_CPaddings (tblProp.TableDefaultMargins) : null;
this.TableDefaultMargins = (undefined != tblProp.TableDefaultMargins && null != tblProp.TableDefaultMargins) ? new asc_CPaddings(tblProp.TableDefaultMargins) : null;
this.CellMargins = (undefined != tblProp.CellMargins && null != tblProp.CellMargins) ? new CMargins (tblProp.CellMargins) : null;
this.CellMargins = (undefined != tblProp.CellMargins && null != tblProp.CellMargins) ? new CMargins(tblProp.CellMargins) : null;
this.TableAlignment = (undefined != tblProp.TableAlignment) ? tblProp.TableAlignment : null;
this.TableIndent = (undefined != tblProp.TableIndent) ? tblProp.TableIndent : null;
this.TableWrappingStyle = (undefined != tblProp.TableWrappingStyle) ? tblProp.TableWrappingStyle : null;
this.TablePaddings = (undefined != tblProp.TablePaddings && null != tblProp.TablePaddings) ? new asc_CPaddings (tblProp.TablePaddings) : null;
this.TablePaddings = (undefined != tblProp.TablePaddings && null != tblProp.TablePaddings) ? new asc_CPaddings(tblProp.TablePaddings) : null;
this.TableBorders = (undefined != tblProp.TableBorders && null != tblProp.TableBorders) ? new CBorders (tblProp.TableBorders) : null;
this.CellBorders = (undefined != tblProp.CellBorders && null != tblProp.CellBorders) ? new CBorders (tblProp.CellBorders) : null;
this.TableBackground = (undefined != tblProp.TableBackground && null != tblProp.TableBackground) ? new CBackground (tblProp.TableBackground) : null;
this.CellsBackground = (undefined != tblProp.CellsBackground && null != tblProp.CellsBackground) ? new CBackground (tblProp.CellsBackground) : null;
this.Position = (undefined != tblProp.Position && null != tblProp.Position) ? new CPosition (tblProp.Position) : null;
this.TableBorders = (undefined != tblProp.TableBorders && null != tblProp.TableBorders) ? new CBorders(tblProp.TableBorders) : null;
this.CellBorders = (undefined != tblProp.CellBorders && null != tblProp.CellBorders) ? new CBorders(tblProp.CellBorders) : null;
this.TableBackground = (undefined != tblProp.TableBackground && null != tblProp.TableBackground) ? new CBackground(tblProp.TableBackground) : null;
this.CellsBackground = (undefined != tblProp.CellsBackground && null != tblProp.CellsBackground) ? new CBackground(tblProp.CellsBackground) : null;
this.Position = (undefined != tblProp.Position && null != tblProp.Position) ? new CPosition(tblProp.Position) : null;
this.PositionH = ( undefined != tblProp.PositionH && null != tblProp.PositionH ) ? new CTablePositionH(tblProp.PositionH) : undefined;
this.PositionV = ( undefined != tblProp.PositionV && null != tblProp.PositionV ) ? new CTablePositionV(tblProp.PositionV) : undefined;
this.Internal_Position = ( undefined != tblProp.Internal_Position ) ? tblProp.Internal_Position : undefined;
......@@ -4134,10 +4134,11 @@ function CTableProp (tblProp)
this.TableStyle = (undefined != tblProp.TableStyle) ? tblProp.TableStyle : null;
this.TableLook = (undefined != tblProp.TableLook) ? new CTablePropLook(tblProp.TableLook) : null;
this.RowsInHeader = (undefined != tblProp.RowsInHeader) ? tblProp.RowsInHeader : 0;
this.CellsVAlign = (undefined != tblProp.CellsVAlign) ? tblProp.CellsVAlign :c_oAscVertAlignJc.Top;
this.CellsVAlign = (undefined != tblProp.CellsVAlign) ? tblProp.CellsVAlign : c_oAscVertAlignJc.Top;
this.AllowOverlap = (undefined != tblProp.AllowOverlap) ? tblProp.AllowOverlap : undefined;
this.TableLayout = tblProp.TableLayout;
this.CellsTextDirection = tblProp.CellsTextDirection;
this.CellsNoWrap = tblProp.CellsNoWrap;
this.Locked = (undefined != tblProp.Locked) ? tblProp.Locked : false;
}
else
......@@ -4220,6 +4221,8 @@ CTableProp.prototype.get_TableLayout = function() {return this.TableLayout;};
CTableProp.prototype.put_TableLayout = function(v){this.TableLayout = v;};
CTableProp.prototype.get_CellsTextDirection = function(){return this.CellsTextDirection;};
CTableProp.prototype.put_CellsTextDirection = function(v){this.CellsTextDirection = v;};
CTableProp.prototype.get_CellsNoWrap = function(){return this.CellsNoWrap;};
CTableProp.prototype.put_CellsNoWrap = function(v){this.CellsNoWrap = v;};
function CBorders (obj)
{
......
......@@ -683,6 +683,9 @@ CTableProp.prototype['get_TableLayout'] = CTableProp.prototype.get_TableLayout;
CTableProp.prototype['put_TableLayout'] = CTableProp.prototype.put_TableLayout;
CTableProp.prototype['get_CellsTextDirection'] = CTableProp.prototype.get_CellsTextDirection;
CTableProp.prototype['put_CellsTextDirection'] = CTableProp.prototype.put_CellsTextDirection;
CTableProp.prototype['get_CellsNoWrap'] = CTableProp.prototype.get_CellsNoWrap;
CTableProp.prototype['put_CellsNoWrap'] = CTableProp.prototype.put_CellsNoWrap;
window['CBorders'] = CBorders;
CBorders.prototype['get_Left'] = CBorders.prototype.get_Left;
CBorders.prototype['put_Left'] = CBorders.prototype.put_Left;
......
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