summaryrefslogtreecommitdiffstats
path: root/src/extension/system.cpp
diff options
context:
space:
mode:
authorJon Phillips <jon@fabricatorz.com>2006-08-22 21:24:21 +0000
committerkidproto <kidproto@users.sourceforge.net>2006-08-22 21:24:21 +0000
commita4cc625e3e8baed9c7c14f2c0ffa09144b6ed321 (patch)
tree5f2251774ad19e497ceb49727cb1de51dc77eee4 /src/extension/system.cpp
parentI added a key configuration for this command, changed a variable name and add... (diff)
downloadinkscape-a4cc625e3e8baed9c7c14f2c0ffa09144b6ed321.tar.gz
inkscape-a4cc625e3e8baed9c7c14f2c0ffa09144b6ed321.zip
I added Johan's badass patch for save a copy with the features I requested.
Now it all works quite well! Great! (bzr r1630)
Diffstat (limited to 'src/extension/system.cpp')
-rw-r--r--src/extension/system.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index 3a8a54214..41d6e7513 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -7,6 +7,7 @@
* Authors:
* Ted Gould <ted@gould.cx>
*
+ * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) 2002-2004 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
@@ -244,17 +245,25 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
throw Output::no_overwrite();
}
- // if 'official' save the filename and extension for future saves.
+ omod->save(doc, fileName);
+
if (official) {
// save the filename for next use
sp_document_set_uri(doc, fileName);
- // also save the extension for next use
- Inkscape::XML::Node *repr = sp_document_repr_root(doc);
- repr->setAttribute("inkscape:output_extension", omod->get_id());
+ gboolean saved = sp_document_get_undo_sensitive(doc);
+ // also save the extension for next use
+ Inkscape::XML::Node *repr = sp_document_repr_root(doc);
+ sp_document_set_undo_sensitive (doc, FALSE);
+ repr->setAttribute("inkscape:output_extension", omod->get_id());
+ // set the "dataloss" attribute if the chosen extension is lossy
+ repr->setAttribute("inkscape:dataloss", NULL);
+ if ( omod->causes_dataloss() ) {
+ repr->setAttribute("inkscape:dataloss", "true");
+ }
+ repr->setAttribute("sodipodi:modified", NULL);
+ sp_document_set_undo_sensitive (doc, saved);
}
- omod->save(doc, fileName);
-
g_free(fileName);
return;
}