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; // Добавляем элемент в документ
......
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
/**
......@@ -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();
}
};
......
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
/**
......@@ -292,8 +292,9 @@ CTable.prototype =
var Prev_row = -1;
var bFirstRow = true;
var VAlign = null;
var VAlign = null;
var TextDirection = null;
var NoWrap = null;
for ( var Index = 0; Index < this.Selection.Data.length; Index++ )
{
......@@ -306,16 +307,20 @@ CTable.prototype =
if ( 0 === Index )
{
VAlign = Cell.Get_VAlign();
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 )
......@@ -434,8 +439,9 @@ CTable.prototype =
}
}
Pr.CellsVAlign = VAlign;
Pr.CellsVAlign = VAlign;
Pr.CellsTextDirection = TextDirection;
Pr.CellsNoWrap = NoWrap;
Pr.CellBorders =
{
......@@ -503,11 +509,12 @@ CTable.prototype =
};
}
Pr.CellsVAlign = Cell.Get_VAlign();
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;
},
......
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
/**
* User: Ilja.Kirillov
......@@ -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;
}
}
},
......
This diff is collapsed.
......@@ -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