Undo and Redo state update were setting the sketch to modified, even if it was not. Fixes #2653

This commit is contained in:
Federico Fissore 2015-02-19 11:37:30 +01:00
parent d1feeb5419
commit 78f2e87b00
1 changed files with 2 additions and 6 deletions

View File

@ -1365,6 +1365,7 @@ public class Editor extends JFrame implements RunnerListener {
public void actionPerformed(ActionEvent e) {
try {
undo.undo();
sketch.setModified(true);
} catch (CannotUndoException ex) {
//System.out.println("Unable to undo: " + ex);
//ex.printStackTrace();
@ -1386,17 +1387,11 @@ public class Editor extends JFrame implements RunnerListener {
undoItem.setEnabled(true);
undoItem.setText(undo.getUndoPresentationName());
putValue(Action.NAME, undo.getUndoPresentationName());
if (sketch != null) {
sketch.setModified(true); // 0107
}
} else {
this.setEnabled(false);
undoItem.setEnabled(false);
undoItem.setText(_("Undo"));
putValue(Action.NAME, "Undo");
if (sketch != null) {
sketch.setModified(false); // 0107
}
}
}
}
@ -1411,6 +1406,7 @@ public class Editor extends JFrame implements RunnerListener {
public void actionPerformed(ActionEvent e) {
try {
undo.redo();
sketch.setModified(true);
} catch (CannotRedoException ex) {
//System.out.println("Unable to redo: " + ex);
//ex.printStackTrace();