Commit 1b4850e9 authored by Ilya Kirillov's avatar Ilya Kirillov

В связи с правкой бага 32174, сделано, чтобы в табличных свойствах можно было...

В связи с правкой бага 32174, сделано, чтобы в табличных свойствах можно было получить значение по которому можно переводить абсолютные ширины в процентные и наоборот.
parent b4be6771
...@@ -765,6 +765,8 @@ CTable.prototype = ...@@ -765,6 +765,8 @@ CTable.prototype =
this.DrawingDocument.CheckTableStyles( new Asc.CTablePropLook( this.TableLook ) ); this.DrawingDocument.CheckTableStyles( new Asc.CTablePropLook( this.TableLook ) );
} }
Pr.PercentFullWidth = this.private_RecalculatePercentWidth();
return Pr; return Pr;
}, },
......
...@@ -223,7 +223,7 @@ CTable.prototype.private_RecalculateGrid = function() ...@@ -223,7 +223,7 @@ CTable.prototype.private_RecalculateGrid = function()
SumGrid[Index] = TempSum; SumGrid[Index] = TempSum;
} }
var PctWidth = this.XLimit - this.X - this.Get_TableOffsetCorrection() + this.Get_RightTableOffsetCorrection(); var PctWidth = this.private_RecalculatePercentWidth();
var MinWidth = this.Internal_Get_TableMinWidth(); var MinWidth = this.Internal_Get_TableMinWidth();
var TableW = 0; var TableW = 0;
if (tblwidth_Auto === TablePr.TableW.Type) if (tblwidth_Auto === TablePr.TableW.Type)
...@@ -3000,6 +3000,10 @@ CTable.prototype.private_RecalculateSkipPage = function(CurPage) ...@@ -3000,6 +3000,10 @@ CTable.prototype.private_RecalculateSkipPage = function(CurPage)
this.Pages[CurPage].LastRow = FirstRow -1; this.Pages[CurPage].LastRow = FirstRow -1;
} }
}; };
CTable.prototype.private_RecalculatePercentWidth = function()
{
return this.XLimit - this.X - this.Get_TableOffsetCorrection() + this.Get_RightTableOffsetCorrection();
};
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// Класс CTablePage // Класс CTablePage
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
......
...@@ -4260,70 +4260,71 @@ function CTablePropLook(obj) ...@@ -4260,70 +4260,71 @@ function CTablePropLook(obj)
function CTableProp (tblProp) function CTableProp (tblProp)
{ {
if (tblProp) if (tblProp)
{ {
this.CanBeFlow = (undefined != tblProp.CanBeFlow ? tblProp.CanBeFlow : false ); this.CanBeFlow = (undefined != tblProp.CanBeFlow ? tblProp.CanBeFlow : false );
this.CellSelect = (undefined != tblProp.CellSelect ? tblProp.CellSelect : false ); this.CellSelect = (undefined != tblProp.CellSelect ? tblProp.CellSelect : false );
this.CellSelect = (undefined != tblProp.CellSelect) ? tblProp.CellSelect : false; this.CellSelect = (undefined != tblProp.CellSelect) ? tblProp.CellSelect : false;
this.TableWidth = (undefined != tblProp.TableWidth) ? tblProp.TableWidth : null; this.TableWidth = (undefined != tblProp.TableWidth) ? tblProp.TableWidth : null;
this.TableSpacing = (undefined != tblProp.TableSpacing) ? tblProp.TableSpacing : null; this.TableSpacing = (undefined != tblProp.TableSpacing) ? tblProp.TableSpacing : null;
this.TableDefaultMargins = (undefined != tblProp.TableDefaultMargins && null != tblProp.TableDefaultMargins) ? new Asc.asc_CPaddings(tblProp.TableDefaultMargins) : null; this.TableDefaultMargins = (undefined != tblProp.TableDefaultMargins && null != tblProp.TableDefaultMargins) ? new Asc.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.TableAlignment = (undefined != tblProp.TableAlignment) ? tblProp.TableAlignment : null;
this.TableIndent = (undefined != tblProp.TableIndent) ? tblProp.TableIndent : null; this.TableIndent = (undefined != tblProp.TableIndent) ? tblProp.TableIndent : null;
this.TableWrappingStyle = (undefined != tblProp.TableWrappingStyle) ? tblProp.TableWrappingStyle : null; this.TableWrappingStyle = (undefined != tblProp.TableWrappingStyle) ? tblProp.TableWrappingStyle : null;
this.TablePaddings = (undefined != tblProp.TablePaddings && null != tblProp.TablePaddings) ? new Asc.asc_CPaddings(tblProp.TablePaddings) : null; this.TablePaddings = (undefined != tblProp.TablePaddings && null != tblProp.TablePaddings) ? new Asc.asc_CPaddings(tblProp.TablePaddings) : null;
this.TableBorders = (undefined != tblProp.TableBorders && null != tblProp.TableBorders) ? new CBorders(tblProp.TableBorders) : 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.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.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.CellsBackground = (undefined != tblProp.CellsBackground && null != tblProp.CellsBackground) ? new CBackground(tblProp.CellsBackground) : null;
this.Position = (undefined != tblProp.Position && null != tblProp.Position) ? new Asc.CPosition(tblProp.Position) : null; this.Position = (undefined != tblProp.Position && null != tblProp.Position) ? new Asc.CPosition(tblProp.Position) : null;
this.PositionH = ( undefined != tblProp.PositionH && null != tblProp.PositionH ) ? new CTablePositionH(tblProp.PositionH) : undefined; 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.PositionV = ( undefined != tblProp.PositionV && null != tblProp.PositionV ) ? new CTablePositionV(tblProp.PositionV) : undefined;
this.Internal_Position = ( undefined != tblProp.Internal_Position ) ? tblProp.Internal_Position : undefined; this.Internal_Position = ( undefined != tblProp.Internal_Position ) ? tblProp.Internal_Position : undefined;
this.ForSelectedCells = (undefined != tblProp.ForSelectedCells) ? tblProp.ForSelectedCells : true; this.ForSelectedCells = (undefined != tblProp.ForSelectedCells) ? tblProp.ForSelectedCells : true;
this.TableStyle = (undefined != tblProp.TableStyle) ? tblProp.TableStyle : null; this.TableStyle = (undefined != tblProp.TableStyle) ? tblProp.TableStyle : null;
this.TableLook = (undefined != tblProp.TableLook) ? new CTablePropLook(tblProp.TableLook) : null; this.TableLook = (undefined != tblProp.TableLook) ? new CTablePropLook(tblProp.TableLook) : null;
this.RowsInHeader = (undefined != tblProp.RowsInHeader) ? tblProp.RowsInHeader : 0; 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.AllowOverlap = (undefined != tblProp.AllowOverlap) ? tblProp.AllowOverlap : undefined;
this.TableLayout = tblProp.TableLayout; this.TableLayout = tblProp.TableLayout;
this.CellsTextDirection = tblProp.CellsTextDirection; this.CellsTextDirection = tblProp.CellsTextDirection;
this.CellsNoWrap = tblProp.CellsNoWrap; this.CellsNoWrap = tblProp.CellsNoWrap;
this.CellsWidth = tblProp.CellsWidth; this.CellsWidth = tblProp.CellsWidth;
this.Locked = (undefined != tblProp.Locked) ? tblProp.Locked : false; this.Locked = (undefined != tblProp.Locked) ? tblProp.Locked : false;
} this.PercentFullWidth = tblProp.PercentFullWidth;
else }
{ else
//Все свойства класса CTableProp должны быть undefined если они не изменялись {
//Все свойства класса CTableProp должны быть undefined если они не изменялись
//this.CanBeFlow = false; //this.CanBeFlow = false;
this.CellSelect = false; //обязательное свойство this.CellSelect = false; //обязательное свойство
/*this.TableWidth = null; /*this.TableWidth = null;
this.TableSpacing = null; this.TableSpacing = null;
this.TableDefaultMargins = new Asc.asc_CPaddings (); this.TableDefaultMargins = new Asc.asc_CPaddings ();
this.CellMargins = new CMargins (); this.CellMargins = new CMargins ();
this.TableAlignment = 0; this.TableAlignment = 0;
this.TableIndent = 0; this.TableIndent = 0;
this.TableWrappingStyle = c_oAscWrapStyle.Inline; this.TableWrappingStyle = c_oAscWrapStyle.Inline;
this.TablePaddings = new Asc.asc_CPaddings (); this.TablePaddings = new Asc.asc_CPaddings ();
this.TableBorders = new CBorders (); this.TableBorders = new CBorders ();
this.CellBorders = new CBorders (); this.CellBorders = new CBorders ();
this.TableBackground = new CBackground (); this.TableBackground = new CBackground ();
this.CellsBackground = new CBackground ();; this.CellsBackground = new CBackground ();;
this.Position = new CPosition (); this.Position = new CPosition ();
this.ForSelectedCells = true;*/ this.ForSelectedCells = true;*/
this.Locked = false; this.Locked = false;
} }
} }
CTableProp.prototype.get_Width = function() CTableProp.prototype.get_Width = function()
...@@ -4552,6 +4553,10 @@ function CTableProp (tblProp) ...@@ -4552,6 +4553,10 @@ function CTableProp (tblProp)
{ {
this.CellsWidth = v; this.CellsWidth = v;
}; };
CTableProp.prototype.get_PercentFullWidth = function()
{
return this.PercentFullWidth;
};
function CBorders (obj) function CBorders (obj)
...@@ -8946,6 +8951,7 @@ CTableProp.prototype['get_CellsNoWrap'] = CTableProp.prototype.get_CellsN ...@@ -8946,6 +8951,7 @@ CTableProp.prototype['get_CellsNoWrap'] = CTableProp.prototype.get_CellsN
CTableProp.prototype['put_CellsNoWrap'] = CTableProp.prototype.put_CellsNoWrap; CTableProp.prototype['put_CellsNoWrap'] = CTableProp.prototype.put_CellsNoWrap;
CTableProp.prototype['get_CellsWidth'] = CTableProp.prototype.get_CellsWidth; CTableProp.prototype['get_CellsWidth'] = CTableProp.prototype.get_CellsWidth;
CTableProp.prototype['put_CellsWidth'] = CTableProp.prototype.put_CellsWidth; CTableProp.prototype['put_CellsWidth'] = CTableProp.prototype.put_CellsWidth;
CTableProp.prototype['get_PercentFullWidth'] = CTableProp.prototype.get_PercentFullWidth;
window['Asc']['CBorders'] = window['Asc'].CBorders = CBorders; window['Asc']['CBorders'] = window['Asc'].CBorders = CBorders;
CBorders.prototype['get_Left'] = CBorders.prototype.get_Left; CBorders.prototype['get_Left'] = CBorders.prototype.get_Left;
CBorders.prototype['put_Left'] = CBorders.prototype.put_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