summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2009-04-05 22:39:37 +0000
committerpjrm <pjrm@users.sourceforge.net>2009-04-05 22:39:37 +0000
commit7e517990f4ea4c33612e749e114ddba43b73d4bb (patch)
tree474dbeb5091eff1d740a40bd08d602c4eab19cc5 /src
parentfunctional noop: extension/system.cpp: g_strdup handles NULL fine, so don't b... (diff)
downloadinkscape-7e517990f4ea4c33612e749e114ddba43b73d4bb.tar.gz
inkscape-7e517990f4ea4c33612e749e114ddba43b73d4bb.zip
noop: whitespace (and localize one var)
(bzr r7631)
Diffstat (limited to 'src')
-rw-r--r--src/extension/system.cpp48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index edbe42dac..390206f30 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -8,7 +8,7 @@
* Ted Gould <ted@gould.cx>
* Johan Engelen <johan@shouraizou.nl>
*
- * Copyright (C) 2006-2007 Johan Engelen
+ * Copyright (C) 2006-2007 Johan Engelen
* Copyright (C) 2002-2004 Ted Gould
*
* Released under GNU GPL, read the file 'COPYING' for more information
@@ -96,7 +96,7 @@ open(Extension *key, gchar const *filename)
}
if (last_chance_svg) {
- /* We can't call sp_ui_error_dialog because we may be
+ /* We can't call sp_ui_error_dialog because we may be
running from the console, in which case calling sp_ui
routines will cause a segfault. See bug 1000350 - bryce */
// sp_ui_error_dialog(_("Format autodetect failed. The file is being opened as SVG."));
@@ -255,45 +255,47 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
saved_modified = doc->isModifiedSinceSave();
saved_output_extension = g_strdup(repr->attribute("inkscape:output_extension"));
saved_dataloss = g_strdup(repr->attribute("inkscape:dataloss"));
- saved_uri = g_strdup(doc->uri);
- }
+ saved_uri = g_strdup(doc->uri);
+ }
- // update attributes:
- bool saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive (doc, false);
+ // Update attributes:
{
- // save the filename for next use
- sp_document_set_uri(doc, fileName);
- // also save the extension for next use
- 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");
+ bool const saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive(doc, false);
+ {
+ // save the filename for next use
+ sp_document_set_uri(doc, fileName);
+ // also save the extension for next use
+ 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");
+ }
}
+ sp_document_set_undo_sensitive(doc, saved);
+ doc->setModifiedSinceSave(false);
}
- sp_document_set_undo_sensitive (doc, saved);
- doc->setModifiedSinceSave(false);
omod->save(doc, fileName);
-
- // if it is an unofficial save, set the modified attributes back to what they were
+
+ // If it is an unofficial save, set the modified attributes back to what they were.
if ( !official) {
- saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive (doc, false);
+ bool const saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive(doc, false);
{
repr->setAttribute("inkscape:output_extension", saved_output_extension);
repr->setAttribute("inkscape:dataloss", saved_dataloss);
sp_document_set_uri(doc, saved_uri);
}
- sp_document_set_undo_sensitive (doc, saved);
+ sp_document_set_undo_sensitive(doc, saved);
doc->setModifiedSinceSave(saved_modified);
g_free(saved_output_extension);
g_free(saved_dataloss);
g_free(saved_uri);
}
-
+
g_free(fileName);
return;
}