From 59dee01ed4509746c3a8ef0571124fb100bbcd1e Mon Sep 17 00:00:00 2001 From: rwst Date: Mon, 29 May 2006 08:34:57 +0000 Subject: [PATCH] handle request for not-compiled-in internal scripting; execute didn't check return value; fixes #1495283 --- src/extension/script/InkscapeScript.cpp | 6 ++++++ src/ui/dialog/scriptdialog.cpp | 8 ++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/extension/script/InkscapeScript.cpp b/src/extension/script/InkscapeScript.cpp index 87d120245..f403a3db0 100644 --- a/src/extension/script/InkscapeScript.cpp +++ b/src/extension/script/InkscapeScript.cpp @@ -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 diff --git a/src/ui/dialog/scriptdialog.cpp b/src/ui/dialog/scriptdialog.cpp index a0f7f4337..483677464 100644 --- a/src/ui/dialog/scriptdialog.cpp +++ b/src/ui/dialog/scriptdialog.cpp @@ -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); } -- 2.30.2