index 36cc5787b0ab4d3862edfbb8fbdca3cfcacbc7e2..bc143fd14ece526f129b0c68576dc9d107e8081e 100644 (file)
* Bryce Harrington <bryce@osdl.org>
* Ted Gould <ted@gould.cx>
* Jon A. Cruz <jon@joncruz.org>
+ * Abhishek Sharma
*
* Copyright (C) 2002-2005,2007 Authors
*
#include "extension/db.h"
#include "script.h"
#include "dialogs/dialog-events.h"
-#include "application/application.h"
+#include "inkscape.h"
#include "xml/node.h"
#include "xml/attribute-record.h"
} // data_read
if (mydoc != NULL) {
- g_free(mydoc->base);
- mydoc->base = NULL;
- mydoc->change_uri_and_hrefs(filenameArg);
+ mydoc->setBase(0);
+ mydoc->changeUriAndHrefs(filenameArg);
}
// make sure we don't leak file descriptors from g_file_open_tmp
file_listener fileout;
- execute(command, params, tempfilename_in, fileout);
+ int data_read = execute(command, params, tempfilename_in, fileout);
+
+ bool success = false;
- std::string lfilename = Glib::filename_from_utf8(filenameArg);
- bool success = fileout.toFile(lfilename);
+ if (data_read > 0) {
+ std::string lfilename = Glib::filename_from_utf8(filenameArg);
+ success = fileout.toFile(lfilename);
+ }
// make sure we don't leak file descriptors from g_file_open_tmp
close(tempfd_in);
Glib::ustring stderr_data = fileerr.string();
if (stderr_data.length() != 0 &&
- Inkscape::NSApplication::Application::getUseGui()
+ inkscape_use_gui()
) {
checkStderr(stderr_data, Gtk::MESSAGE_INFO,
_("Inkscape has received additional data from the script executed. "
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :