src/LDObject.cc

changeset 697
2766f7b037ad
parent 694
3868f52da6b9
--- a/src/LDObject.cc	Mon Mar 10 01:16:00 2014 +0200
+++ b/src/LDObject.cc	Mon Mar 10 13:26:02 2014 +0200
@@ -686,6 +686,7 @@
 void LDOverlay::invert() {}
 
 // =============================================================================
+//
 // Hook the set accessors of certain properties to this changeProperty function.
 // It takes care of history management so we can capture low-level changes, this
 // makes history stuff work out of the box.
@@ -697,14 +698,17 @@
 	if (*ptr == val)
 		return;
 
-	if (obj->document() && (idx = obj->lineNumber()) != -1)
+	if (obj->document() != null && (idx = obj->lineNumber()) != -1)
 	{
 		QString before = obj->asText();
 		*ptr = val;
 		QString after = obj->asText();
 
 		if (before != after)
+		{
 			obj->document()->addToHistory (new EditHistory (idx, before, after));
+			g_win->R()->compileObject (obj);
+		}
 	}
 	else
 		*ptr = val;

mercurial