Code

handle request for not-compiled-in internal scripting; execute didn't check return...
authorrwst <rwst@users.sourceforge.net>
Mon, 29 May 2006 08:34:57 +0000 (08:34 +0000)
committerrwst <rwst@users.sourceforge.net>
Mon, 29 May 2006 08:34:57 +0000 (08:34 +0000)
src/extension/script/InkscapeScript.cpp
src/ui/dialog/scriptdialog.cpp

index 87d120245f038983fc15780bb8c3bb18d49ff84d..f403a3db0bb05f1018efa85d4bcdbb2e5732f9d2 100644 (file)
@@ -66,6 +66,9 @@ bool InkscapeScript::interpretScript(const Glib::ustring &script,
 #ifdef WITH_PERL
         langname="Perl";
         interp = new InkscapePerl();
+#else
+        g_print ("Internal Perl script functionality requested, but it was not compiled in!\n");
+        return false;
 #endif
         }
     else if (language == InkscapeScript::PYTHON)
@@ -73,6 +76,9 @@ bool InkscapeScript::interpretScript(const Glib::ustring &script,
 #ifdef WITH_PYTHON
         langname="Python";
         interp = new InkscapePython();
+#else
+        g_print ("Internal Python script functionality requested, but it was not compiled in!\n");
+        return false;
 #endif
         }
     else
index a0f7f433788d7bedc5224009a3c478ccc6ae3f0d..4836774641918a77e6d52e8c6478f14cad683826 100644 (file)
@@ -1,9 +1,4 @@
 /*
- * This dialog is for launching scripts whose main purpose if
- * the scripting of Inkscape itself.
- *
- * Authors:
- *   Bob Jamison
  *   Other dudes from The Inkscape Organization
  *
  * Copyright (C) 2004, 2005 Authors
@@ -146,7 +141,8 @@ lang)
     Glib::ustring output;
     Glib::ustring error;
     Inkscape::Extension::Script::InkscapeScript engine;
-    engine.interpretScript(script, output, error, lang);
+    bool ok = engine.interpretScript(script, output, error, lang);
+    if (!ok) return;
     outputText.get_buffer()->set_text(output);
     errorText.get_buffer()->set_text(error);
 }