Commit 7fd7bae2 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into develop

parents 49301f9a e9b86a74
......@@ -22,7 +22,7 @@
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
function CPointer()
function CPointer()
{
this.obj = null;
this.data = null;
......
......@@ -855,6 +855,9 @@ window['Asc']['c_oAscAsyncActionType'] = c_oAscAsyncActionType;
window['Asc']['c_oAscNumFormatType'] = c_oAscNumFormatType;
window['Asc']['c_oAscDrawingLayerType'] = c_oAscDrawingLayerType;
window['Asc']['c_oAscTypeSelectElement'] = c_oAscTypeSelectElement;
window['Asc']['linerule_AtLeast'] = linerule_AtLeast;
window['Asc']['linerule_Auto'] = linerule_Auto;
window['Asc']['linerule_Exact'] = linerule_Exact;
window['Asc']['c_oAscShdClear'] = shd_Clear; //ToDo по идее должны совпадать переменные
window['Asc']['c_oAscShdNil'] = shd_Nil;
window['Asc']['c_oAscChartTitleShowSettings'] = c_oAscChartTitleShowSettings;
......
/*
*
* (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";
var g_fontManager = new CFontManager();
......@@ -2734,8 +2734,10 @@ function CDrawingDocument()
var page = this.m_arrPages[pageIndex];
var w = (this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix * page.width_mm / 100) >> 0;
var h = (this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix * page.height_mm / 100) >> 0;
var dKoef = (this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100);
var w = (page.width_mm * dKoef + 0.5) >> 0;
var h = (page.height_mm * dKoef + 0.5) >> 0;
if (this.m_oWordControl.bIsRetinaSupport)
{
......
......@@ -3291,8 +3291,8 @@ function CEditorPage(api)
var lStart = 0;
for (var i = 0; i < this.m_oDrawingDocument.m_lPagesCount; i++)
{
var _pageWidth = parseInt(this.m_oDrawingDocument.m_arrPages[i].width_mm * dKoef);
var _pageHeight = parseInt(this.m_oDrawingDocument.m_arrPages[i].height_mm * dKoef);
var _pageWidth = (this.m_oDrawingDocument.m_arrPages[i].width_mm * dKoef + 0.5) >> 0;
var _pageHeight = (this.m_oDrawingDocument.m_arrPages[i].height_mm * dKoef + 0.5) >> 0;
if (false === bIsFoundFirst)
{
......
......@@ -31,7 +31,8 @@
*/
var fieldtype_UNKNOWN = 0x0000;
var fieldtype_MERGEFIELD = 0x0001;
var fieldtype_MERGEFIELD = 0x0001;
var fieldtype_PAGENUM = 0x0002;
/**
*
......
......@@ -7988,23 +7988,17 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
//для случая гиперссылок на несколько строк в конце параграфа завершаем начатые, а начале - продолжаем незавершенные
if (this.aFields.length > 0) {
for (var i = 0; i < this.aFields.length; ++i) {
var elem = this.aFields[i];
elem.commitElem = false;
var oField = elem.field;
if(null != oField){
if(para_Hyperlink == oField.Get_Type()){
var oHyperlink = new ParaHyperlink();
oHyperlink.Set_Paragraph(paragraph);
oHyperlink.Set_Value(oField.Get_Value());
oHyperlink.Set_ToolTip(oField.Get_ToolTip());
oParStruct.addElem(oHyperlink);
elem.commitElem = true;
}
else if(para_PageNum == oField.Get_Type()){
oParStruct.addElem(null);
elem.commitElem = true;
}
}
var oField = this.aFields[i];
if (null != oField && para_Hyperlink == oField.Get_Type()) {
var oHyperlink = new ParaHyperlink();
oHyperlink.Set_Paragraph(paragraph);
oHyperlink.Set_Value(oField.Get_Value());
oHyperlink.Set_ToolTip(oField.Get_ToolTip());
oParStruct.addElem(oHyperlink);
} else {
//зануляем, чтобы когда придет fldend ничего не делать
this.aFields[i] = null;
}
}
}
res = this.bcr.Read1(length, function(t, l){
......@@ -8124,18 +8118,9 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
return oThis.ReadFldSimple(t, l, oFldSimpleObj, oParStruct);
});
if(null != oFldSimpleObj.ParaField){
var oField = oFldSimpleObj.ParaField;
var nFieldType = oField.Get_Type();
if(para_PageNum == nFieldType)
{
var oNewRun = new ParaRun(oParStruct.paragraph);
oNewRun.Add_ToContent(0, oField);
oParStruct.addToContent(oNewRun);
}
else
oParStruct.addToContent(oField);
if (para_Field == nFieldType && editor)
editor.WordControl.m_oLogicDocument.Register_Field(oField);
//чтобы не писать здесь логику для pagenum
oParStruct.addElem(oFldSimpleObj.ParaField);
oParStruct.commitElem();
}
} else if (c_oSerParType.Del == type) {
var reviewInfo = new CReviewInfo();
......@@ -8176,19 +8161,13 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oFldSimpleObj.ParaField = this.parseField(Instr, oParStruct.paragraph);
}
else if (c_oSer_FldSimpleType.Content === type) {
if(null != oFldSimpleObj.ParaField){
if(para_PageNum != oFldSimpleObj.ParaField.Get_Type())
{
var oFldStruct = new OpenParStruct(oFldSimpleObj.ParaField, oParStruct.Content, oParStruct.paragraph);
res = this.bcr.Read1(length, function (t, l) {
return oThis.ReadParagraphContent(t, l, oFldStruct);
});
oFldStruct.commitAll();
}
else
res = c_oSerConstants.ReadUnknown;
}
else{
if(null != oFldSimpleObj.ParaField) {
var oFldStruct = new OpenParStruct(oFldSimpleObj.ParaField, oParStruct.Content, oParStruct.paragraph);
res = this.bcr.Read1(length, function (t, l) {
return oThis.ReadParagraphContent(t, l, oFldStruct);
});
oFldStruct.commitAll();
} else {
res = this.bcr.Read1(length, function (t, l) {
return oThis.ReadParagraphContent(t, l, oParStruct);
});
......@@ -8398,27 +8377,18 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
oRes.bRes = false;
var sField = this.stream.GetString2LE(length);
var oField = this.parseField(sField, oParStruct.paragraph);
var commitElem = false;
if(null != oField)
{
if(para_PageNum == oField.Get_Type()){
oNewElem = oField;
//досрочно добавляем oPos.run потому что после oParStruct.addElem(null); он никуда не добавится
oParStruct.addToContent(oPos.run);
oParStruct.addElem(null);
}
else
oParStruct.addElem(oField);
commitElem = true;
if (null != oField) {
oParStruct.addElem(oField);
}
this.aFields.push({field: oField, commitElem: commitElem});
this.aFields.push(oField);
}
else if(c_oSerRunType.fldend === type)
{
oRes.bRes = false;
var elem = this.aFields.pop();
if(elem.commitElem)
oParStruct.commitElem();
if (elem) {
oParStruct.commitElem();
}
}
else if (c_oSerRunType._LastRun === type)
this.oReadResult.bLastRun = true;
......@@ -8596,10 +8566,12 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
}
}
else if("PAGE" == sFieldType){
oRes = new ParaPageNum();
oRes = new ParaField(fieldtype_PAGENUM, aArguments, aSwitches);
}
else if("MERGEFIELD" == sFieldType){
oRes = new ParaField(fieldtype_MERGEFIELD, aArguments, aSwitches);
if (editor)
editor.WordControl.m_oLogicDocument.Register_Field(oRes);
}
return oRes;
}
......@@ -12417,7 +12389,18 @@ CFontsCharMap.prototype =
this.CurrentFontInfo.CharArray[_find] = true;
}
}
function getStyleFirstRun(oField){
var res = null;
//берем первый с непустым Content, потому что в случае fldstart первым будет run fldstart
for (var i = 0 ; i < oField.Content.length; ++i) {
var run = oField.Content[i];
if (run.Content.length > 0) {
res = run.Get_FirstTextPr();
break;
}
}
return res;
}
function OpenParStruct(oContainer, Content, paragraph) {
this.DocContent = Content;
this.paragraph = paragraph;
......@@ -12474,8 +12457,20 @@ OpenParStruct.prototype = {
if (this.stack.length > 1) {
var oPrevElem = this.stack.pop();
this.cur = this.stack[this.stack.length - 1];
if (null != oPrevElem.elem && oPrevElem.elem.Content && oPrevElem.elem.Content.length > 0)
this.addToContent(oPrevElem.elem);
var elem = oPrevElem.elem;
if (null != elem && elem.Content && elem.Content.length > 0) {
if (para_Field == elem.Get_Type() && fieldtype_PAGENUM == elem.Get_FieldType()) {
var oNewRun = new ParaRun(this.paragraph);
var rPr = getStyleFirstRun(elem);
if (rPr) {
oNewRun.Set_Pr(rPr);
}
oNewRun.Add_ToContent(0, new ParaPageNum());
this.addToContent(oNewRun);
} else {
this.addToContent(elem);
}
}
bRes = true;
}
return bRes;
......
......@@ -64,6 +64,16 @@
this.Section = Section;
}
function ApiTableRow(Row)
{
this.Row = Row;
}
function ApiTableCell(Cell)
{
this.Cell = Cell;
}
//------------------------------------------------------------------------------------------------------------------
//
// Base Api
......@@ -107,7 +117,7 @@
//------------------------------------------------------------------------------------------------------------------
/**
* Get elements count
* Get the number of elements.
*/
ApiDocument.prototype["GetElementsCount"] = function()
{
......@@ -122,7 +132,13 @@
if (!this.Document.Content[nPos])
return null;
return this.Document.Content[nPos];
var Type = this.Document.Content[nPos].Get_Type();
if (type_Paragraph === Type)
return new ApiParagraph(this.Document.Content[nPos]);
else if (type_Paragraph === Type)
return new ApiTable(this.Document.Content[nPos]);
return null;
};
/**
* Add paragraph or table by position
......@@ -338,6 +354,42 @@
{
this.Paragraph.Set_Ind(private_GetParaInd(undefined, undefined, nValue));
};
/**
* This element specifies that when rendering this document in a paginated view, the contents of this paragraph
* are at least partly rendered on the same page as the following paragraph whenever possible.
* @param isKeepNext (true | false)
*/
ApiParagraph.prototype["SetKeepNext"] = function(isKeepNext)
{
this.Paragraph.Set_KeepNext(isKeepNext);
};
/**
* This element specifies that when rendering this document in a page view, all lines of this paragraph are
* maintained on a single page whenever possible.
* @param isKeepLines (true | false)
*/
ApiParagraph.prototype["SetKeepLines"] = function(isKeepLines)
{
this.Paragraph.Set_KeepLines(isKeepLines);
};
/**
* This element specifies that when rendering this document in a paginated view, the contents of this paragraph
* are rendered on the start of a new page in the document.
* @param isPageBreakBefore (true | false)
*/
ApiParagraph.prototype["SetPageBreakBefore"] = function(isPageBreakBefore)
{
this.Paragraph.Set_PageBreakBefore(isPageBreakBefore);
};
/**
* This element specifies whether a consumer shall prevent a single line of this paragraph from being displayed on
* a separate page from the remaining content at display time by moving the line onto the following page.
* @param isWidowControl (true | false)
*/
ApiParagraph.prototype["SetWidowControl"] = function(isWidowControl)
{
this.Paragraph.Set_WidowControl(isWidowControl);
};
//------------------------------------------------------------------------------------------------------------------
//
......@@ -506,6 +558,217 @@
this.Section.Set_PageMargins_Footer(private_Twips2MM(nDistance));
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiTable
//
//------------------------------------------------------------------------------------------------------------------
/**
* Get the number of rows in the current table.
*/
ApiTable.prototype["GetRowsCount"] = function()
{
return this.Table.Content.length;
};
/**
* Get table row by position.
* @param nPos
* @returns {ApiTableRow}
*/
ApiTable.prototype["GetRow"] = function(nPos)
{
if (nPos < 0 || nPos >= this.Table.Content.length)
return null;
return new ApiTableRow(this.Table.Content[nPos]);
};
/**
* Set table style
* @param oStyle (ApiStyle)
* @return {boolean}
*/
ApiTable.prototype["SetStyle"] = function(oStyle)
{
if (!oStyle || !(oStyle instanceof ApiStyle) || styletype_Table !== oStyle.Style.Get_Type())
return false;
this.Table.Set_Props({TableStyle : oStyle.Style.Get_Id()});
return true;
};
/**
* Set the preferred width for this table.
* @param sType ("auto" | "twips" | "percent" | "nil")
* @param nValue
*/
ApiTable.prototype["SetWidth"] = function(sType, nValue)
{
if ("auto" === sType)
this.Table.Set_Props({TableWidth : null});
else if ("twips" === sType)
this.Table.Set_Props({TableWidth : private_Twips2MM(nValue)});
else if ("percent" === sType)
this.Table.Set_Props({TableWidth : -nValue});
};
/**
* Specify the components of the conditional formatting of the referenced table style (if one exists)
* which shall be applied to the set of table rows with the current table-level property exceptions. A table style can
* specify up to six different optional conditional formats [Example: Different formatting for first column. end
* example], which then can be applied or omitted from individual table rows in the parent table.
*
* The default setting is to apply the row and column banding formatting, but not the first row, last row, first
* column, or last column formatting.
* @param isFirstColumn (true | false) Specifies that the first column conditional formatting shall be applied to the table.
* @param isFirstRow (true | false) Specifies that the first row conditional formatting shall be applied to the table.
* @param isLastColumn (true | false) Specifies that the last column conditional formatting shall be applied to the table.
* @param isLastRow (true | false) Specifies that the last row conditional formatting shall be applied to the table.
* @param isHorBand (true | false) Specifies that the horizontal banding conditional formatting shall not be applied to the table.
* @param isVerBand (true | false) Specifies that the vertical banding conditional formatting shall not be applied to the table.
*/
ApiTable.prototype["SetTableLook"] = function(isFirstColumn, isFirstRow, isLastColumn, isLastRow, isHorBand, isVerBand)
{
this.Table.Set_Props({TableLook :
{
FirstCol : isFirstColumn,
FirstRow : isFirstRow,
LastCol : isLastColumn,
LastRow : isLastRow,
BandHor : isHorBand,
BandVer : isVerBand
}});
};
/**
* Set the border which shall be displayed at the top of the current table.
* @param sType ("single" | "none")
* @param nSize (twips)
* @param nSpace (twips)
* @param r (0-255)
* @param g (0-255)
* @param b (0-255)
*/
ApiTable.prototype["SetTableBorderTop"] = function(sType, nSize, nSpace, r, g, b)
{
this.Table.Set_Props({TableBorders : {Top : private_GetTableBorder(sType, nSize, nSpace, r, g, b)}});
};
/**
* Set the border which shall be displayed at the bottom of the current table.
* @param sType ("single" | "none")
* @param nSize (twips)
* @param nSpace (twips)
* @param r (0-255)
* @param g (0-255)
* @param b (0-255)
*/
ApiTable.prototype["SetTableBorderBottom"] = function(sType, nSize, nSpace, r, g, b)
{
this.Table.Set_Props({TableBorders : {Bottom : private_GetTableBorder(sType, nSize, nSpace, r, g, b)}});
};
/**
* Set the border which shall be displayed on the left of the current table.
* @param sType ("single" | "none")
* @param nSize (twips)
* @param nSpace (twips)
* @param r (0-255)
* @param g (0-255)
* @param b (0-255)
*/
ApiTable.prototype["SetTableBorderLeft"] = function(sType, nSize, nSpace, r, g, b)
{
this.Table.Set_Props({TableBorders : {Left : private_GetTableBorder(sType, nSize, nSpace, r, g, b)}});
};
/**
* Set the border which shall be displayed on the right of the current table.
* @param sType ("single" | "none")
* @param nSize (twips)
* @param nSpace (twips)
* @param r (0-255)
* @param g (0-255)
* @param b (0-255)
*/
ApiTable.prototype["SetTableBorderRight"] = function(sType, nSize, nSpace, r, g, b)
{
this.Table.Set_Props({TableBorders : {Right : private_GetTableBorder(sType, nSize, nSpace, r, g, b)}});
};
/**
* Specify the border which shall be displayed on all horizontal table cell borders which are not on
* an outmost edge of the parent table (all horizontal borders which are not the topmost or bottommost border).
* @param sType ("single" | "none")
* @param nSize (twips)
* @param nSpace (twips)
* @param r (0-255)
* @param g (0-255)
* @param b (0-255)
*/
ApiTable.prototype["SetTableBorderInsideH"] = function(sType, nSize, nSpace, r, g, b)
{
this.Table.Set_Props({TableBorders : {InsideH : private_GetTableBorder(sType, nSize, nSpace, r, g, b)}});
};
/**
* Specify the border which shall be displayed on all vertical table cell borders which are not on an
* outmost edge of the parent table (all horizontal borders which are not the leftmost or rightmost border).
* @param sType ("single" | "none")
* @param nSize (twips)
* @param nSpace (twips)
* @param r (0-255)
* @param g (0-255)
* @param b (0-255)
*/
ApiTable.prototype["SetTableBorderInsideV"] = function(sType, nSize, nSpace, r, g, b)
{
this.Table.Set_Props({TableBorders : {InsideV : private_GetTableBorder(sType, nSize, nSpace, r, g, b)}});
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiTableRow
//
//------------------------------------------------------------------------------------------------------------------
/**
* Get the number of cells in the current row.
* @returns {number}
*/
ApiTableRow.prototype["GetCellsCount"] = function()
{
return this.Row.Content.length;
};
/**
* Get cell by position.
* @param nPos
* @returns {ApiTableCell}
*/
ApiTableRow.prototype["GetCell"] = function(nPos)
{
if (nPos < 0 || nPos >= this.Row.Content.length)
return null;
return new ApiTableCell(this.Row.Content[nPos]);
};
/**
* Set the height of the current table row within the current table.
* @param sHRule ("auto" | "atLeast") "auto" is default value
* @param nValue (twips)
*/
ApiTableRow.prototype["SetHeight"] = function(sHRule, nValue)
{
var HRule = ("auto" === sHRule ? heightrule_Auto : heightrule_AtLeast);
this.Row.Set_Height(private_Twips2MM(nValue), HRule);
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiTableCell
//
//------------------------------------------------------------------------------------------------------------------
/**
* Get cell content
* @returns {ApiDocument}
*/
ApiTableCell.prototype["GetContent"] = function()
{
return new ApiDocument(this.Cell.Content);
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Private area
......@@ -610,6 +873,21 @@
return undefined;
}
function private_GetTableBorder(sType, nSize, nSpace, r, g, b)
{
var oBorder = new CDocumentBorder();
if ("single" === sType)
oBorder.Value = border_Single;
else if ("none" === sType)
oBorder.Value = border_None;
oBorder.Size = private_Twips2MM(nSize);
oBorder.Space = private_Twips2MM(nSpace);
oBorder.Color.Set(r, g, b);
return oBorder;
}
ApiParagraph.prototype.private_GetImpl = function()
{
return this.Paragraph;
......@@ -632,6 +910,7 @@ function TEST_BUILDER()
var Api = editor;
var oRun;
var oDocument = Api.GetDocument();
var oHeadingStyle = oDocument.GetStyle("Heading 1");
var oNoSpacingStyle = oDocument.GetStyle("No Spacing");
......@@ -744,6 +1023,120 @@ function TEST_BUILDER()
oSection1.SetFooterDistance(576);
var oSubtitleStyle = oDocument.GetStyle("Subtitle");
oParagraph = Api.CreateParagraph();
oParagraph.SetStyle(oSubtitleStyle);
// TODO: Добавить автофигуру
oParagraph.AddText("Legal Issues");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
// TODO: Добавить автофигуру
oParagraph.AddText("To support the new product, the Legal Department will maintain a centralized repository for all patent investigations as well as marketing claims. The release team will adhere to all of the standardized processes for releasing new products. ");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.SetSpacingAfter(0);
oParagraph.AddText("As we approach release of the product, the Legal Department is prepared ");
oParagraph.AddText("to develop all licensing agreements and has streamlined coordination with the marketing and sales department on the license terms and addendums. ");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.SetStyle(oSubtitleStyle);
oParagraph.AddText("Statement on Timeline");
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.SetSpacingAfter(0);
oParagraph.AddText("All timelines in this report are estimated and highly dependent upon each team meeting their individual objectives. There are many interdependencies that are detailed in the related project plan. ");
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.SetStyle(oSubtitleStyle);
oParagraph.AddText("Productivity Gains");
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.AddText("To support the new product, the Legal Department will maintain a centralized repository for all patent investigations");
oParagraph.AddText(" as well as marketing claims. ");
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.SetStyle(oSubtitleStyle);
oParagraph.AddText("License Agreements");
oParagraph = Api.CreateParagraph();
oParagraph.SetSpacingAfter(0);
oParagraph.AddText("All timelines in this report are estimated and highly dependent upon each team meetin");
oParagraph.AddText("g their individual objectives. I");
oParagraph.AddText("nterdependencies are detailed in the related project plan. ");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.SetStyle(oSubtitleStyle);
oParagraph.SetKeepNext(true);
oParagraph.SetKeepLines(true);
oParagraph.AddText("Revenue Forecasting");
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oParagraph.SetKeepNext(true);
oParagraph.SetKeepLines(true);
oParagraph.AddText("To support the new product, the Legal Department will maintain a centralized repository for all ");
oParagraph.AddText("patent investigations and");
oParagraph.AddText(" marketing claims. The release team will adhere to all of the stand");
oParagraph.AddText("ardized processes for releasing ");
oParagraph.AddText("new products. ");
var oTable = Api.CreateTable(2, 2);
oDocument.Push(oTable);
oTable.SetStyle(oDocument.GetStyle("TableGrid"));
oTable.SetWidth("twips", 4311);
oTable.SetTableLook(true, true, false, false, false, true);
oTable.SetTableBorderTop("single", 4, 0, 0xAF, 0xAD, 0x91);
oTable.SetTableBorderBottom("single", 4, 0, 0xAF, 0xAD, 0x91);
oTable.SetTableBorderLeft("single", 4, 0, 0xAF, 0xAD, 0x91);
oTable.SetTableBorderRight("single", 4, 0, 0xAF, 0xAD, 0x91);
oTable.SetTableBorderInsideH("single", 4, 0, 0xAF, 0xAD, 0x91);
oTable.SetTableBorderInsideV("single", 4, 0, 0xAF, 0xAD, 0x91);
var oRow1 = oTable.GetRow(0);
if (oRow1)
{
oRow1.SetHeight("atLeast", 201);
var oCell = oRow1.GetCell(0);
var oCellContent = oCell.GetContent();
oParagraph = oCellContent.GetElement(0);
oParagraph.SetJc("center");
oRun = oParagraph.AddText("2014");
oRun.SetBold(true);
oRun.SetColor(0, 0, 0, false);
}
var oRow2 = oTable.GetRow(1);
if (oRow2)
{
oRow2.SetHeight("atLeast", 1070);
}
// TODO: Добавить таблицу
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
//------------------------------------------------------------------------------------------------------------------
oLD.Recalculate_FromStart(true);
}
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