Commit b9268e07 authored by Ilya Kirillov's avatar Ilya Kirillov

Implemented working with locks in footnotes.

parent 18e791df
...@@ -181,7 +181,11 @@ if(typeof CDocument !== "undefined") ...@@ -181,7 +181,11 @@ if(typeof CDocument !== "undefined")
}; };
CFootnotesController.prototype.IsSelectionLocked = function(CheckType) CFootnotesController.prototype.IsSelectionLocked = function(CheckType)
{ {
// TODO: Реализовать for (var sId in this.Selection.Footnotes)
{
var oFootnote = this.Selection.Footnotes[sId];
oFootnote.Document_Is_SelectionLocked(CheckType);
}
}; };
} }
......
...@@ -4867,6 +4867,7 @@ CDocument.prototype.Selection_SetStart = function(X, Y, MouseEvent) ...@@ -4867,6 +4867,7 @@ CDocument.prototype.Selection_SetStart = function(X, Y, MouseEvent)
} }
else if (true !== bFlowTable && nInDrawing < 0 && true === bFootnotes) else if (true !== bFlowTable && nInDrawing < 0 && true === bFootnotes)
{ {
this.Selection_Remove();
this.Selection.Start = true; this.Selection.Start = true;
this.Selection.Use = true; this.Selection.Use = true;
...@@ -5739,7 +5740,23 @@ CDocument.prototype.Update_CursorType = function(X, Y, PageAbs, MouseEvent) ...@@ -5739,7 +5740,23 @@ CDocument.prototype.Update_CursorType = function(X, Y, PageAbs, MouseEvent)
return; return;
} }
this.Controller.UpdateCursorType(X, Y, PageAbs, MouseEvent); var nDocPosType = this.Get_DocPosType();
if (docpostype_HdrFtr === nDocPosType)
{
this.HeaderFooterController.UpdateCursorType(X, Y, PageAbs, MouseEvent);
}
else if (docpostype_DrawingObjects === nDocPosType)
{
this.DrawingsController.UpdateCursorType(X, Y, PageAbs, MouseEvent);
}
else
{
if (true === this.Footnotes.CheckHitInFootnote(X, Y, PageAbs))
this.Footnotes.UpdateCursorType(X, Y, PageAbs, MouseEvent);
else
this.LogicDocumentController.UpdateCursorType(X, Y, PageAbs, MouseEvent);
}
this.Api.sync_MouseMoveEndCallback(); this.Api.sync_MouseMoveEndCallback();
}; };
/** /**
...@@ -7929,6 +7946,10 @@ CDocument.prototype.Document_UpdateSelectionState = function() ...@@ -7929,6 +7946,10 @@ CDocument.prototype.Document_UpdateSelectionState = function()
return; return;
this.DrawingDocument.UpdateTargetTransform(null); this.DrawingDocument.UpdateTargetTransform(null);
// TODO: Надо подумать как это вынести в верхнюю функцию внутренние реализации типа controller_UpdateSelectionState
// потому что они все очень похожие.
this.Controller.UpdateSelectionState(); this.Controller.UpdateSelectionState();
// Обновим состояние кнопок Copy/Cut // Обновим состояние кнопок Copy/Cut
...@@ -8100,6 +8121,28 @@ CDocument.prototype.Can_CopyCut = function() ...@@ -8100,6 +8121,28 @@ CDocument.prototype.Can_CopyCut = function()
{ {
DrawingObjects = this.DrawingObjects; DrawingObjects = this.DrawingObjects;
} }
else if (docpostype_Footnotes === nDocPosType)
{
if (0 === this.Footnotes.Selection.Direction)
{
var oFootnote = this.Footnotes.GetCurFootnote();
if (oFootnote)
{
if (docpostype_DrawingObjects === oFootnote.Get_DocPosType())
{
DrawingObjects = this.DrawingObjects;
}
else
{
LogicDocument = oFootnote;
}
}
}
else
{
return true;
}
}
else //if (docpostype_Content === nDocPosType) else //if (docpostype_Content === nDocPosType)
{ {
LogicDocument = this; LogicDocument = this;
...@@ -8775,7 +8818,6 @@ CDocument.prototype.Get_SelectionState2 = function() ...@@ -8775,7 +8818,6 @@ CDocument.prototype.Get_SelectionState2 = function()
this.Selection_Remove(); this.Selection_Remove();
// Сохраняем Id ближайшего элемента в текущем классе // Сохраняем Id ближайшего элемента в текущем классе
var State = new CDocumentSelectionState(); var State = new CDocumentSelectionState();
var nDocPosType = this.Get_DocPosType(); var nDocPosType = this.Get_DocPosType();
if (docpostype_HdrFtr === nDocPosType) if (docpostype_HdrFtr === nDocPosType)
...@@ -8801,7 +8843,8 @@ CDocument.prototype.Get_SelectionState2 = function() ...@@ -8801,7 +8843,8 @@ CDocument.prototype.Get_SelectionState2 = function()
} }
else if (docpostype_Footnotes === nDocPosType) else if (docpostype_Footnotes === nDocPosType)
{ {
// TODO: Реализовать для сносок State.Type = docpostype_Footnotes;
State.Id = this.Footnotes.GetCurFootnote().Get_Id();
} }
else // if (docpostype_Content === nDocPosType) else // if (docpostype_Content === nDocPosType)
{ {
...@@ -8831,11 +8874,23 @@ CDocument.prototype.Set_SelectionState2 = function(State) ...@@ -8831,11 +8874,23 @@ CDocument.prototype.Set_SelectionState2 = function(State)
this.Content[this.CurPos.ContentPos].Cursor_MoveToStartPos(); this.Content[this.CurPos.ContentPos].Cursor_MoveToStartPos();
} }
} }
else if (docpostype_Footnotes === State.Type)
{
this.Set_DocPosType(docpostype_Footnotes);
var oFootnote = g_oTableId.Get_ById(State.Id);
if (oFootnote && true === this.Footnotes.Is_UseInDocument(State.Id))
{
this.Footnotes.private_SetCurrentFootnoteNoSelection(oFootnote);
oFootnote.Cursor_MoveToStartPos(false);
}
else
{
this.EndFootnotesEditing();
}
}
else // if ( docpostype_Content === State.Type ) else // if ( docpostype_Content === State.Type )
{ {
var ElementId = State.Data.Id; var CurId = State.Data.Id;
var CurId = ElementId;
var bFlag = false; var bFlag = false;
...@@ -9946,7 +10001,7 @@ CDocument.prototype.Get_AllParagraphs = function(Props) ...@@ -9946,7 +10001,7 @@ CDocument.prototype.Get_AllParagraphs = function(Props)
Element.Get_AllParagraphs(Props, ParaArray); Element.Get_AllParagraphs(Props, ParaArray);
} }
// TODO: Добавить обработку сносок this.Footnotes.GetAllParagraphs(Props, ParaArray);
} }
return ParaArray; return ParaArray;
......
...@@ -346,6 +346,14 @@ CFootnotesController.prototype.CheckHitInFootnote = function(X, Y, PageAbs) ...@@ -346,6 +346,14 @@ CFootnotesController.prototype.CheckHitInFootnote = function(X, Y, PageAbs)
return false; return false;
}; };
CFootnotesController.prototype.GetAllParagraphs = function(Props, ParaArray)
{
for (var sId in this.Footnote)
{
var oFootnote = this.Footnote[sId];
oFootnote.Get_AllParagraphs(Props, ParaArray);
}
};
CFootnotesController.prototype.StartSelection = function(X, Y, PageAbs, MouseEvent) CFootnotesController.prototype.StartSelection = function(X, Y, PageAbs, MouseEvent)
{ {
if (true === this.Selection.Use) if (true === this.Selection.Use)
......
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