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