Commit c27655bb authored by Ilya Kirillov's avatar Ilya Kirillov

Keeping work on a new class CBlockLevelSdt.

parent 5bf606ba
......@@ -4972,7 +4972,7 @@ CDocument.prototype.Internal_GetContentPosByXY = function(X, Y, PageNum, Columns
if (Y < PageBounds.Top)
return InlineElements[Pos];
if (Item.Pages.length > 1)
if (Item.GetPagesCount() > 1)
{
if (true !== Item.Is_StartFromNewPage())
return InlineElements[Pos + 1];
......
......@@ -8120,7 +8120,7 @@ CDocumentContent.prototype.Internal_GetContentPosByXY = function(X, Y, PageNum)
if (Y < Item.Pages[0].Bounds.Top)
return InlineElements[Pos];
if (Item.Pages.length > 1)
if (Item.GetPagesCount() > 1)
{
if (true !== Item.Is_StartFromNewPage())
return InlineElements[Pos + 1];
......
......@@ -142,6 +142,10 @@ CDocumentContentElementBase.prototype.Write_ToBinary2 = function(Writer)
CDocumentContentElementBase.prototype.Read_FromBinary2 = function(Reader)
{
};
CDocumentContentElementBase.prototype.Get_PagesCount = function()
{
return 0;
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
......@@ -188,7 +192,10 @@ CDocumentContentElementBase.prototype.private_GetColumnIndex = function(CurPage)
return (this.ColumnNum + CurPage) - (((this.ColumnNum + CurPage) / this.ColumnsCount | 0) * this.ColumnsCount);
};
//----------------------------------------------------------------------------------------------------------------------
CDocumentContentElementBase.prototype.GetPagesCount = function()
{
return this.Get_PagesCount();
};
//--------------------------------------------------------export--------------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {};
......
......@@ -95,6 +95,10 @@ CBlockLevelSdt.prototype.Is_EmptyPage = function(CurPage)
// TODO: Реализовать
return false;
};
CBlockLevelSdt.prototype.Get_PagesCount = function()
{
return this.Content.Get_PagesCount();
};
CBlockLevelSdt.prototype.Reset_RecalculateCache = function()
{
this.Content.Reset_RecalculateCache();
......@@ -110,8 +114,54 @@ CBlockLevelSdt.prototype.Read_FromBinary2 = function(Reader)
// String : Content id
this.Content = this.LogicDocument.Get_TableId().Get_ById(Reader.GetString2());
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt.prototype.Is_HdrFtr = function(bReturnHdrFtr)
{
return this.Parent.Is_HdrFtr(bReturnHdrFtr);
};
CBlockLevelSdt.prototype.Is_TopDocument = function(bReturnTopDocument)
{
return this.Parent.Is_TopDocument(bReturnTopDocument);
};
CBlockLevelSdt.prototype.Is_Cell = function()
{
return this.Parent.Is_TableCellContent();
};
CBlockLevelSdt.prototype.Get_Numbering = function()
{
return this.LogicDocument.Get_Numbering();
};
CBlockLevelSdt.prototype.Get_Styles = function()
{
return this.LogicDocument.Get_Styles();
};
CBlockLevelSdt.prototype.Get_TableStyleForPara = function()
{
return this.Parent.Get_TableStyleForPara();
};
CBlockLevelSdt.prototype.Get_ShapeStyleForPara = function()
{
return this.Parent.Get_ShapeStyleForPara();
};
CBlockLevelSdt.prototype.Get_Theme = function()
{
return this.Parent.Get_Theme();
};
CBlockLevelSdt.prototype.Get_PrevElementEndInfo = function()
{
return this.Parent.Get_PrevElementEndInfo(this);
};
CBlockLevelSdt.prototype.Get_EndInfo = function()
{
return this.Content.Get_EndInfo();
};
CBlockLevelSdt.prototype.Is_UseInDocument = function(Id)
{
if (Id === this.Content.GetId())
return this.Parent.Is_UseInDocument(this.GetId());
return false;
};
//--------------------------------------------------------export--------------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].CBlockLevelSdt = CBlockLevelSdt;
......
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