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