index eb3f85ed8a60708adba492176e4b6765c8815079..3f8c17fb1c51867bb739c98f6a8e6bfc615dea0d 100644 (file)
--- a/src/extension/output.cpp
+++ b/src/extension/output.cpp
* Authors:
* Ted Gould <ted@gould.cx>
*
* 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
* Copyright (C) 2002-2004 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
only used at runtime and shouldn't be saved. One that may surprise
people is the output extension. This is not saved so that the IDs
could be changed, and old files will still work properly.
only used at runtime and shouldn't be saved. One that may surprise
people is the output extension. This is not saved so that the IDs
could be changed, and old files will still work properly.
-
- After the file is saved by the implmentation the output_extension
- and dataloss variables are recreated. The output_extension is set
- to this extension so that future saves use this extension. Dataloss
- is set so that a warning will occur on closing the document that
- there may be some dataloss from this extension.
*/
void
Output::save (SPDocument * doc, const gchar * uri)
{
*/
void
Output::save (SPDocument * doc, const gchar * uri)
{
- bool modified = false;
- Inkscape::XML::Node * repr = sp_document_repr_root(doc);
-
- gboolean saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive (doc, FALSE);
- repr->setAttribute("inkscape:output_extension", NULL);
- repr->setAttribute("inkscape:dataloss", NULL);
- if (repr->attribute("sodipodi:modified") != NULL)
- modified = true;
- repr->setAttribute("sodipodi:modified", NULL);
- sp_document_set_undo_sensitive (doc, saved);
-
try {
imp->save(this, doc, uri);
}
catch (...) {
try {
imp->save(this, doc, uri);
}
catch (...) {
- if (modified)
- repr->setAttribute("sodipodi:modified", "true");
throw;
}
throw;
}
- saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive (doc, FALSE);
- repr->setAttribute("inkscape:output_extension", get_id());
- if (dataloss) {
- repr->setAttribute("inkscape:dataloss", "true");
- }
- sp_document_set_undo_sensitive (doc, saved);
-
return;
}
return;
}