Commit 97718524 authored by Ilya Kirillov's avatar Ilya Kirillov

Keeping implementing of a new class CBlockLevelSdt.

parent 3e299227
......@@ -1670,7 +1670,9 @@ CDocumentContent.prototype.Is_InDrawing = function(X, Y, CurPag
CDocumentContent.prototype.Get_CurrentPage_Absolute = function()
{
if (docpostype_DrawingObjects == this.CurPos.Type)
{
return this.LogicDocument.DrawingObjects.getCurrentPageAbsolute();
}
else //if ( docpostype_Content === this.CurPos.Type )
{
var Pos = ( true === this.Selection.Use && selectionflag_Numbering !== this.Selection.Flag ? this.Selection.EndPos : this.CurPos.ContentPos );
......@@ -1680,6 +1682,10 @@ CDocumentContent.prototype.Get_CurrentPage_Absolute = function()
return 0;
};
CDocumentContent.prototype.Get_CurrentPage_Relative = function()
{
return this.CurPage;
};
CDocumentContent.prototype.DocumentStatistics = function(Stats)
{
var Count = this.Content.length;
......
......@@ -149,6 +149,30 @@ CDocumentContentElementBase.prototype.Get_PagesCount = function()
CDocumentContentElementBase.prototype.Document_CreateFontMap = function(FontMap)
{
};
CDocumentContentElementBase.prototype.Is_InText = function(X, Y, CurPage)
{
return false;
};
CDocumentContentElementBase.prototype.Update_CursorType = function(X, Y, CurPage)
{
};
CDocumentContentElementBase.prototype.Selection_SetStart = function(X, Y, CurPage, MouseEvent, isTableBorder)
{
};
CDocumentContentElementBase.prototype.Selection_SetEnd = function(X, Y, CurPage, MouseEvent, isTableBorder)
{
};
CDocumentContentElementBase.prototype.Selection_IsEmpty = function(isCheckHidden)
{
return true;
};
CDocumentContentElementBase.prototype.Get_SelectedElementsInfo = function(oInfo)
{
};
CDocumentContentElementBase.prototype.Document_UpdateRulersState = function(CurPage)
{
this.Content.Document_UpdateRulersState(CurPage);
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
......@@ -194,6 +218,14 @@ CDocumentContentElementBase.prototype.private_GetColumnIndex = function(CurPage)
{
return (this.ColumnNum + CurPage) - (((this.ColumnNum + CurPage) / this.ColumnsCount | 0) * this.ColumnsCount);
};
CDocumentContentElementBase.prototype.Get_CurrentPage_Absolute = function()
{
return this.private_GetAbsolutePageIndex(0);
};
CDocumentContentElementBase.prototype.Get_CurrentPage_Relative = function()
{
return this.private_GetRelativePageIndex(0);
};
//----------------------------------------------------------------------------------------------------------------------
CDocumentContentElementBase.prototype.GetPagesCount = function()
{
......
......@@ -84,7 +84,12 @@ CBlockLevelSdt.prototype.Recalculate_Page = function(CurPage)
{
var RecalcResult = this.Content.Recalculate_Page(CurPage, true);
return RecalcResult;
if (recalcresult2_End === RecalcResult)
return recalcresult_NextElement;
else if (recalcresult2_NextPage === RecalcResult)
return recalcresult_NextPage;
else if (recalcresult2_CurPage === RecalcResult)
return recalcresult_CurPage;
};
CBlockLevelSdt.prototype.Get_PageBounds = function(CurPage)
{
......@@ -118,6 +123,42 @@ CBlockLevelSdt.prototype.Draw = function(CurPage, oGraphics)
{
this.Content.Draw(CurPage, oGraphics);
};
CBlockLevelSdt.prototype.Get_CurrentPage_Absolute = function()
{
return this.Content.Get_CurrentPage_Absolute();
};
CBlockLevelSdt.prototype.Get_CurrentPage_Relative = function()
{
return this.Content.Get_CurrentPage_Relative();
};
CBlockLevelSdt.prototype.Is_InText = function(X, Y, CurPage)
{
return this.Content.Is_InText(X, Y, CurPage);
};
CBlockLevelSdt.prototype.Update_CursorType = function(X, Y, CurPage)
{
return this.Content.Update_CursorType(X, Y, CurPage);
};
CBlockLevelSdt.prototype.Selection_SetStart = function(X, Y, CurPage, MouseEvent, isTableBorder)
{
this.Content.Selection_SetStart(X, Y, CurPage, MouseEvent, isTableBorder);
};
CBlockLevelSdt.prototype.Selection_SetEnd = function(X, Y, CurPage, MouseEvent, isTableBorder)
{
this.Content.Selection_SetEnd(X, Y, CurPage, MouseEvent, isTableBorder);
};
CBlockLevelSdt.prototype.Selection_IsEmpty = function(isCheckHidden)
{
return this.Content.Selection_IsEmpty(isCheckHidden);
};
CBlockLevelSdt.prototype.Get_SelectedElementsInfo = function(oInfo)
{
this.Content.Get_SelectedElementsInfo(oInfo);
};
CBlockLevelSdt.prototype.Document_UpdateRulersState = function(CurPage)
{
this.Content.Document_UpdateRulersState(CurPage);
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt.prototype.Is_HdrFtr = function(bReturnHdrFtr)
{
......@@ -185,10 +226,14 @@ CBlockLevelSdt.prototype.OnContentReDraw = function(StartPageAbs, EndPageAbs)
{
this.Parent.OnContentReDraw(StartPageAbs, EndPageAbs);
};
CDocumentContentElementBase.prototype.Document_CreateFontMap = function(FontMap)
CBlockLevelSdt.prototype.Document_CreateFontMap = function(FontMap)
{
this.Content.Document_CreateFontMap(FontMap);
};
CBlockLevelSdt.prototype.Get_ParentTextTransform = function()
{
return this.Parent.Get_ParentTextTransform();
};
//--------------------------------------------------------export--------------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].CBlockLevelSdt = CBlockLevelSdt;
......@@ -199,6 +244,9 @@ function TEST_ADD_SDT()
{
var oLogicDocument = editor.WordControl.m_oLogicDocument;
var oSdt = new CBlockLevelSdt(oLogicDocument, oLogicDocument);
oSdt.Content.Paragraph_Add(new ParaText("S"));
oSdt.Content.Paragraph_Add(new ParaText("d"));
oSdt.Content.Paragraph_Add(new ParaText("t"));
oLogicDocument.Internal_Content_Add(1, oSdt);
oLogicDocument.Recalculate_FromStart();
......
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