Commit c50d47c6 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Добавлены функции в документ для включения/отключения пересчета и отсылки сообщений в интерфейс.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58165 954022d7-b5bf-4e40-9824-e11837661b57
parent 244ca920
......@@ -1287,7 +1287,8 @@ CDrawingDocument.prototype =
var _len = _params.length / 4;
editor["Call_TurnOffRecalculate"]();
this.LogicDocument.TurnOff_Recalculate();
this.LogicDocument.TurnOff_InterfaceEvents();
this.StartUpdateOverlay();
......@@ -1324,7 +1325,8 @@ CDrawingDocument.prototype =
this.EndUpdateOverlay();
editor["Call_TurnOnRecalculate"]();
this.LogicDocument.TurnOn_Recalculate(true);
this.LogicDocument.TurnOn_InterfaceEvents(true);
},
__DD_ConvertCoordsFromCursor : function(x, y)
......
......@@ -581,7 +581,8 @@ function CDocument(DrawingDocument)
this.RecalcId = 0; // Номер пересчета
this.FullRecalc = new CDocumentRecalculateState();
this.TurnOffRecalc = false;
this.TurnOffRecalc = false;
this.TurnOffInterfaceEvents = false;
this.Numbering = new CNumbering();
this.Styles = new CStyles();
......@@ -888,6 +889,28 @@ CDocument.prototype =
return this.clrSchemeMap;
},
/**
* Данная функция предназначена для отключения пересчета. Это может быть полезно, т.к. редактор всегда запускает пересчет после каждого действия.
*
*/
TurnOff_Recalculate : function()
{
this.TurnOffRecalc = true;
},
/**
* Включаем пересчет, если он был отключен
*
* @param {bool} bRecalculate Запускать ли пересчет
*/
TurnOn_Recalculate : function(bRecalculate)
{
this.TurnOffRecalc = false;
if (bRecalculte)
this.Recalculate();
},
// Пересчет содержимого Документа
Recalculate : function(bOneParagraph, bRecalcContentLast, _RecalcData)
{
......@@ -11356,6 +11379,9 @@ CDocument.prototype =
// Обновляем текущее состояние (определяем где мы находимся, картинка/параграф/таблица/колонтитул)
Document_UpdateInterfaceState : function()
{
if (true === this.TurnOffInterfaceEvents)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -11422,11 +11448,12 @@ CDocument.prototype =
this.Document_UpdateCanAddHyperlinkState();
this.Document_UpdateSectionPr();
},
// Обновляем линейки
Document_UpdateRulersState : function()
{
if (true === this.TurnOffInterfaceEvents)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -11498,7 +11525,6 @@ CDocument.prototype =
}
}
},
Document_UpdateRulersStateBySection : function()
{
// В данной функции мы уже точно знаем, что нам секцию нужно выбирать исходя из текущего параграфа
......@@ -11513,10 +11539,12 @@ CDocument.prototype =
this.DrawingDocument.Set_RulerState_Paragraph( { L : L, T : T, R : R, B : B }, true );
},
// Обновляем линейки
Document_UpdateSelectionState : function()
{
if (true === this.TurnOffInterfaceEvents)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -11598,6 +11626,9 @@ CDocument.prototype =
Document_UpdateUndoRedoState : function()
{
if (true === this.TurnOffInterfaceEvents)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -11625,6 +11656,9 @@ CDocument.prototype =
Document_UpdateCopyCutState : function()
{
if (true === this.TurnOffInterfaceEvents)
return;
// Во время работы селекта не обновляем состояние
if ( true === this.Selection.Start )
return;
......@@ -11674,6 +11708,9 @@ CDocument.prototype =
Document_UpdateCanAddHyperlinkState : function()
{
if (true === this.TurnOffInterfaceEvents)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -11683,6 +11720,9 @@ CDocument.prototype =
Document_UpdateSectionPr : function()
{
if (true === this.TurnOffInterfaceEvents)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -11693,6 +11733,31 @@ CDocument.prototype =
var PageSize = this.Get_DocumentPageSize();
editor.sync_DocSizeCallback( PageSize.W, PageSize.H );
},
/**
* Отключаем отсылку сообщений в интерфейс.
*/
TurnOff_InterfaceEvents : function()
{
this.TurnOffInterfaceEvents = true;
},
/**
* Включаем отсылку сообщений в интерфейс.
*
* @param {bool} bUpdate Обновлять ли интерфейс
*/
TurnOn_InterfaceEvents : function(bUpdate)
{
this.TurnOffInterfaceEvents = true;
if (true === bUpdate)
{
this.Document_UpdateInterfaceState();
this.Document_UpdateSelectionState();
this.Document_UpdateRulersState();
}
},
//-----------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//-----------------------------------------------------------------------------------
......
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