Code

BUG 218090 opening of bitmap fails, now error message
authortheAdib <theAdib@users.sourceforge.net>
Sun, 10 May 2009 12:54:49 +0000 (12:54 +0000)
committertheAdib <theAdib@users.sourceforge.net>
Sun, 10 May 2009 12:54:49 +0000 (12:54 +0000)
src/extension/internal/gdkpixbuf-input.cpp
src/extension/system.cpp

index 0acf1648c6c5d1084efb0eca943724f8cf1bed8a..64a099c8a42e3c673b89b3348936c0e4050d6174 100644 (file)
@@ -19,10 +19,11 @@ namespace Internal {
 SPDocument *
 GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri)
 {
-    SPDocument *doc = sp_document_new(NULL, TRUE, TRUE);
+    SPDocument *doc = NULL;
     GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL );
 
     if (pb) {         /* We are readable */
+        doc = sp_document_new(NULL, TRUE, TRUE);
         bool saved = sp_document_get_undo_sensitive(doc);
         sp_document_set_undo_sensitive(doc, false); // no need to undo in this temporary document
 
index fdebd7b227ded8eaa9c1a5714e521aafbc05b1ef..a7828d3fc115e0bcb291b6e2fea29603c46b68d7 100644 (file)
@@ -93,7 +93,7 @@ open(Extension *key, gchar const *filename)
 
     SPDocument *doc = imod->open(filename);
     if (!doc) {
-        return NULL;
+        throw Input::open_failed();
     }
 
     if (last_chance_svg) {