Commit 67d5f0df authored by Ilya Kirillov's avatar Ilya Kirillov

Implementing several functions of the CBlockLevelSdt class.

parent 68673581
......@@ -8357,7 +8357,7 @@ CDocument.prototype.Can_CopyCut = function()
{
if (selectionflag_Numbering === LogicDocument.Selection.Flag)
bCanCopyCut = false;
else if (LogicDocument.Selection.StartPos !== LogicDocument.Selection.EndPos || type_Paragraph === LogicDocument.Content[LogicDocument.Selection.StartPos].Get_Type())
else if (LogicDocument.Selection.StartPos !== LogicDocument.Selection.EndPos)
bCanCopyCut = true;
else
bCanCopyCut = LogicDocument.Content[LogicDocument.Selection.StartPos].Can_CopyCut();
......@@ -14729,36 +14729,15 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
EndPos = Temp;
}
var StartPr, Pr;
if (type_Paragraph == this.Content[StartPos].GetType())
{
StartPr = this.Content[StartPos].Get_CompiledPr2(false).ParaPr;
Pr = StartPr.Copy();
Pr.Locked = this.Content[StartPos].Lock.Is_Locked();
}
else if (type_Table == this.Content[StartPos].GetType())
{
StartPr = this.Content[StartPos].Get_Paragraph_ParaPr();
Pr = StartPr.Copy();
Pr.Locked = StartPr.Locked;
}
var StartPr = this.Content[StartPos].GetParagraphParaPr();
var Pr = StartPr.Copy();
Pr.Locked = StartPr.Locked;
for (var Index = StartPos + 1; Index <= EndPos; Index++)
{
var Item = this.Content[Index];
var TempPr;
if (type_Paragraph == Item.GetType())
{
TempPr = Item.Get_CompiledPr2(false).ParaPr;
TempPr.Locked = Item.Lock.Is_Locked();
}
else if (type_Table == Item.GetType())
{
TempPr = Item.Get_Paragraph_ParaPr();
}
Pr = Pr.Compare(TempPr);
var Item = this.Content[Index];
var TempPr = Item.GetParagraphParaPr();
Pr = Pr.Compare(TempPr);
}
if (undefined === Pr.Ind.Left)
......@@ -14775,7 +14754,9 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
// Если мы находимся в рамке, тогда дополняем ее свойства настройками границы и настройкой текста (если это буквица)
if (undefined != Result_ParaPr.FramePr && type_Paragraph === this.Content[StartPos].GetType())
{
this.Content[StartPos].Supplement_FramePr(Result_ParaPr.FramePr);
}
else if (StartPos === EndPos && StartPos > 0 && type_Paragraph === this.Content[StartPos - 1].GetType())
{
var PrevFrame = this.Content[StartPos - 1].Get_FramePr();
......@@ -14801,7 +14782,9 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
// Если мы находимся в рамке, тогда дополняем ее свойства настройками границы и настройкой текста (если это буквица)
if (undefined != Result_ParaPr.FramePr)
{
Item.Supplement_FramePr(Result_ParaPr.FramePr);
}
else if (this.CurPos.ContentPos > 0 && type_Paragraph === this.Content[this.CurPos.ContentPos - 1].GetType())
{
var PrevFrame = this.Content[this.CurPos.ContentPos - 1].Get_FramePr();
......@@ -14811,17 +14794,18 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
this.Content[this.CurPos.ContentPos - 1].Supplement_FramePr(Result_ParaPr.FramePr);
}
}
}
else if (type_Table == Item.GetType())
else
{
Result_ParaPr = Item.Get_Paragraph_ParaPr();
Result_ParaPr = Item.GetParagraphParaPr();
}
}
if (Result_ParaPr.Shd && Result_ParaPr.Shd.Unifill)
{
Result_ParaPr.Shd.Unifill.check(this.theme, this.Get_ColorMap());
}
return Result_ParaPr;
};
CDocument.prototype.controller_GetCurrentTextPr = function()
......@@ -15176,7 +15160,7 @@ CDocument.prototype.controller_CheckPosInSelection = function(X, Y, PageAbs, Nea
{
for (var Index = Start; Index <= End; Index++)
{
if (true === this.Content[Index].Selection_Check(0, 0, 0, NearPos))
if (true === this.Content[Index].CheckPosInSelection(0, 0, 0, NearPos))
return true;
}
......@@ -15196,7 +15180,7 @@ CDocument.prototype.controller_CheckPosInSelection = function(X, Y, PageAbs, Nea
else
{
var ElementPageIndex = this.private_GetElementPageIndexByXY(ContentPos, X, Y, PageAbs);
return this.Content[ContentPos].Selection_Check(X, Y, ElementPageIndex, undefined);
return this.Content[ContentPos].CheckPosInSelection(X, Y, ElementPageIndex, undefined);
}
}
}
......
This diff is collapsed.
......@@ -209,6 +209,14 @@ CDocumentContentElementBase.prototype.GetParagraphTextPr = function()
{
return this.Get_Paragraph_TextPr();
};
CDocumentContentElementBase.prototype.Get_Paragraph_ParaPr = function()
{
return new CParaPr();
};
CDocumentContentElementBase.prototype.GetParagraphParaPr = function()
{
return this.Get_Paragraph_ParaPr();
};
CDocumentContentElementBase.prototype.Hyperlink_CanAdd = function(bCheckInHyperlink)
{
return false;
......@@ -223,6 +231,56 @@ CDocumentContentElementBase.prototype.Selection_Draw_Page = function(CurPage)
CDocumentContentElementBase.prototype.StopSelection = function()
{
};
CDocumentContentElementBase.prototype.Get_SelectionBounds = function()
{
return {
Start : null,
End : null,
Direction : 0
};
};
CDocumentContentElementBase.prototype.GetSelectionBounds = function()
{
return this.Get_SelectionBounds();
};
CDocumentContentElementBase.prototype.RecalculateCurPos = function()
{
return null;
};
CDocumentContentElementBase.prototype.Can_CopyCut = function()
{
return false;
};
CDocumentContentElementBase.prototype.CanCopyCut = function()
{
return this.Can_CopyCut();
};
CDocumentContentElementBase.prototype.Selection_Check = function(X, Y, CurPage, NearPos)
{
return false;
};
CDocumentContentElementBase.prototype.CheckPosInSelection = function(X, Y, CurPage, NearPos)
{
return this.Selection_Check(X, Y, CurPage, NearPos);
};
CDocumentContentElementBase.prototype.Get_NearestPos = function(CurPage, X, Y, bAnchor, Drawing)
{
return {
X : 0,
Y : 0,
Height : 0,
PageNum : 0,
Internal : {Line : 0, Page : 0, Range : 0},
Transform : null,
Paragraph : null,
ContentPos : null,
SearchPos : null
};
};
CDocumentContentElementBase.prototype.GetNearestPos = function(CurPage, X, Y, bAnchor, Drawing)
{
return this.Get_NearestPos(CurPage, X, Y, bAnchor, Drawing);
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
......
......@@ -6352,7 +6352,7 @@ Paragraph.prototype.Selection_CheckParaEnd = function()
return this.Content[EndPos].Selection_CheckParaEnd();
};
Paragraph.prototype.Selection_Check = function(X, Y, PageIndex, NearPos)
Paragraph.prototype.Selection_Check = function(X, Y, CurPage, NearPos)
{
if (undefined !== NearPos)
{
......@@ -6363,10 +6363,10 @@ Paragraph.prototype.Selection_Check = function(X, Y, PageIndex, NearPos)
}
else
{
if (PageIndex < 0 || PageIndex >= this.Pages.length || true != this.Selection.Use)
if (CurPage < 0 || CurPage >= this.Pages.length || true != this.Selection.Use)
return false;
var SearchPosXY = this.Get_ParaContentPosByXY(X, Y, PageIndex, false, false, false);
var SearchPosXY = this.Get_ParaContentPosByXY(X, Y, CurPage, false, false, false);
if (true === SearchPosXY.InText)
{
......@@ -6999,6 +6999,12 @@ Paragraph.prototype.Get_Paragraph_TextPr = function()
return TextPr;
};
Paragraph.prototype.Get_Paragraph_ParaPr = function()
{
var ParaPr = this.Get_CompiledPr2(false).ParaPr;
ParaPr.Locked = this.Lock.Is_Locked();
return ParaPr;
};
/**
* Проверяем пустой ли параграф
*/
......@@ -8838,9 +8844,9 @@ Paragraph.prototype.Internal_CorrectAnchorPos = function(Result, Drawing)
/**
* Получем ближающую возможную позицию курсора
*/
Paragraph.prototype.Get_NearestPos = function(PageIndex, X, Y, bAnchor, Drawing)
Paragraph.prototype.Get_NearestPos = function(CurPage, X, Y, bAnchor, Drawing)
{
var SearchPosXY = this.Get_ParaContentPosByXY(X, Y, PageIndex, false, false);
var SearchPosXY = this.Get_ParaContentPosByXY(X, Y, CurPage, false, false);
this.Set_ParaContentPos(SearchPosXY.Pos, true, SearchPosXY.Line, SearchPosXY.Range);
var ContentPos = this.Get_ParaContentPos(false, false);
......@@ -12007,6 +12013,10 @@ Paragraph.prototype.IsColumnBreakOnLeft = function()
return false;
};
Paragraph.prototype.Can_CopyCut = function()
{
return true;
};
var pararecalc_0_All = 0;
var pararecalc_0_None = 1;
......
......@@ -183,6 +183,10 @@ CBlockLevelSdt.prototype.Get_Paragraph_TextPr = function()
{
return this.Content.Get_Paragraph_TextPr();
};
CBlockLevelSdt.prototype.Get_Paragraph_ParaPr = function()
{
return this.Content.Get_Paragraph_ParaPr();
};
CBlockLevelSdt.prototype.Hyperlink_CanAdd = function(bCheckInHyperlink)
{
return this.Content.Hyperlink_CanAdd(bCheckInHyperlink);
......@@ -191,6 +195,26 @@ CBlockLevelSdt.prototype.Selection_Draw_Page = function(CurPage)
{
this.Content.Selection_Draw_Page(CurPage);
};
CBlockLevelSdt.prototype.Get_SelectionBounds = function()
{
return this.Content.Get_SelectionBounds();
};
CBlockLevelSdt.prototype.RecalculateCurPos = function()
{
return this.Content.RecalculateCurPos();
};
CBlockLevelSdt.prototype.Can_CopyCut = function()
{
return this.Content.Can_CopyCut();
};
CBlockLevelSdt.prototype.Selection_Check = function(X, Y, CurPage, NearPos)
{
return this.Content.Selection_Check(X, Y, CurPage, NearPos);
};
CBlockLevelSdt.prototype.Get_NearestPos = function(CurPage, X, Y, bAnchor, Drawing)
{
return this.Content.Get_NearestPos(CurPage, X, Y, bAnchor, Drawing);
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt.prototype.Is_HdrFtr = function(bReturnHdrFtr)
{
......
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