diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-03-02 15:54:04 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-03-02 15:54:04 +0000 |
| commit | 6ee2e6b8fd61d6f39c48f2b5ebbabd6abf10cbea (patch) | |
| tree | 73444efce7e61e058d9f7bd02498e6b205547988 /src/extension/internal/gdkpixbuf-input.cpp | |
| parent | fix crash bug #197664 (diff) | |
| download | inkscape-6ee2e6b8fd61d6f39c48f2b5ebbabd6abf10cbea.tar.gz inkscape-6ee2e6b8fd61d6f39c48f2b5ebbabd6abf10cbea.zip | |
improved fix crash bug #197664
(bzr r4922)
Diffstat (limited to 'src/extension/internal/gdkpixbuf-input.cpp')
| -rw-r--r-- | src/extension/internal/gdkpixbuf-input.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 943300c9e..0b01a6ab1 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -21,11 +21,12 @@ SPDocument * GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) { SPDocument *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 GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL ); if (pb) { /* We are readable */ + bool saved = sp_document_get_undo_sensitive(doc); + sp_document_set_undo_sensitive(doc, false); // no need to undo in this temporary document + Inkscape::XML::Node *repr = NULL; double width = gdk_pixbuf_get_width(pb); @@ -66,13 +67,12 @@ GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) gdk_pixbuf_unref(pb); //alter the canvas size to fit the image size fit_canvas_to_drawing(doc); + // restore undo, as now this document may be shown to the user if a bitmap was opened + sp_document_set_undo_sensitive(doc, saved); } else { printf("GdkPixbuf loader failed\n"); } - // restore undo, as now this document may be shown to the user if a bitmap was opened - sp_document_set_undo_sensitive(doc, saved); - return doc; } |
