Commit 623dd8af authored by Ilya.Kirillov's avatar Ilya.Kirillov

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

Добавлена возможность отключать рассчет текущей позиции в документе для ускорения работы некоторых функций. Исправлены мелкие баги в режиме рецензирования.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61441 954022d7-b5bf-4e40-9824-e11837661b57
parent cac787ea
...@@ -668,6 +668,7 @@ function CDocument(DrawingDocument) ...@@ -668,6 +668,7 @@ function CDocument(DrawingDocument)
this.TurnOffRecalc = false; this.TurnOffRecalc = false;
this.TurnOffInterfaceEvents = false; this.TurnOffInterfaceEvents = false;
this.TurnOffRecalcCurPos = false;
this.CheckEmptyElementsOnSelection = true; // При выделении проверять или нет пустой параграф в конце/начале выделения. this.CheckEmptyElementsOnSelection = true; // При выделении проверять или нет пустой параграф в конце/начале выделения.
...@@ -2262,6 +2263,9 @@ CDocument.prototype = ...@@ -2262,6 +2263,9 @@ CDocument.prototype =
RecalculateCurPos : function() RecalculateCurPos : function()
{ {
if (true === this.TurnOffRecalcCurPos)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection ) if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return; return;
...@@ -2290,6 +2294,9 @@ CDocument.prototype = ...@@ -2290,6 +2294,9 @@ CDocument.prototype =
Internal_CheckCurPage : function() Internal_CheckCurPage : function()
{ {
if (true === this.TurnOffRecalcCurPos)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection ) if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return; return;
...@@ -12114,6 +12121,19 @@ CDocument.prototype = ...@@ -12114,6 +12121,19 @@ CDocument.prototype =
} }
}, },
TurnOff_RecalculateCurPos : function()
{
this.TurnOffRecalcCurPos = true;
},
TurnOn_RecalculateCurPos : function(bUpdate)
{
this.TurnOffRecalcCurPos = false;
if (true === bUpdate)
this.Document_UpdateSelectionState();
},
Can_CopyCut : function() Can_CopyCut : function()
{ {
var bCanCopyCut = false; var bCanCopyCut = false;
...@@ -13490,6 +13510,8 @@ CDocument.prototype = ...@@ -13490,6 +13510,8 @@ CDocument.prototype =
// Отключаем пересчет, включим перед последним добавлением. Поскольку, // Отключаем пересчет, включим перед последним добавлением. Поскольку,
// у нас все добавляется в 1 параграф, так можно делать. // у нас все добавляется в 1 параграф, так можно делать.
this.TurnOffRecalc = true; this.TurnOffRecalc = true;
this.TurnOff_InterfaceEvents();
this.TurnOff_RecalculateCurPos();
var Count = sText.length; var Count = sText.length;
var e = global_keyboardEvent; var e = global_keyboardEvent;
...@@ -13507,6 +13529,8 @@ CDocument.prototype = ...@@ -13507,6 +13529,8 @@ CDocument.prototype =
// На случай, если Count = 0 // На случай, если Count = 0
this.TurnOffRecalc = false; this.TurnOffRecalc = false;
this.TurnOn_RecalculateCurPos(false);
this.TurnOn_InterfaceEvents(true);
} }
else else
{ {
...@@ -14293,6 +14317,9 @@ CDocument.prototype.private_StopSelection = function() ...@@ -14293,6 +14317,9 @@ CDocument.prototype.private_StopSelection = function()
}; };
CDocument.prototype.private_UpdateCurPage = function() CDocument.prototype.private_UpdateCurPage = function()
{ {
if (true === this.TurnOffRecalcCurPos)
return;
this.Internal_CheckCurPage(); this.Internal_CheckCurPage();
}; };
CDocument.prototype.private_UpdateCursorXY = function(bUpdateX, bUpdateY) CDocument.prototype.private_UpdateCursorXY = function(bUpdateX, bUpdateY)
......
...@@ -2461,7 +2461,7 @@ Paragraph.prototype = ...@@ -2461,7 +2461,7 @@ Paragraph.prototype =
else else
{ {
// TODO: В режиме рецензии элементы не удаляются, а позиция меняется прямо в ранах // TODO: В режиме рецензии элементы не удаляются, а позиция меняется прямо в ранах
if (this.LogicDocument == null || document_EditingType_Review !== this.LogicDocument.Get_EditingType()) if (!this.LogicDocument || document_EditingType_Review !== this.LogicDocument.Get_EditingType())
this.CurPos.ContentPos = ContentPos; this.CurPos.ContentPos = ContentPos;
} }
} }
...@@ -5250,6 +5250,7 @@ Paragraph.prototype = ...@@ -5250,6 +5250,7 @@ Paragraph.prototype =
// Если мы находимся в режиме рецензирования, то пробегаемся по всему содержимому гиперссылки и // Если мы находимся в режиме рецензирования, то пробегаемся по всему содержимому гиперссылки и
// проставляем, что все раны новые. // проставляем, что все раны новые.
if (this.LogicDocument && document_EditingType_Review === this.LogicDocument.Get_EditingType())
Hyperlink.Set_ReviewType(paragraphcontent_Reviewtype_Added, true); Hyperlink.Set_ReviewType(paragraphcontent_Reviewtype_Added, true);
} }
else if ( null !== HyperProps.Text && "" !== HyperProps.Text ) else if ( null !== HyperProps.Text && "" !== HyperProps.Text )
......
...@@ -7890,7 +7890,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -7890,7 +7890,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
case historyitem_ParaRun_ReviewType: case historyitem_ParaRun_ReviewType:
{ {
// Long : ReviewType // Long : ReviewType
Writer.WriteLong(Data.New); this.ReviewType = Reader.GetLong();
break; break;
} }
......
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