From aa844be794b36b44b624e579db7f0945b5d3927b Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 14 Aug 2010 21:22:11 +0200 Subject: Completely remove NRPixBlock (bzr r9508.1.67) --- src/file.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 50fcd3642..b6bc4c876 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include "application/application.h" #include "application/editor.h" -- cgit v1.2.3 From 861f06b2338b396878a679471d63a890febfc73b Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 14 Mar 2011 20:50:25 +0100 Subject: Import. Patch for Bug #716362 (Invalid result when drag and drop svg file), by Johannes Lipp. Fixed bugs: - https://launchpad.net/bugs/716362 (bzr r10104) --- src/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 2816b0434..c93188358 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -978,7 +978,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // Create a new group if necessary. Inkscape::XML::Node *newgroup = NULL; - if ((style && style->firstChild()) || items_count > 1) { + if ((style && style->attributeList()) || items_count > 1) { newgroup = xml_in_doc->createElement("svg:g"); sp_repr_css_set(newgroup, style, "style"); } -- cgit v1.2.3 From c260fcd615791615b33f55459dabe38e64ee3471 Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Fri, 15 Apr 2011 09:17:08 +0200 Subject: No more PrintWin32, including no special cases for non-Unicode Windows anymore. (bzr r9508.1.82) --- src/file.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index ae774bb52..86df2ed44 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1510,20 +1510,6 @@ sp_file_print(Gtk::Window& parentWindow) sp_print_document(parentWindow, doc); } -/** - * Display what the drawing would look like, if - * printed. - */ -void -sp_file_print_preview(gpointer /*object*/, gpointer /*data*/) -{ - - SPDocument *doc = SP_ACTIVE_DOCUMENT; - if (doc) - sp_print_preview_document(doc); - -} - /* Local Variables: -- cgit v1.2.3 From a4d0a358424440128cd4c4fb2915ccc4b86f4587 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 5 May 2011 23:21:51 -0700 Subject: Adding initial cut of resource manager. (bzr r10198) --- src/file.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index c93188358..a1fc23117 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -54,6 +54,7 @@ #include "path-prefix.h" #include "preferences.h" #include "print.h" +#include "resource-manager.h" #include "rdf.h" #include "selection-chemistry.h" #include "selection.h" @@ -209,14 +210,14 @@ sp_file_exit() * \param replace_empty if true, and the current desktop is empty, this document * will replace the empty one. */ -bool -sp_file_open(const Glib::ustring &uri, - Inkscape::Extension::Extension *key, - bool add_to_recent, bool replace_empty) +bool sp_file_open(const Glib::ustring &uri, + Inkscape::Extension::Extension *key, + bool add_to_recent, bool replace_empty) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; - if (desktop) + if (desktop) { desktop->setWaitingCursor(); + } SPDocument *doc = NULL; try { @@ -227,27 +228,30 @@ sp_file_open(const Glib::ustring &uri, doc = NULL; } - if (desktop) + if (desktop) { desktop->clearWaitingCursor(); + } if (doc) { SPDocument *existing = desktop ? sp_desktop_document(desktop) : NULL; if (existing && existing->virgin && replace_empty) { // If the current desktop is empty, open the document there - doc->ensureUpToDate(); + doc->ensureUpToDate(); // TODO this will trigger broken link warnings, etc. desktop->change_document(doc); doc->emitResizedSignal(doc->getWidth(), doc->getHeight()); } else { // create a whole new desktop and window - SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); + SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); // TODO this will trigger broken link warnings, etc. sp_create_window(dtw, TRUE); desktop = static_cast(dtw->view); } doc->virgin = FALSE; + // everyone who cares now has a reference, get rid of ours doc->doUnref(); + // resize the window to match the document properties sp_namedview_window_from_document(desktop); sp_namedview_update_layers_from_document(desktop); @@ -256,6 +260,14 @@ sp_file_open(const Glib::ustring &uri, sp_file_add_recent( doc->getURI() ); } + if ( inkscape_use_gui() ) { + // Perform a fixup pass for hrefs. + if ( Inkscape::ResourceManager::getManager().fixupBrokenLinks(doc) ) { + Glib::ustring msg = _("Broken links have been changed to point to existing files."); + desktop->showInfoDialog(msg); + } + } + return TRUE; } else { gchar *safeUri = Inkscape::IO::sanitizeString(uri.c_str()); -- cgit v1.2.3 From 3638efba5bec8a6afc9211aa6bbe289767d20b38 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 3 Jun 2011 19:45:55 -0700 Subject: Removed outdated/unsafe SP_DOCUMENT_DEFS macro and reduced usage of SP_ROOT() gtk type function/macro. (bzr r10254) --- src/file.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index a1fc23117..2e7e74610 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -802,7 +802,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens } else { dialog_title = (char const *) _("Select file to save to"); } - gchar* doc_title = doc->root->title(); + gchar* doc_title = doc->getRoot()->title(); Inkscape::UI::Dialog::FileSaveDialog *saveDialog = Inkscape::UI::Dialog::FileSaveDialog::create( parentWindow, @@ -975,7 +975,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, prevent_id_clashes(doc, in_doc); - SPObject *in_defs = SP_DOCUMENT_DEFS(in_doc); + SPObject *in_defs = in_doc->getDefs(); Inkscape::XML::Node *last_def = in_defs->getRepr()->lastChild(); SPCSSAttr *style = sp_css_attr_from_object(doc->getRoot()); @@ -1051,7 +1051,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // preserve parent and viewBox transformations // c2p is identity matrix at this point unless ensureUpToDate is called doc->ensureUpToDate(); - Geom::Affine affine = SP_ROOT(doc->getRoot())->c2p * SP_ITEM(place_to_insert)->i2doc_affine().inverse(); + Geom::Affine affine = doc->getRoot()->c2p * SP_ITEM(place_to_insert)->i2doc_affine().inverse(); sp_selection_apply_affine(selection, desktop->dt2doc() * affine * desktop->doc2dt(), true, false); // move to mouse pointer -- cgit v1.2.3 From cf0c689f665675b976215e80ec7c9acf1b2e49e6 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 21 Aug 2011 09:42:08 +0200 Subject: DBUS. Merging lp:~joakim-verona/inkscape/dbus-fixes changes. (bzr r10559) --- src/file.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 43d1ddaaa..c6d43fa51 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -952,7 +952,7 @@ sp_file_save_a_copy(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*d /** * Import a resource. Called by sp_file_import() */ -void +SPObject * file_import(SPDocument *in_doc, const Glib::ustring &uri, Inkscape::Extension::Extension *key) { @@ -1067,14 +1067,14 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, doc->doUnref(); DocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT, _("Import")); - + return new_obj; } else { gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), uri.c_str()); sp_ui_error_dialog(text); g_free(text); } - return; + return NULL; } -- cgit v1.2.3 From 72cc39b9f0b340548f395c7f61ca9662b34aea09 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 11:04:37 +0200 Subject: Refactor SPItem bounding box methods: remove NRRect usage and make code using them more obvious. Fix filter region computation. (bzr r10582.1.1) --- src/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index c6d43fa51..350281dee 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1056,7 +1056,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // move to mouse pointer { sp_desktop_document(desktop)->ensureUpToDate(); - Geom::OptRect sel_bbox = selection->bounds(); + Geom::OptRect sel_bbox = selection->visualBounds(); if (sel_bbox) { Geom::Point m( desktop->point() - sel_bbox->midpoint() ); sp_selection_move_relative(selection, m, false); -- cgit v1.2.3 From 20097d47e6945bceb57d2335d23fe764f493ab59 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 2 Oct 2011 20:44:17 -0700 Subject: Another minor pass of Doxygen cleanup. (bzr r10659) --- src/file.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 350281dee..e8901d306 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1,5 +1,6 @@ -/** @file - * @brief File/Print operations +/** + * @file + * File/Print operations. */ /* Authors: * Lauris Kaplinski -- cgit v1.2.3 From 4e51446f417ad82d2cdac758d0c5ce908ff88038 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 8 Dec 2011 11:53:54 +0000 Subject: Switch to top-level glib headers. Thanks to DimStar for patch Fixed bugs: - https://launchpad.net/bugs/898538 (bzr r10762) --- src/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index e8901d306..4feb36f9d 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -30,7 +30,7 @@ #endif #include -#include +#include #include #include "desktop.h" -- cgit v1.2.3