Commit 5736b2e3 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

TurnOffHistory - теперь счетчик

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60920 954022d7-b5bf-4e40-9824-e11837661b57
parent 07d3539e
......@@ -2843,8 +2843,9 @@ function DrawingObjects() {
_this.updateDrawingObject = function(bInsert, operType, updateRange) {
if(History.TurnOffHistory > 0)
if(!History.Is_On())
return;
var metrics = null;
var count, bNeedRedraw = false, offset;
//this.controller.checkObjectsAndCallback(
......@@ -3817,8 +3818,9 @@ function DrawingObjects() {
_this.updateSizeDrawingObjects = function(target) {
if (History.TurnOffHistory > 0)
return;
if(!History.Is_On())
return;
var i, bNeedRecalc = false, drawingObject, coords;
if (target.target === c_oTargetType.RowResize) {
for (i = 0; i < aObjects.length; i++) {
......
......@@ -30,7 +30,7 @@ function CHistory(Document)
}
};
this.TurnOffHistory = false;
this.TurnOffHistory = 0;
this.MinorChanges = false; // Данный параметр нужен, чтобы определить влияют ли добавленные изменения на пересчет
this.BinaryWriter = new CMemory();
......@@ -52,6 +52,7 @@ CHistory.prototype =
this.SavedIndex = null;
this.ForceSave = false;
this.Points.length = 0;
this.TurnOffHistory = 0;
this.Internal_RecalcData_Clear();
},
......@@ -142,6 +143,9 @@ CHistory.prototype =
Create_NewPoint : function()
{
if ( 0 !== this.TurnOffHistory )
return;
if ( this.Index < this.SavedIndex && null !== this.SavedIndex )
{
this.SavedIndex = this.Index;
......@@ -186,10 +190,7 @@ CHistory.prototype =
// Data - сами изменения
Add : function(Class, Data)
{
if ( true === this.TurnOffHistory )
return;
if ( this.Index < 0 )
if ( 0 !== this.TurnOffHistory || this.Index < 0 )
return;
if (editor)
......@@ -455,17 +456,20 @@ CHistory.prototype =
TurnOff : function()
{
this.TurnOffHistory = true;
this.TurnOffHistory++;
},
TurnOn : function()
{
this.TurnOffHistory = false;
this.TurnOffHistory--;
if(this.TurnOffHistory < 0)
this.TurnOffHistory = 0;
},
/** @returns {boolean} */
Is_On : function()
{
return ( false === this.TurnOffHistory ? true : false ) ;
return (0 === this.TurnOffHistory);
},
Reset_SavedIndex : function()
......
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