diff options
Diffstat (limited to 'src/extension/system.cpp')
| -rw-r--r-- | src/extension/system.cpp | 21 |
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; } |
