Commit f27636c2 authored by Ilya Kirillov's avatar Ilya Kirillov

Undo/redo functions are working with both types of changes like an old object...

Undo/redo functions are working with both types of changes like an old object and like a new classes.
parent ef45a769
......@@ -2891,6 +2891,11 @@
{
return this.Class;
};
CChangesBase.prototype.RefreshRecalcData = function()
{
if (this.Class && this.Class.Refresh_RecalcData)
this.Class.Refresh_RecalcData(this);
};
window['AscDFH'].CChangesBase = CChangesBase;
/**
* Базовый класс для изменения свойств.
......
......@@ -250,8 +250,17 @@ CHistory.prototype =
for (var Index = Point.Items.length - 1; Index >= 0; Index--)
{
var Item = Point.Items[Index];
Item.Class.Undo(Item.Data);
Item.Class.Refresh_RecalcData(Item.Data);
if (Item.Data && Item.Data.IsChangesClass && Item.Data.IsChangesClass())
{
Item.Data.Undo();
Item.Data.RefreshRecalcData();
}
else
{
Item.Class.Undo(Item.Data);
Item.Class.Refresh_RecalcData(Item.Data);
}
}
}
}
......@@ -263,8 +272,16 @@ CHistory.prototype =
for (var Index = Point.Items.length - 1; Index >= 0; Index--)
{
var Item = Point.Items[Index];
Item.Class.Undo(Item.Data);
Item.Class.Refresh_RecalcData(Item.Data);
if (Item.Data && Item.Data.IsChangesClass && Item.Data.IsChangesClass())
{
Item.Data.Undo();
Item.Data.RefreshRecalcData();
}
else
{
Item.Class.Undo(Item.Data);
Item.Class.Refresh_RecalcData(Item.Data);
}
}
}
......@@ -290,8 +307,17 @@ CHistory.prototype =
for ( var Index = 0; Index < Point.Items.length; Index++ )
{
var Item = Point.Items[Index];
Item.Class.Redo( Item.Data );
Item.Class.Refresh_RecalcData( Item.Data );
if (Item.Data && Item.Data.IsChangesClass && Item.Data.IsChangesClass())
{
Item.Data.Redo();
Item.Data.RefreshRecalcData();
}
else
{
Item.Class.Redo(Item.Data);
Item.Class.Refresh_RecalcData(Item.Data);
}
}
// Восстанавливаем состояние на следующую точку
......
......@@ -190,6 +190,7 @@ CChangesRunRemoveItem.prototype.Undo = function()
};
CChangesRunRemoveItem.prototype.Redo = function()
{
var oRun = this.Class;
oRun.Content.splice(this.Pos, this.EndPos - this.Pos + 1);
oRun.RecalcInfo.Measure = true;
......
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