From 6844f54c33f5783d6ca3cf065748bec84203b171 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Fri, 8 Jul 2011 16:22:58 -0300 Subject: auto-maximize the inkscape extension error dialog so that it is easier to read the error log (bzr r10427) --- src/extension/implementation/script.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 2f3e2cd65..e7599d996 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -855,6 +855,7 @@ void Script::checkStderr (const Glib::ustring &data, vbox->pack_start(*scrollwindow, true, true, 5 /* fix these */); + warning.maximize(); warning.run(); return; -- cgit v1.2.3 From e92a65c4ce56d565c59a4a314378de3e9b8fc48e Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 29 Aug 2011 21:07:21 +0200 Subject: Extensions. Fix for bug #813807 (Python error message window opens in a maximized state). (bzr r10598) --- src/extension/implementation/script.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index e7599d996..2f3e2cd65 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -855,7 +855,6 @@ void Script::checkStderr (const Glib::ustring &data, vbox->pack_start(*scrollwindow, true, true, 5 /* fix these */); - warning.maximize(); warning.run(); return; -- cgit v1.2.3 From 8ddc64a6158de6a9714bca05fe6207bbb472e22a Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 31 Aug 2011 18:58:40 +0200 Subject: Extensions. Fix for bug #789122 (changing current layer through an extension) thanks to cosmin. (bzr r10608) --- src/extension/implementation/script.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 2f3e2cd65..cac67844f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -729,8 +729,26 @@ void Script::effect(Inkscape::Extension::Effect *module, doc->doc()->emitReconstructionStart(); copy_doc(doc->doc()->rroot, mydoc->rroot); doc->doc()->emitReconstructionFinish(); - mydoc->release(); + SPObject *layer = NULL; + SPObject *obj = mydoc->getObjectById("base"); + + // Getting the named view from the document generated by the extension + SPNamedView *nv = (SPNamedView *) obj; + + //Check if it has a default layer set up + if ( nv->default_layer_id != 0 ) { + SPDocument *document = desktop->doc(); + //If so, get that layer + layer = document->getObjectById(g_quark_to_string(nv->default_layer_id)); + } + sp_namedview_update_layers_from_document(desktop); + //If that layer exists, + if (layer) { + //set the current layer + desktop->setCurrentLayer(layer); + } + mydoc->release(); } return; -- cgit v1.2.3 From f3e6d16ac75e7d1808cd49f6bbd4066dcb63ec29 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Fri, 2 Sep 2011 13:44:24 +0200 Subject: Extensions. Fix for a potential crasher in the extension scripts. (bzr r10611) --- src/extension/implementation/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index cac67844f..e4d850e5f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -736,7 +736,7 @@ void Script::effect(Inkscape::Extension::Effect *module, SPNamedView *nv = (SPNamedView *) obj; //Check if it has a default layer set up - if ( nv->default_layer_id != 0 ) { + if ( nv != NULL and nv->default_layer_id != 0 ) { SPDocument *document = desktop->doc(); //If so, get that layer layer = document->getObjectById(g_quark_to_string(nv->default_layer_id)); -- cgit v1.2.3 From 47b55c0d9fccf3994f86fd764cefca3a2f734dbe Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 15 Oct 2011 22:03:44 +0200 Subject: cppcheck (bzr r10678) --- src/extension/implementation/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index e4d850e5f..ca9c094db 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -821,7 +821,7 @@ void Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newr } // Delete the attributes of the old root nodes. - for (std::vector::const_iterator it = attribs.begin(); it != attribs.end(); it++) { + for (std::vector::const_iterator it = attribs.begin(); it != attribs.end(); ++it) { oldroot->setAttribute(*it, NULL); } -- cgit v1.2.3 From d0a75e28a727327d766b9050cda471a12e799511 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 19 Nov 2011 19:53:12 +0100 Subject: variable initialisation (bzr r10746) --- src/extension/implementation/script.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index ca9c094db..08624aff0 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -149,7 +149,8 @@ std::string Script::resolveInterpreterExecutable(const Glib::ustring &interpName of memory in the unloaded state. */ Script::Script() : - Implementation() + Implementation(), + _canceled(false) { } @@ -177,8 +178,7 @@ Script::~Script() string. This means that the caller of this function can always free what they are given (and should do it too!). */ -std::string -Script::solve_reldir(Inkscape::XML::Node *reprin) { +std::string Script::solve_reldir(Inkscape::XML::Node *reprin) { gchar const *s = reprin->attribute("reldir"); @@ -361,8 +361,7 @@ void Script::unload(Inkscape::Extension::Extension */*module*/) \param module The Extension in question */ -bool -Script::check(Inkscape::Extension::Extension *module) +bool Script::check(Inkscape::Extension::Extension *module) { int script_count = 0; Inkscape::XML::Node *child_repr = sp_repr_children(module->get_repr()); -- cgit v1.2.3 From c9d06adc5f8252eb3d2a90570d65afd0fd4c891b Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 17 Dec 2011 21:43:37 +0100 Subject: some static code analysis stuff (cppcheck warnings) (bzr r10779) --- src/extension/implementation/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 08624aff0..0a0282284 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -971,7 +971,7 @@ int Script::execute (const std::list &in_command, NULL, // STDIN &stdout_pipe, // STDOUT &stderr_pipe); // STDERR - } catch (Glib::Error e) { + } catch (Glib::Error &e) { printf("Can't Spawn!!! spawn returns: %s\n", e.what().data()); return 0; } -- cgit v1.2.3