Commit 2328b023 authored by Ilya Kirillov's avatar Ilya Kirillov

Рефакторинг функций связанных с обновлением интерфейса.

parent e857a6e9
This diff is collapsed.
...@@ -626,6 +626,18 @@ CDocumentControllerBase.prototype.CanMergeTableCells = function(){return false;} ...@@ -626,6 +626,18 @@ CDocumentControllerBase.prototype.CanMergeTableCells = function(){return false;}
* @returns {boolean} * @returns {boolean}
*/ */
CDocumentControllerBase.prototype.CanSplitTableCells = function(){return false;}; CDocumentControllerBase.prototype.CanSplitTableCells = function(){return false;};
/**
* Обновляем состояние интерфейса.
*/
CDocumentControllerBase.prototype.UpdateInterfaceState = function(){};
/**
* Обновляем состояние линеек.
*/
CDocumentControllerBase.prototype.UpdateRulersState = function(){};
/**
* Обновляем состояние селекта и курсора.
*/
CDocumentControllerBase.prototype.UpdateSelectionState = function(){};
/** /**
* Добавляем элемент в параграф. * Добавляем элемент в параграф.
* @param oItem * @param oItem
......
...@@ -372,6 +372,34 @@ CDrawingsController.prototype.CanSplitTableCells = function() ...@@ -372,6 +372,34 @@ CDrawingsController.prototype.CanSplitTableCells = function()
{ {
return this.DrawingObjects.tableCheckSplit(); return this.DrawingObjects.tableCheckSplit();
}; };
CDrawingsController.prototype.UpdateInterfaceState = function()
{
var oTargetTextObject = AscFormat.getTargetTextObject(this.DrawingObjects);
if (oTargetTextObject)
{
this.LogicDocument.Interface_Update_DrawingPr();
this.DrawingObjects.documentUpdateInterfaceState();
}
else
{
this.DrawingObjects.resetInterfaceTextPr();
this.DrawingObjects.updateTextPr();
this.LogicDocument.Interface_Update_DrawingPr();
this.DrawingObjects.updateParentParagraphParaPr();
}
};
CDrawingsController.prototype.UpdateRulersState = function()
{
// Вызываем данную функцию, чтобы убрать рамку буквицы
this.DrawingDocument.Set_RulerState_Paragraph(null);
this.LogicDocument.Document_UpdateRulersStateBySection(this.LogicDocument.CurPos.ContentPos);
this.DrawingObjects.documentUpdateRulersState();
};
CDrawingsController.prototype.UpdateSelectionState = function()
{
this.DrawingObjects.documentUpdateSelectionState();
this.LogicDocument.Document_UpdateTracks();
};
CDrawingsController.prototype.AddToParagraph = function(oItem, bRecalculate) CDrawingsController.prototype.AddToParagraph = function(oItem, bRecalculate)
{ {
......
...@@ -987,6 +987,18 @@ CFootnotesController.prototype.CanSplitTableCells = function() ...@@ -987,6 +987,18 @@ CFootnotesController.prototype.CanSplitTableCells = function()
// TODO: Реализовать // TODO: Реализовать
return false; return false;
}; };
CFootnotesController.prototype.UpdateInterfaceState = function()
{
// TODO: Реализовать
};
CFootnotesController.prototype.UpdateRulersState = function()
{
// TODO: Реализовать
};
CFootnotesController.prototype.UpdateSelectionState = function()
{
// TODO: Реализовать
};
CFootnotesController.prototype.AddToParagraph = function(oItem, bRecalculate) CFootnotesController.prototype.AddToParagraph = function(oItem, bRecalculate)
{ {
......
...@@ -321,6 +321,21 @@ CHdrFtrController.prototype.CanSplitTableCells = function() ...@@ -321,6 +321,21 @@ CHdrFtrController.prototype.CanSplitTableCells = function()
{ {
return this.HdrFtr.Table_CheckSplit(); return this.HdrFtr.Table_CheckSplit();
}; };
CHdrFtrController.prototype.UpdateInterfaceState = function()
{
this.LogicDocument.Interface_Update_HdrFtrPr();
this.HdrFtr.Document_UpdateInterfaceState();
};
CHdrFtrController.prototype.UpdateRulersState = function()
{
this.DrawingDocument.Set_RulerState_Paragraph(null);
this.HdrFtr.Document_UpdateRulersState(this.LogicDocument.CurPage);
};
CHdrFtrController.prototype.UpdateSelectionState = function()
{
this.HdrFtr.Document_UpdateSelectionState();
this.LogicDocument.Document_UpdateTracks();
};
......
...@@ -297,7 +297,18 @@ CLogicDocumentController.prototype.CanSplitTableCells = function() ...@@ -297,7 +297,18 @@ CLogicDocumentController.prototype.CanSplitTableCells = function()
{ {
return this.LogicDocument.controller_CanSplitTableCells(); return this.LogicDocument.controller_CanSplitTableCells();
}; };
CLogicDocumentController.prototype.UpdateInterfaceState = function()
{
this.LogicDocument.controller_UpdateInterfaceState();
};
CLogicDocumentController.prototype.UpdateRulersState = function()
{
this.LogicDocument.controller_UpdateRulersState();
};
CLogicDocumentController.prototype.UpdateSelectionState = function()
{
this.LogicDocument.controller_UpdateSelectionState();
};
CLogicDocumentController.prototype.AddToParagraph = function(oItem) CLogicDocumentController.prototype.AddToParagraph = function(oItem)
{ {
......
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