diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js
index b2862a2..17cc28f 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js
@@ -42,7 +42,7 @@ class EditedProperty extends C.Action {
this.newValue = newValue
this.propertyType = Objects.types[targetType].properties()[targetProperty]
if(valueIsExpressionNeedingImport) {
- if(this.propertyType == "Expression") {
+ if(typeof this.propertyType == 'object' && this.propertyType.type == "Expression") {
this.previousValue = new MathLib.Expression(this.previousValue);
this.newValue = new MathLib.Expression(this.newValue);
} else if(this.propertyType == "Domain") {
@@ -98,6 +98,10 @@ class EditedProperty extends C.Action {
this.prevString = JSON.stringify(this.previousValue)
this.nextString = JSON.stringify(this.newValue)
break;
+ case "Expression":
+ this.prevString = this.previousValue == null ? "null" : this.previousValue.toString()
+ this.nextString = this.newValue == null ? "null" : this.newValue.toString()
+ break;
}
} else {
this.prevString = this.previousValue == null ? "null" : this.previousValue.toString()
@@ -106,7 +110,7 @@ class EditedProperty extends C.Action {
// HTML
this.prevHTML = ' '+this.prevString+' '
this.nextHTML = ' '+this.nextString+' '
- if(Latex.enabled && this.propertyType == "Expression") {
+ if(Latex.enabled && typeof this.propertyType == 'object' && this.propertyType.type == "Expression") {
this.prevHTML= this.renderLatexAsHtml(this.previousValue.latexMarkup)
this.nextHTML= this.renderLatexAsHtml(this.newValue.latexMarkup)
}
diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/expression.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/expression.js
index a9b008a..9993152 100644
--- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/expression.js
+++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/expression.js
@@ -63,7 +63,6 @@ class Expression {
return this.cachedValue
}
C.currentVars = Object.assign({'x': x}, C.currentObjectsByName)
- //console.log("Executing", this.expr, "with", JSON.stringify(C.currentVars))
return this.calc.evaluate(C.currentVars)
}