From 2ced3393f87dd11df4eb6327fa000ae8cda47ed0 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Tue, 21 Dec 2010 19:43:32 +0100 Subject: Indent support for XSLT extensions output. (bzr r9971) --- src/extension/implementation/xslt.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index c929ba19a..762051339 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -29,6 +29,7 @@ #include #include +#include Inkscape::XML::Document * sp_repr_do_read (xmlDocPtr doc, const gchar * default_ns); @@ -217,11 +218,16 @@ XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const params[0] = NULL; xmlDocPtr newdoc = xsltApplyStylesheet(_stylesheet, svgdoc, params); - xmlSaveFile(filename, newdoc); + //xmlSaveFile(filename, newdoc); + xsltSaveResultToFilename(filename, newdoc, _stylesheet, 0); + xmlFreeDoc(newdoc); xmlFreeDoc(svgdoc); + xsltCleanupGlobals(); + xmlCleanupParser(); + return; } -- cgit v1.2.3 From 68a87c54e8134effdb8169d895d434441d3b2299 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 31 Jan 2011 17:48:10 +0100 Subject: Extensions. Fix for Bug #668895 (Extensions with tags fail to load). (bzr r10020) --- src/extension/implementation/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index bc143fd14..428ee626f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -236,7 +236,7 @@ bool Script::check_existence(const std::string &command) } //Don't search when it is an absolute path. */ - if (!Glib::path_is_absolute(command)) { + if (Glib::path_is_absolute(command)) { if (Glib::file_test(command, Glib::FILE_TEST_EXISTS)) { return true; } else { -- cgit v1.2.3 From 0f535660ee7c8ba0a6befb9066a9f97168e034db Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 2 Feb 2011 18:26:59 +0100 Subject: Extensions. Check element now search in the extension directory (see Bug #668895, Extensions with tags fail to load). (bzr r10023) --- src/extension/implementation/script.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 428ee626f..0f234c7d4 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -45,7 +45,7 @@ #include "xml/attribute-record.h" #include "util/glib-list-iterators.h" - +#include "path-prefix.h" #ifdef WIN32 @@ -229,7 +229,6 @@ Script::solve_reldir(Inkscape::XML::Node *reprin) { */ bool Script::check_existence(const std::string &command) { - // Check the simple case first if (command.empty()) { return false; @@ -243,13 +242,14 @@ bool Script::check_existence(const std::string &command) return false; } } - - std::string path = Glib::getenv("PATH"); - if (path.empty()) { - /* There is no `PATH' in the environment. - The default search path is the current directory */ - path = G_SEARCHPATH_SEPARATOR_S; - } + + // First search in the extension path and the current directory + std::string path = INKSCAPE_EXTENSIONDIR; + path.append(";"); + path.append(G_SEARCHPATH_SEPARATOR_S); + path.append(";"); + // And then the PATH environment variable. + path.append(Glib::getenv("PATH")); std::string::size_type pos = 0; std::string::size_type pos2 = 0; -- cgit v1.2.3 From 53933f5fea9d07d1ba6304b88439fba257ee8c34 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Wed, 2 Feb 2011 22:24:36 +0100 Subject: update to latest 2geom ! (bzr r10025) --- src/extension/implementation/implementation.cpp | 8 ++++---- src/extension/implementation/implementation.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index a8533a427..b1b671026 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -148,7 +148,7 @@ Implementation::finish(Inkscape::Extension::Print */*module*/) /* Rendering methods */ unsigned int -Implementation::bind(Inkscape::Extension::Print */*module*/, Geom::Matrix const */*transform*/, float /*opacity*/) +Implementation::bind(Inkscape::Extension::Print */*module*/, Geom::Affine const */*transform*/, float /*opacity*/) { return 0; } @@ -166,14 +166,14 @@ Implementation::comment(Inkscape::Extension::Print */*module*/, char const */*co } unsigned int -Implementation::fill(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Matrix const */*ctm*/, SPStyle const */*style*/, +Implementation::fill(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Affine const */*ctm*/, SPStyle const */*style*/, NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/) { return 0; } unsigned int -Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Matrix const */*transform*/, SPStyle const */*style*/, +Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector const &/*pathv*/, Geom::Affine const */*transform*/, SPStyle const */*style*/, NRRect const */*pbox*/, NRRect const */*dbox*/, NRRect const */*bbox*/) { return 0; @@ -181,7 +181,7 @@ Implementation::stroke(Inkscape::Extension::Print */*module*/, Geom::PathVector unsigned int Implementation::image(Inkscape::Extension::Print */*module*/, unsigned char */*px*/, unsigned int /*w*/, unsigned int /*h*/, unsigned int /*rs*/, - Geom::Matrix const */*transform*/, SPStyle const */*style*/) + Geom::Affine const */*transform*/, SPStyle const */*style*/) { return 0; } diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index 9de70dce7..bf584b401 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -100,20 +100,20 @@ public: /* ----- Rendering methods ----- */ virtual unsigned bind(Inkscape::Extension::Print *module, - Geom::Matrix const *transform, + Geom::Affine const *transform, float opacity); virtual unsigned release(Inkscape::Extension::Print *module); virtual unsigned comment(Inkscape::Extension::Print *module, const char * comment); virtual unsigned fill(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, - Geom::Matrix const *ctm, + Geom::Affine const *ctm, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, NRRect const *bbox); virtual unsigned stroke(Inkscape::Extension::Print *module, Geom::PathVector const &pathv, - Geom::Matrix const *transform, + Geom::Affine const *transform, SPStyle const *style, NRRect const *pbox, NRRect const *dbox, @@ -123,7 +123,7 @@ public: unsigned int w, unsigned int h, unsigned int rs, - Geom::Matrix const *transform, + Geom::Affine const *transform, SPStyle const *style); virtual unsigned text(Inkscape::Extension::Print *module, char const *text, -- cgit v1.2.3 From 2dd7659790b8dcd3fbb77d80fd15450f5be08c32 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 9 Feb 2011 19:48:47 +0100 Subject: Extensions. New fix for Bug #668895 (Extensions with tags fail to load). (bzr r10038) --- src/extension/implementation/script.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 0f234c7d4..cc54194ec 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -189,7 +189,6 @@ Script::solve_reldir(Inkscape::XML::Node *reprin) { } Glib::ustring reldir = s; - for (unsigned int i=0; i < Inkscape::Extension::Extension::search_path.size(); i++) { @@ -200,7 +199,7 @@ Script::solve_reldir(Inkscape::XML::Node *reprin) { NULL); Glib::ustring filename = fname; g_free(fname); - + //printf("Filename: %s\n", filename.c_str()); if ( Inkscape::IO::file_test(filename.c_str(), G_FILE_TEST_EXISTS) ) { return Glib::filename_from_utf8(filename); } @@ -242,13 +241,11 @@ bool Script::check_existence(const std::string &command) return false; } } - - // First search in the extension path and the current directory - std::string path = INKSCAPE_EXTENSIONDIR; - path.append(";"); - path.append(G_SEARCHPATH_SEPARATOR_S); + + // First search in the current directory + std::string path = G_SEARCHPATH_SEPARATOR_S; path.append(";"); - // And then the PATH environment variable. + // And then in the PATH environment variable. path.append(Glib::getenv("PATH")); std::string::size_type pos = 0; @@ -379,8 +376,11 @@ Script::check(Inkscape::Extension::Extension *module) if (!command_text.empty()) { /* I've got the command */ bool existance = check_existence(command_text); - if (!existance) + if (!existance) { return false; + } + } else { + return false; } } -- cgit v1.2.3 From db451544150359dab56c14150a58f58ec76798b4 Mon Sep 17 00:00:00 2001 From: Adib Taraben Date: Tue, 15 Feb 2011 00:36:45 +0100 Subject: preview dialogue for pdf-import-cairo (bzr r10049.1.1) --- src/extension/implementation/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index cc54194ec..2f3e2cd65 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -603,7 +603,7 @@ void Script::save(Inkscape::Extension::Output *module, file_listener fileout; int data_read = execute(command, params, tempfilename_in, fileout); - + bool success = false; if (data_read > 0) { -- cgit v1.2.3 From 0e0ce7571944e0a9d60294b6efdc855e6df52db8 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 22 Feb 2011 01:17:44 -0800 Subject: Finished cleanup of outdated SP_OBJECT_REPR C macro. (bzr r10067) --- src/extension/implementation/implementation.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index b1b671026..63181d0c4 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -96,23 +96,26 @@ Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc* return; } /* Implementation::save */ -Gtk::Widget * -Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, ImplementationDocumentCache * docCache) { - if (module->param_visible_count() == 0) return NULL; +Gtk::Widget *Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, ImplementationDocumentCache * /*docCache*/) +{ + if (module->param_visible_count() == 0) { + return NULL; + } SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = sp_desktop_selection((SPDesktop *)view)->itemList(); - Inkscape::XML::Node * first_select = NULL; + Inkscape::XML::Node const* first_select = NULL; if (selected != NULL) { const SPItem * item = *selected; - first_select = SP_OBJECT_REPR(item); + first_select = item->getRepr(); } - return module->autogui(current_document, first_select, changeSignal); -} /* Implementation::prefs_effect */ + // TODO deal with this broken const correctness: + return module->autogui(current_document, const_cast(first_select), changeSignal); +} // Implementation::prefs_effect void Implementation::effect(Inkscape::Extension::Effect */*module*/, Inkscape::UI::View::View */*document*/, ImplementationDocumentCache * /*docCache*/) { -- cgit v1.2.3 From ff48e858e196274501b82872555d9464d7c7119f Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Fri, 4 Mar 2011 16:57:04 +0100 Subject: Extensions. Fix for Bug #341353 (The user must know about a XSLT problem). Fixed bugs: - https://launchpad.net/bugs/341353 (bzr r10079) --- src/extension/implementation/xslt.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/extension/implementation') diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index 762051339..8b6e6c701 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -219,8 +219,7 @@ XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const xmlDocPtr newdoc = xsltApplyStylesheet(_stylesheet, svgdoc, params); //xmlSaveFile(filename, newdoc); - xsltSaveResultToFilename(filename, newdoc, _stylesheet, 0); - + int success = xsltSaveResultToFilename(filename, newdoc, _stylesheet, 0); xmlFreeDoc(newdoc); xmlFreeDoc(svgdoc); @@ -228,6 +227,10 @@ XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const xsltCleanupGlobals(); xmlCleanupParser(); + if (success < 1) { + throw Inkscape::Extension::Output::save_failed(); + } + return; } -- cgit v1.2.3