From a4cc625e3e8baed9c7c14f2c0ffa09144b6ed321 Mon Sep 17 00:00:00 2001 From: Jon Phillips Date: Tue, 22 Aug 2006 21:24:21 +0000 Subject: I added Johan's badass patch for save a copy with the features I requested. Now it all works quite well! Great! (bzr r1630) --- src/extension/system.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/extension/system.cpp') 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 * + * Copyright (C) 2006 Johan Engelen * 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; } -- cgit v1.2.3