fixed the dreadful "Undo list index out of range" bug
This commit is contained in:
parent
f95eef2378
commit
bbfdaac633
@ -912,7 +912,7 @@ procedure TMainForm.UpdateUndo;
|
|||||||
begin
|
begin
|
||||||
SaveFlame(MainCp, Format('%.4d-', [UndoIndex]) + MainCp.name, AppPath + 'apophysis.undo');
|
SaveFlame(MainCp, Format('%.4d-', [UndoIndex]) + MainCp.name, AppPath + 'apophysis.undo');
|
||||||
Inc(UndoIndex);
|
Inc(UndoIndex);
|
||||||
inc(UndoMax);
|
UndoMax := UndoIndex; //Inc(UndoMax);
|
||||||
mnuSaveUndo.Enabled := true;
|
mnuSaveUndo.Enabled := true;
|
||||||
mnuUndo.Enabled := True;
|
mnuUndo.Enabled := True;
|
||||||
mnuPopUndo.Enabled := True;
|
mnuPopUndo.Enabled := True;
|
||||||
@ -1294,8 +1294,8 @@ begin
|
|||||||
if EntryExists(title, filename) then DeleteEntry(title, fileName);
|
if EntryExists(title, filename) then DeleteEntry(title, fileName);
|
||||||
Append(IFile);
|
Append(IFile);
|
||||||
end
|
end
|
||||||
else
|
else ReWrite(IFile);
|
||||||
ReWrite(IFile);
|
|
||||||
sl := TStringList.Create;
|
sl := TStringList.Create;
|
||||||
try
|
try
|
||||||
cp1.SaveToStringList(sl);
|
cp1.SaveToStringList(sl);
|
||||||
@ -1305,8 +1305,8 @@ begin
|
|||||||
for i := 0 to 255 do
|
for i := 0 to 255 do
|
||||||
begin
|
begin
|
||||||
WriteLn(IFile, IntToStr(cp1.cmap[i][0]) + ' ' +
|
WriteLn(IFile, IntToStr(cp1.cmap[i][0]) + ' ' +
|
||||||
IntToStr(cp1.cmap[i][1]) + ' ' +
|
IntToStr(cp1.cmap[i][1]) + ' ' +
|
||||||
IntToStr(cp1.cmap[i][2]))
|
IntToStr(cp1.cmap[i][2]))
|
||||||
end;
|
end;
|
||||||
WriteLn(IFile, ' }');
|
WriteLn(IFile, ' }');
|
||||||
finally
|
finally
|
||||||
@ -3250,7 +3250,7 @@ begin
|
|||||||
StopThread;
|
StopThread;
|
||||||
Inc(UndoIndex);
|
Inc(UndoIndex);
|
||||||
|
|
||||||
assert(UndoIndex < UndoMax, 'Undo list index out of range!');
|
assert(UndoIndex <= UndoMax, 'Undo list index out of range!');
|
||||||
|
|
||||||
LoadUndoFlame(UndoIndex, AppPath + 'apophysis.undo');
|
LoadUndoFlame(UndoIndex, AppPath + 'apophysis.undo');
|
||||||
mnuUndo.Enabled := True;
|
mnuUndo.Enabled := True;
|
||||||
|
Loading…
Reference in New Issue
Block a user