diff --git a/.gitignore b/.gitignore index b26024c..a94c6d0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ local.properties .loadpath .recommenders +*.class + # Eclipse Core .project @@ -55,4 +57,3 @@ local.properties .cache-main .scala_dependencies .worksheet - diff --git a/eric/JSprogram/JSFunctions.java b/eric/JSprogram/JSFunctions.java index 1ccc60d..9fc1227 100644 --- a/eric/JSprogram/JSFunctions.java +++ b/eric/JSprogram/JSFunctions.java @@ -5758,7 +5758,9 @@ public class JSFunctions { getC().lastButN(i).setShowName(false); } - if(TargetsNamesArray.length<2) { + if (TargetsNamesArray.length == 0) { + return getC().lastButN(0).getName(); + } else if (TargetsNamesArray.length == 1) { return TargetsNamesArray[0]; } else { return TargetsNamesArray; @@ -5785,7 +5787,9 @@ public class JSFunctions { getC().lastButN(i).setShowName(false); } - if(TargetsNamesArray.length<2) { + if (TargetsNamesArray.length == 0) { + return getC().lastButN(0).getName(); + } else if (TargetsNamesArray.length == 1) { return TargetsNamesArray[0]; } else { return TargetsNamesArray; @@ -7650,14 +7654,21 @@ public class JSFunctions { try { ExecuteMacro("","@builtin@/3Dcircle1","O,X,Y,Z,"+a+","+b); } - catch (final Exception f) {} + catch (final Exception f) { + Println("Potential problem executing macro @builtin@/3Dcircle1(O,X,Y,Z," + + a + "," + b + "):" + f.getMessage()); + } getC().lastButN(0).setShowName(false); } else { name=parseVariables(name); try { ExecuteMacro("","@builtin@/3Dcircle1","O,X,Y,Z,"+a+","+b); } - catch (final Exception f) {} + catch (final Exception f) { + Println("Potential problem executing macro assignment " + + name + " = @builtin@/3Dcircle1(O,X,Y,Z," + + a + "," + b + "):" + f.getMessage()); + } getC().lastButN(0).setName(name); } Normalize(0); @@ -7679,14 +7690,21 @@ public class JSFunctions { try { ExecuteMacro("","@builtin@/3Dcircle1","O,X,Y,Z,"+a+","+b); } - catch (final Exception f) {} + catch (final Exception f) { + Println("Il y a peut-etre une probleme avec macro @builtin@/3Dcircle1(O,X,Y,Z," + + a + "," + b + "):" + f.getMessage()); + } getC().lastButN(0).setShowName(false); } else { name=parseVariables(name); try { ExecuteMacro("","@builtin@/3Dcircle1","O,X,Y,Z,"+a+","+b); } - catch (final Exception f) {} + catch (final Exception f) { + Println("Il y a peut-etre une probleme avec macro assignment " + + name + " = @builtin@/3Dcircle1(O,X,Y,Z," + + a + "," + b + "):" + f.getMessage()); + } getC().lastButN(0).setName(name); } Normalize(0); diff --git a/lib/jlatexmath-minimal-0.9.4.jar b/lib/jlatexmath-minimal-0.9.4.jar new file mode 100644 index 0000000..0df52f7 Binary files /dev/null and b/lib/jlatexmath-minimal-0.9.4.jar differ diff --git a/rene/zirkel/macro/MacroRunner.java b/rene/zirkel/macro/MacroRunner.java index da54c55..0a6c782 100644 --- a/rene/zirkel/macro/MacroRunner.java +++ b/rene/zirkel/macro/MacroRunner.java @@ -1290,45 +1290,9 @@ public class MacroRunner extends ObjectConstructor implements Selector { if (o==null) { throw new ConstructionException(Global.name("exception.notfound")); } - if (p[Param] instanceof PointObject) { - if (!(o instanceof PointObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof SegmentObject) { - if (!(o instanceof SegmentObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof LineObject) { - if (!(o instanceof LineObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof RayObject) { - if (!(o instanceof RayObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof PrimitiveLineObject) { - if (!(o instanceof PrimitiveLineObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof PrimitiveCircleObject) { - if (!(o instanceof PrimitiveCircleObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof QuadricObject) { - if (!(o instanceof QuadricObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof ExpressionObject) { - if (!(o instanceof ExpressionObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else if (p[Param] instanceof TextObject) { - if (!(o instanceof TextObject)) { - throw new ConstructionException(Global.name("exception.type")); - } - } else { - throw new ConstructionException(Global.name("exception.type")); - } + if (!isAdmissible(zc, o)) { + throw new ConstructionException(Global.name("exception.type")); + } Params[i]=o; Param++; }