summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4ce92b)
raw | patch | inline | side by side (parent: b4ce92b)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 2 Mar 2008 15:54:04 +0000 (15:54 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 2 Mar 2008 15:54:04 +0000 (15:54 +0000) |
src/extension/internal/gdkpixbuf-input.cpp | patch | blob | history |
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index 943300c9ef85a0fad0de6dfb8061b0dc724e4da6..0b01a6ab1a7ec703ee21e0290807ded2388b9408 100644 (file)
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);
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;
}