Commit 12f32054 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

Tables menu

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57960 954022d7-b5bf-4e40-9824-e11837661b57
parent 7d07951e
......@@ -1404,164 +1404,988 @@ asc_docs_api.prototype["Call_Menu_Event"] = function(type, _params)
this.add_SectionBreak(_params[0]);
break;
}
case 10: // ASC_MENU_EVENT_TYPE_TABLE
{
var _tablePr = new CTableProp();
while (_continue)
{
var _attr = _params[_current.pos++];
switch (_attr)
{
case 0:
{
_textPr.CanBeFlow = _params[_current.pos++];
break;
}
case 1:
{
_textPr.CellSelect = _params[_current.pos++];
break;
}
case 2:
{
_textPr.TableWidth = _params[_current.pos++];
break;
}
case 3:
{
_textPr.TableSpacing = _params[_current.pos++];
break;
}
case 4:
{
_textPr.TableDefaultMargins = asc_menu_ReadPaddings(_params, _current);
break;
}
case 5:
{
_textPr.CellMargins = asc_menu_ReadCellMargins(_params, _current);
break;
}
case 6:
{
_textPr.TableAlignment = _params[_current.pos++];
break;
}
case 7:
{
_textPr.TableIndent = _params[_current.pos++];
break;
}
case 8:
{
_textPr.TableWrappingStyle = _params[_current.pos++];
break;
}
case 9:
{
_tablePr.TablePaddings = asc_menu_ReadPaddings(_params, _current);
break;
}
case 10:
{
_tablePr.TablePaddings = asc_menu_ReadCellBorders(_params, _current);
break;
}
case 11:
{
_tablePr.CellBorders = asc_menu_ReadCellBorders(_params, _current);
break;
}
case 12:
{
_tablePr.TableBackground = asc_menu_ReadCellBackground(_params, _current);
break;
}
case 13:
{
_tablePr.CellsBackground = asc_menu_ReadCellBackground(_params, _current);
break;
}
case 14:
{
_tablePr.Position = asc_menu_ReadPosition(_params, _current);
break;
}
case 15:
{
_tablePr.PositionH = asc_menu_ReadImagePosition(_params, _current);
break;
}
case 16:
{
_tablePr.PositionV = asc_menu_ReadImagePosition(_params, _current);
break;
}
case 17:
{
_tablePr.Internal_Position = asc_menu_ReadTableAnchorPosition(_params, _current);
break;
}
case 18:
{
_textPr.ForSelectedCells = _params[_current.pos++];
break;
}
case 19:
{
_textPr.TableStyle = _params[_current.pos++];
break;
}
case 20:
{
_textPr.TableLook = asc_menu_ReadTableLook(_params, _current);
break;
}
case 21:
{
_textPr.RowsInHeader = _params[_current.pos++];
break;
}
case 22:
{
_textPr.CellsVAlign = _params[_current.pos++];
break;
}
case 23:
{
_textPr.AllowOverlap = _params[_current.pos++];
break;
}
case 24:
{
_textPr.TableLayout = _params[_current.pos++];
break;
}
case 25:
{
_textPr.Locked = _params[_current.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
this.tblApply(_tablePr);
break;
}
case 15: // ASC_MENU_EVENT_TYPE_TABLEMERGECELLS
{
this.MergeCells();
break;
}
case 16: // ASC_MENU_EVENT_TYPE_TABLESPLITCELLS
{
this.SplitCell(_params[0], _params[1]);
break;
}
case 51: // ASC_MENU_EVENT_TYPE_INSERT_TABLE
{
var _rows = 2;
var _cols = 2;
var _style = null;
while (_continue)
{
var _attr = _params[_current.pos++];
switch (_attr)
{
case 0:
{
_rows = _params[_current.pos++];
break;
}
case 1:
{
_cols = _params[_current.pos++];
break;
}
case 2:
{
_style = _params[_current.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Document_Content_Add) )
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.Add_InlineTable(_rows, _cols);
}
break;
}
default:
break;
}
};
};
function asc_menu_WriteHeaderFooterPr(_hdrftrPr, _stream)
{
if (_hdrftrPr.Type !== undefined && _hdrftrPr.Type !== null)
{
_stream["WriteByte"](0);
_stream["WriteLong"](_hdrftrPr.Type);
}
if (_hdrftrPr.Position !== undefined && _hdrftrPr.Position !== null)
{
_stream["WriteByte"](1);
_stream["WriteDouble2"](_hdrftrPr.Position);
}
if (_hdrftrPr.DifferentFirst !== undefined && _hdrftrPr.DifferentFirst !== null)
{
_stream["WriteByte"](2);
_stream["WriteBool"](_hdrftrPr.DifferentFirst);
}
if (_hdrftrPr.DifferentEvenOdd !== undefined && _hdrftrPr.DifferentEvenOdd !== null)
{
_stream["WriteByte"](3);
_stream["WriteBool"](_hdrftrPr.DifferentEvenOdd);
}
if (_hdrftrPr.LinkToPrevious !== undefined && _hdrftrPr.LinkToPrevious !== null)
{
_stream["WriteByte"](4);
_stream["WriteBool"](_hdrftrPr.LinkToPrevious);
}
if (_hdrftrPr.Locked !== undefined && _hdrftrPr.Locked !== null)
{
_stream["WriteByte"](5);
_stream["WriteBool"](_hdrftrPr.DifferentFirst);
}
_stream["WriteByte"](255);
}
function asc_menu_WriteParagraphPr(_paraPr, _stream)
{
if (_paraPr.ContextualSpacing !== undefined && _paraPr.ContextualSpacing !== null)
{
_stream["WriteByte"](0);
_stream["WriteBool"](_paraPr.ContextualSpacing);
}
asc_menu_WriteParaInd(1, _paraPr.Ind, _stream);
if (_paraPr.KeepLines !== undefined && _paraPr.KeepLines !== null)
{
_stream["WriteByte"](2);
_stream["WriteBool"](_paraPr.KeepLines);
}
if (_paraPr.KeepNext !== undefined && _paraPr.KeepNext !== null)
{
_stream["WriteByte"](3);
_stream["WriteBool"](_paraPr.KeepNext);
}
if (_paraPr.WidowControl !== undefined && _paraPr.WidowControl !== null)
{
_stream["WriteByte"](4);
_stream["WriteBool"](_paraPr.WidowControl);
}
if (_paraPr.PageBreakBefore !== undefined && _paraPr.PageBreakBefore !== null)
{
_stream["WriteByte"](5);
_stream["WriteBool"](_paraPr.PageBreakBefore);
}
asc_menu_WriteParaSpacing(6, _paraPr.Spacing, _stream);
asc_menu_WriteParaBorders(7, _paraPr.Brd, _stream);
asc_menu_WriteParaShd(8, _paraPr.Shd, _stream);
if (_paraPr.Locked !== undefined && _paraPr.Locked !== null)
{
_stream["WriteByte"](9);
_stream["WriteBool"](_paraPr.Locked);
}
if (_paraPr.CanAddTable !== undefined && _paraPr.CanAddTable !== null)
{
_stream["WriteByte"](10);
_stream["WriteBool"](_paraPr.CanAddTable);
}
if (_paraPr.CanAddDropCap !== undefined && _paraPr.CanAddDropCap !== null)
{
_stream["WriteByte"](11);
_stream["WriteBool"](_paraPr.CanAddDropCap);
}
if (_paraPr.DefaultTab !== undefined && _paraPr.DefaultTab !== null)
{
_stream["WriteByte"](12);
_stream["WriteDouble2"](_paraPr.DefaultTab);
}
asc_menu_WriteParaTabs(13, _paraPr.Tabs, _stream);
asc_menu_WriteParaFrame(14, _paraPr.FramePr, _stream);
if (_paraPr.Subscript !== undefined && _paraPr.Subscript !== null)
{
_stream["WriteByte"](15);
_stream["WriteBool"](_paraPr.Subscript);
}
if (_paraPr.Superscript !== undefined && _paraPr.Superscript !== null)
{
_stream["WriteByte"](16);
_stream["WriteBool"](_paraPr.Superscript);
}
if (_paraPr.SmallCaps !== undefined && _paraPr.SmallCaps !== null)
{
_stream["WriteByte"](17);
_stream["WriteBool"](_paraPr.SmallCaps);
}
if (_paraPr.AllCaps !== undefined && _paraPr.AllCaps !== null)
{
_stream["WriteByte"](18);
_stream["WriteBool"](_paraPr.AllCaps);
}
if (_paraPr.Strikeout !== undefined && _paraPr.Strikeout !== null)
{
_stream["WriteByte"](19);
_stream["WriteBool"](_paraPr.Strikeout);
}
if (_paraPr.DStrikeout !== undefined && _paraPr.DStrikeout !== null)
{
_stream["WriteByte"](20);
_stream["WriteBool"](_paraPr.DStrikeout);
}
if (_paraPr.TextSpacing !== undefined && _paraPr.TextSpacing !== null)
{
_stream["WriteByte"](21);
_stream["WriteDouble2"](_paraPr.TextSpacing);
}
if (_paraPr.Position !== undefined && _paraPr.Position !== null)
{
_stream["WriteByte"](22);
_stream["WriteDouble2"](_paraPr.Position);
}
asc_menu_WriteParaListType(23, _paraPr.ListType, _stream);
if (_paraPr.StyleName !== undefined && _paraPr.StyleName !== null)
{
_stream["WriteByte"](24);
_stream["WriteString2"](_paraPr.StyleName);
}
if (_paraPr.Jc !== undefined && _paraPr.Jc !== null)
{
_stream["WriteByte"](25);
_stream["WriteLong"](_paraPr.Jc);
}
_stream["WriteByte"](255);
}
///////////////////////////////////////////////////////////////////////////
// TABLE
///////////////////////////////////////////////////////////////////////////
function asc_menu_ReadPaddings(_params, _cursor)
{
var _paddings = new CPaddings();
var _continue = true;
while (_continue)
{
var _attr = _params[_cursor.pos++];
switch (_attr)
{
case 0:
{
_paddings.Left = _params[_cursor.pos++];
break;
}
case 1:
{
_paddings.Top = _params[_cursor.pos++];
break;
}
case 2:
{
_paddings.Right = _params[_cursor.pos++];
break;
}
case 3:
{
_paddings.Bottom = _params[_cursor.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
return _paddings;
}
function asc_menu_WritePaddings(_type, _paddings, _stream)
{
if (undefined === _paddings)
return;
_stream["WriteByte"](_type);
if (_paddings.Left !== undefined && _paddings.Left !== null)
{
_stream["WriteByte"](0);
_stream["WriteDouble2"](_paddings.Left);
}
if (_paddings.Top !== undefined && _paddings.Top !== null)
{
_stream["WriteByte"](1);
_stream["WriteDouble2"](_paddings.Top);
}
if (_paddings.Right !== undefined && _paddings.Right !== null)
{
_stream["WriteByte"](2);
_stream["WriteDouble2"](_paddings.Right);
}
if (_paddings.Bottom !== undefined && _paddings.Bottom !== null)
{
_stream["WriteByte"](3);
_stream["WriteDouble2"](_paddings.Bottom);
}
_stream["WriteByte"](255);
}
function asc_menu_ReadCellMargins(_params, _cursor)
{
var _paddings = new CMargins();
var _continue = true;
while (_continue)
{
var _attr = _params[_cursor.pos++];
switch (_attr)
{
case 0:
{
_paddings.Left = _params[_cursor.pos++];
break;
}
case 1:
{
_paddings.Top = _params[_cursor.pos++];
break;
}
case 2:
{
_paddings.Right = _params[_cursor.pos++];
break;
}
case 3:
{
_paddings.Bottom = _params[_cursor.pos++];
break;
}
case 4:
{
_paddings.Flag = _params[_cursor.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
return _paddings;
}
function asc_menu_WriteCellMargins(_type, _margins, _stream)
{
if (undefined === _margins)
return;
_stream["WriteByte"](_type);
if (_margins.Left !== undefined && _margins.Left !== null)
{
_stream["WriteByte"](0);
_stream["WriteDouble2"](_margins.Left);
}
if (_margins.Top !== undefined && _margins.Top !== null)
{
_stream["WriteByte"](1);
_stream["WriteDouble2"](_margins.Top);
}
if (_margins.Right !== undefined && _margins.Right !== null)
{
_stream["WriteByte"](2);
_stream["WriteDouble2"](_margins.Right);
}
if (_margins.Bottom !== undefined && _margins.Bottom !== null)
{
_stream["WriteByte"](3);
_stream["WriteDouble2"](_margins.Bottom);
}
if (_margins.Flag !== undefined && _margins.Flag !== null)
{
_stream["WriteByte"](4);
_stream["WriteLong"](_margins.Flag);
}
_stream["WriteByte"](255);
}
function asc_menu_ReadCellBorders(_params, _cursor)
{
var _borders = new CBorders();
var _continue = true;
while (_continue)
{
var _attr = _params[_cursor.pos++];
switch (_attr)
{
case 0:
{
_borders.Left = asc_menu_ReadParaBorder(_params, _cursor);
break;
}
case 1:
{
_borders.Top = asc_menu_ReadParaBorder(_params, _cursor);
break;
}
case 2:
{
_borders.Right = asc_menu_ReadParaBorder(_params, _cursor);
break;
}
case 3:
{
_borders.Bottom = asc_menu_ReadParaBorder(_params, _cursor);
break;
}
case 4:
{
_borders.InsideH = asc_menu_ReadParaBorder(_params, _cursor);
break;
}
case 5:
{
_borders.InsideV = asc_menu_ReadParaBorder(_params, _cursor);
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
return _borders;
}
function asc_menu_WriteCellBorders(_type, _borders, _stream)
{
if (undefined === _borders)
return;
_stream["WriteByte"](_type);
asc_menu_WriteParaBorder(0, _borders.Left, _stream);
asc_menu_WriteParaBorder(1, _borders.Top, _stream);
asc_menu_WriteParaBorder(2, _borders.Right, _stream);
asc_menu_WriteParaBorder(3, _borders.Bottom, _stream);
asc_menu_WriteParaBorder(4, _borders.InsideH, _stream);
asc_menu_WriteParaBorder(5, _borders.InsideV, _stream);
_stream["WriteByte"](255);
}
function asc_menu_ReadCellBackground(_params, _cursor)
{
var _background = new CBackground();
var _continue = true;
while (_continue)
{
var _attr = _params[_cursor.pos++];
switch (_attr)
{
case 0:
{
_background.Color = asc_menu_ReadColor(_params, _cursor);
break;
}
case 1:
{
_background.Value = _params[_cursor.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
return _background;
}
function asc_menu_WriteCellBackground(_type, _background, _stream)
{
if (undefined === _background)
return;
_stream["WriteByte"](_type);
asc_menu_WriteColor(0, _background.Color, _stream);
if (_background.Value !== undefined && _background.Value !== null)
{
_stream["WriteByte"](1);
_stream["WriteLong"](_background.Value);
}
function asc_menu_WriteHeaderFooterPr(_hdrftrPr, _stream)
_stream["WriteByte"](255);
}
function asc_menu_ReadPosition(_params, _cursor)
{
if (_hdrftrPr.Type !== undefined && _hdrftrPr.Type !== null)
var _position = new CPosition();
var _continue = true;
while (_continue)
{
var _attr = _params[_cursor.pos++];
switch (_attr)
{
case 0:
{
_position.X = _params[_cursor.pos++];
break;
}
case 1:
{
_position.Y = _params[_cursor.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
return _position;
}
function asc_menu_WritePosition(_type, _position, _stream)
{
if (undefined === _position)
return;
_stream["WriteByte"](_type);
if (_position.X !== undefined && _position.X !== null)
{
_stream["WriteByte"](0);
_stream["WriteLong"](_hdrftrPr.Type);
_stream["WriteDouble2"](_position.X);
}
if (_hdrftrPr.Position !== undefined && _hdrftrPr.Position !== null)
if (_position.Y !== undefined && _position.Y !== null)
{
_stream["WriteByte"](1);
_stream["WriteDouble2"](_hdrftrPr.Position);
_stream["WriteDouble2"](_position.Y);
}
if (_hdrftrPr.DifferentFirst !== undefined && _hdrftrPr.DifferentFirst !== null)
_stream["WriteByte"](255);
}
function asc_menu_ReadImagePosition(_params, _cursor)
{
var _position = new CPosition();
var _continue = true;
while (_continue)
{
_stream["WriteByte"](2);
_stream["WriteBool"](_hdrftrPr.DifferentFirst);
var _attr = _params[_cursor.pos++];
switch (_attr)
{
case 0:
{
_position.RelativeFrom = _params[_cursor.pos++];
break;
}
case 1:
{
_position.UseAlign = _params[_cursor.pos++];
break;
}
case 2:
{
_position.Align = _params[_cursor.pos++];
break;
}
case 3:
{
_position.Value = _params[_cursor.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
if (_hdrftrPr.DifferentEvenOdd !== undefined && _hdrftrPr.DifferentEvenOdd !== null)
return _position;
}
function asc_menu_WriteImagePosition(_type, _position, _stream)
{
if (undefined === _position)
return;
_stream["WriteByte"](_type);
if (_position.RelativeFrom !== undefined && _position.RelativeFrom !== null)
{
_stream["WriteByte"](3);
_stream["WriteBool"](_hdrftrPr.DifferentEvenOdd);
_stream["WriteByte"](0);
_stream["WriteLong"](_position.RelativeFrom);
}
if (_hdrftrPr.LinkToPrevious !== undefined && _hdrftrPr.LinkToPrevious !== null)
if (_position.UseAlign !== undefined && _position.UseAlign !== null)
{
_stream["WriteByte"](4);
_stream["WriteBool"](_hdrftrPr.LinkToPrevious);
_stream["WriteByte"](1);
_stream["WriteBool"](_position.UseAlign);
}
if (_hdrftrPr.Locked !== undefined && _hdrftrPr.Locked !== null)
if (_position.Align !== undefined && _position.Align !== null)
{
_stream["WriteByte"](5);
_stream["WriteBool"](_hdrftrPr.DifferentFirst);
_stream["WriteByte"](2);
_stream["WriteLong"](_position.Align);
}
if (_position.Value !== undefined && _position.Value !== null)
{
_stream["WriteByte"](3);
_stream["WriteLong"](_position.Value);
}
_stream["WriteByte"](255);
}
function asc_menu_WriteParagraphPr(_paraPr, _stream)
function asc_menu_ReadTableAnchorPosition(_params, _cursor)
{
if (_paraPr.ContextualSpacing !== undefined && _paraPr.ContextualSpacing !== null)
var _position = new CTableAnchorPosition();
_position.CalcX = _params[_cursor.pos++];
_position.CalcY = _params[_cursor.pos++];
_position.W = _params[_cursor.pos++];
_position.H = _params[_cursor.pos++];
_position.X = _params[_cursor.pos++];
_position.Y = _params[_cursor.pos++];
_position.Left_Margin = _params[_cursor.pos++];
_position.Right_Margin = _params[_cursor.pos++];
_position.Top_Margin = _params[_cursor.pos++];
_position.Bottom_Margin = _params[_cursor.pos++];
_position.Page_W = _params[_cursor.pos++];
_position.Page_H = _params[_cursor.pos++];
_position.X_min = _params[_cursor.pos++];
_position.Y_min = _params[_cursor.pos++];
_position.X_max = _params[_cursor.pos++];
_position.Y_max = _params[_cursor.pos++];
_cursor.pos++;
}
function asc_menu_WriteTableAnchorPosition(_type, _position, _stream)
{
if (undefined === _position)
return;
_stream["WriteByte"](_type);
_stream["WriteDouble2"](_position.CalcX);
_stream["WriteDouble2"](_position.CalcY);
_stream["WriteDouble2"](_position.W);
_stream["WriteDouble2"](_position.H);
_stream["WriteDouble2"](_position.X);
_stream["WriteDouble2"](_position.Y);
_stream["WriteDouble2"](_position.Left_Margin);
_stream["WriteDouble2"](_position.Right_Margin);
_stream["WriteDouble2"](_position.Top_Margin);
_stream["WriteDouble2"](_position.Bottom_Margin);
_stream["WriteDouble2"](_position.Page_W);
_stream["WriteDouble2"](_position.Page_H);
_stream["WriteDouble2"](_position.X_min);
_stream["WriteDouble2"](_position.Y_min);
_stream["WriteDouble2"](_position.X_max);
_stream["WriteDouble2"](_position.Y_max);
_stream["WriteByte"](255);
}
function asc_menu_ReadTableLook(_params, _cursor)
{
var _position = new CTableLook();
var _continue = true;
while (_continue)
{
_stream["WriteByte"](0);
_stream["WriteBool"](_paraPr.ContextualSpacing);
var _attr = _params[_cursor.pos++];
switch (_attr)
{
case 0:
{
_position.FirstCol = _params[_cursor.pos++];
break;
}
case 1:
{
_position.FirstRow = _params[_cursor.pos++];
break;
}
case 2:
{
_position.LastCol = _params[_cursor.pos++];
break;
}
case 3:
{
_position.LastRow = _params[_cursor.pos++];
break;
}
case 4:
{
_position.BandHor = _params[_cursor.pos++];
break;
}
case 5:
{
_position.BandVer = _params[_cursor.pos++];
break;
}
case 255:
default:
{
_continue = false;
break;
}
}
}
asc_menu_WriteParaInd(1, _paraPr.Ind, _stream);
return _position;
}
function asc_menu_WriteTableLook(_type, _look, _stream)
{
if (undefined === _look)
return;
if (_paraPr.KeepLines !== undefined && _paraPr.KeepLines !== null)
_stream["WriteByte"](_type);
if (_look.FirstCol !== undefined && _look.FirstCol !== null)
{
_stream["WriteByte"](0);
_stream["WriteBool"](_look.FirstCol);
}
if (_look.FirstRow !== undefined && _look.FirstRow !== null)
{
_stream["WriteByte"](1);
_stream["WriteBool"](_look.FirstRow);
}
if (_look.LastCol !== undefined && _look.LastCol !== null)
{
_stream["WriteByte"](2);
_stream["WriteBool"](_paraPr.KeepLines);
_stream["WriteBool"](_look.LastCol);
}
if (_paraPr.KeepNext !== undefined && _paraPr.KeepNext !== null)
if (_look.LastRow !== undefined && _look.LastRow !== null)
{
_stream["WriteByte"](3);
_stream["WriteBool"](_paraPr.KeepNext);
_stream["WriteBool"](_look.LastRow);
}
if (_paraPr.WidowControl !== undefined && _paraPr.WidowControl !== null)
if (_look.BandHor !== undefined && _look.BandHor !== null)
{
_stream["WriteByte"](4);
_stream["WriteBool"](_paraPr.WidowControl);
_stream["WriteBool"](_look.BandHor);
}
if (_paraPr.PageBreakBefore !== undefined && _paraPr.PageBreakBefore !== null)
if (_look.BandVer !== undefined && _look.BandVer !== null)
{
_stream["WriteByte"](5);
_stream["WriteBool"](_paraPr.PageBreakBefore);
_stream["WriteBool"](_look.BandVer);
}
asc_menu_WriteParaSpacing(6, _paraPr.Spacing, _stream);
asc_menu_WriteParaBorders(7, _paraPr.Brd, _stream);
asc_menu_WriteParaShd(8, _paraPr.Shd, _stream);
_stream["WriteByte"](255);
}
if (_paraPr.Locked !== undefined && _paraPr.Locked !== null)
function asc_menu_WriteTablePr(_tablePr, _stream)
{
if (_tablePr.CanBeFlow !== undefined && _tablePr.ContextualSpacing !== null)
{
_stream["WriteByte"](9);
_stream["WriteBool"](_paraPr.Locked);
_stream["WriteByte"](0);
_stream["WriteBool"](_tablePr.CanBeFlow);
}
if (_paraPr.CanAddTable !== undefined && _paraPr.CanAddTable !== null)
if (_tablePr.CellSelect !== undefined && _tablePr.CellSelect !== null)
{
_stream["WriteByte"](10);
_stream["WriteBool"](_paraPr.CanAddTable);
_stream["WriteByte"](1);
_stream["WriteBool"](_tablePr.CellSelect);
}
if (_paraPr.CanAddDropCap !== undefined && _paraPr.CanAddDropCap !== null)
if (_tablePr.TableWidth !== undefined && _tablePr.TableWidth !== null)
{
_stream["WriteByte"](11);
_stream["WriteBool"](_paraPr.CanAddDropCap);
_stream["WriteByte"](2);
_stream["WriteDouble2"](_tablePr.TableWidth);
}
if (_paraPr.DefaultTab !== undefined && _paraPr.DefaultTab !== null)
if (_tablePr.TableSpacing !== undefined && _tablePr.TableSpacing !== null)
{
_stream["WriteByte"](12);
_stream["WriteDouble2"](_paraPr.DefaultTab);
_stream["WriteByte"](3);
_stream["WriteDouble2"](_tablePr.TableSpacing);
}
asc_menu_WriteParaTabs(13, _paraPr.Tabs, _stream);
asc_menu_WriteParaFrame(14, _paraPr.FramePr, _stream);
asc_menu_WritePaddings(4, _tablePr.TableDefaultMargins, _stream);
asc_menu_WriteCellMargins(5, _tablePr.CellMargins, _stream);
if (_paraPr.Subscript !== undefined && _paraPr.Subscript !== null)
if (_tablePr.TableAlignment !== undefined && _tablePr.TableAlignment !== null)
{
_stream["WriteByte"](15);
_stream["WriteBool"](_paraPr.Subscript);
_stream["WriteByte"](6);
_stream["WriteLong"](_tablePr.TableAlignment);
}
if (_paraPr.Superscript !== undefined && _paraPr.Superscript !== null)
if (_tablePr.TableIndent !== undefined && _tablePr.TableIndent !== null)
{
_stream["WriteByte"](16);
_stream["WriteBool"](_paraPr.Superscript);
_stream["WriteByte"](7);
_stream["WriteDouble2"](_tablePr.TableIndent);
}
if (_paraPr.SmallCaps !== undefined && _paraPr.SmallCaps !== null)
if (_tablePr.TableWrappingStyle !== undefined && _tablePr.TableWrappingStyle !== null)
{
_stream["WriteByte"](17);
_stream["WriteBool"](_paraPr.SmallCaps);
_stream["WriteByte"](8);
_stream["WriteLong"](_tablePr.TableWrappingStyle);
}
if (_paraPr.AllCaps !== undefined && _paraPr.AllCaps !== null)
asc_menu_WritePaddings(9, _tablePr.TablePaddings, _stream);
asc_menu_WriteCellBorders(10, _tablePr.TableBorders, _stream);
asc_menu_WriteCellBorders(11, _tablePr.CellBorders, _stream);
asc_menu_WriteCellBackground(12, _tablePr.TableBackground, _stream);
asc_menu_WriteCellBackground(13, _tablePr.CellsBackground, _stream);
asc_menu_WritePosition(14, _tablePr.Position, _stream);
asc_menu_WriteImagePosition(15, _tablePr.PositionH, _stream);
asc_menu_WriteImagePosition(16, _tablePr.PositionV, _stream);
asc_menu_WriteTableAnchorPosition(17, _tablePr.Internal_Position, _stream);
if (_tablePr.ForSelectedCells !== undefined && _tablePr.ForSelectedCells !== null)
{
_stream["WriteByte"](18);
_stream["WriteBool"](_paraPr.AllCaps);
_stream["WriteBool"](_tablePr.ForSelectedCells);
}
if (_paraPr.Strikeout !== undefined && _paraPr.Strikeout !== null)
if (_tablePr.TableStyle !== undefined && _tablePr.TableStyle !== null)
{
_stream["WriteByte"](19);
_stream["WriteBool"](_paraPr.Strikeout);
}
if (_paraPr.DStrikeout !== undefined && _paraPr.DStrikeout !== null)
{
_stream["WriteByte"](20);
_stream["WriteBool"](_paraPr.DStrikeout);
_stream["WriteString2"](_tablePr.TableStyle);
}
if (_paraPr.TextSpacing !== undefined && _paraPr.TextSpacing !== null)
asc_menu_WriteTableLook(20, _tablePr.TableLook, _stream);
if (_tablePr.RowsInHeader !== undefined && _tablePr.RowsInHeader !== null)
{
_stream["WriteByte"](21);
_stream["WriteDouble2"](_paraPr.TextSpacing);
_stream["WriteLong"](_tablePr.RowsInHeader);
}
if (_paraPr.Position !== undefined && _paraPr.Position !== null)
if (_tablePr.CellsVAlign !== undefined && _tablePr.CellsVAlign !== null)
{
_stream["WriteByte"](22);
_stream["WriteDouble2"](_paraPr.Position);
_stream["WriteLong"](_tablePr.CellsVAlign);
}
asc_menu_WriteParaListType(23, _paraPr.ListType, _stream);
if (_paraPr.StyleName !== undefined && _paraPr.StyleName !== null)
if (_tablePr.AllowOverlap !== undefined && _tablePr.AllowOverlap !== null)
{
_stream["WriteByte"](23);
_stream["WriteBool"](_tablePr.AllowOverlap);
}
if (_tablePr.TableLayout !== undefined && _tablePr.TableLayout !== null)
{
_stream["WriteByte"](24);
_stream["WriteString2"](_paraPr.StyleName);
_stream["WriteLong"](_tablePr.TableLayout);
}
if (_paraPr.Jc !== undefined && _paraPr.Jc !== null)
if (_tablePr.Locked !== undefined && _tablePr.Locked !== null)
{
_stream["WriteByte"](25);
_stream["WriteLong"](_paraPr.Jc);
_stream["WriteBool"](_tablePr.Locked);
}
_stream["WriteByte"](255);
}
asc_docs_api.prototype.UpdateTextPr = function(TextPr)
......@@ -1857,6 +2681,23 @@ asc_docs_api.prototype.DecreaseIndent = function()
}
};
asc_docs_api.prototype.MergeCells = function()
{
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Table_Properties) )
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.Table_MergeCells();
}
}
asc_docs_api.prototype.SplitCell = function(Cols, Rows)
{
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Table_Properties) )
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.Table_SplitCell(Cols, Rows);
}
}
asc_docs_api.prototype.Send_Menu_Event = function(type)
{
window["native"]["OnCallMenuEvent"](type, global_memory_stream_menu);
......@@ -1877,10 +2718,10 @@ asc_docs_api.prototype.sync_EndCatchSelectedElements = function()
{
switch (this.SelectedObjectsStack[i].Type)
{
//console.log(JSON.stringify(this.SelectedObjectsStack[i].Value));
case c_oAscTypeSelectElement.Paragraph:
{
_stream["WriteLong"](c_oAscTypeSelectElement.Paragraph);
//console.log(JSON.stringify(this.SelectedObjectsStack[i].Value));
asc_menu_WriteParagraphPr(this.SelectedObjectsStack[i].Value, _stream);
break;
}
......@@ -1890,6 +2731,12 @@ asc_docs_api.prototype.sync_EndCatchSelectedElements = function()
asc_menu_WriteHeaderFooterPr(this.SelectedObjectsStack[i].Value, _stream);
break;
}
case c_oAscTypeSelectElement.Table:
{
_stream["WriteLong"](c_oAscTypeSelectElement.Table);
asc_menu_WriteTablePr(this.SelectedObjectsStack[i].Value, _stream);
break;
}
default:
{
_stream["WriteLong"](255);
......
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