summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2009-04-07 06:11:20 +0000
committerpjrm <pjrm@users.sourceforge.net>2009-04-07 06:11:20 +0000
commit967b6e19cf9346618bf7e20dcd7bed70c8c27ab7 (patch)
tree3183f5c5c43796e786022e6bc024ea228839a4f4 /src
parentnoop: whitespace (diff)
downloadinkscape-967b6e19cf9346618bf7e20dcd7bed70c8c27ab7.tar.gz
inkscape-967b6e19cf9346618bf7e20dcd7bed70c8c27ab7.zip
noop: rename a local var
(bzr r7646)
Diffstat (limited to 'src')
-rw-r--r--src/selection-chemistry.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 62fbdf172..a57e5cfeb 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -2515,11 +2515,14 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop)
g_get_current_time(&cu);
guint current = (int) (cu.tv_sec * 1000000 + cu.tv_usec) % 1024;
- // Create the filename
- gchar *filename = g_strdup_printf("%s-%s-%u.png", document->name, SP_OBJECT_REPR(items->data)->attribute("id"), current);
+ // Create the filename.
+ gchar *const basename = g_strdup_printf("%s-%s-%u.png",
+ document->name,
+ SP_OBJECT_REPR(items->data)->attribute("id"),
+ current);
// Imagemagick is known not to handle spaces in filenames, so we replace anything but letters,
// digits, and a few other chars, with "_"
- g_strcanon(filename, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.=+~$#@^&!?", '_');
+ g_strcanon(basename, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.=+~$#@^&!?", '_');
// Build the complete path by adding document base dir, if set, otherwise home dir
gchar * directory = NULL;
@@ -2529,7 +2532,7 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop)
if (directory == NULL) {
directory = homedir_path(NULL);
}
- gchar *filepath = g_build_filename(directory, filename, NULL);
+ gchar *filepath = g_build_filename(directory, basename, NULL);
//g_print("%s\n", filepath);
@@ -2631,7 +2634,7 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop)
if (pb) {
// Create the repr for the image
Inkscape::XML::Node * repr = xml_doc->createElement("svg:image");
- repr->setAttribute("xlink:href", filename);
+ repr->setAttribute("xlink:href", basename);
repr->setAttribute("sodipodi:absref", filepath);
if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid
sp_repr_set_svg_double(repr, "width", width);
@@ -2667,7 +2670,7 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop)
desktop->clearWaitingCursor();
- g_free(filename);
+ g_free(basename);
g_free(filepath);
}