diff options
| author | bulia byak <buliabyak@gmail.com> | 2009-02-02 15:49:47 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2009-02-02 15:49:47 +0000 |
| commit | 25ee3635d1f38c2e569f57777fd3f72ca5134b3a (patch) | |
| tree | afa1c73d3562421cd88ad5ad8e87883da77f3831 /src/selection-chemistry.cpp | |
| parent | remove mnemonic which does not work anyway (diff) | |
| download | inkscape-25ee3635d1f38c2e569f57777fd3f72ca5134b3a.tar.gz inkscape-25ee3635d1f38c2e569f57777fd3f72ca5134b3a.zip | |
use the same steps to figure out dir for bitmap copy as in export dialog
(bzr r7216)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 9081bbdb2..badf27ecb 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -82,6 +82,7 @@ #include "libnr/nr-convert2geom.h" #include "display/curve.h" #include "display/canvas-bpath.h" +#include "inkscape-private.h" // For clippath editing #include "tools-switch.h" @@ -2516,8 +2517,16 @@ sp_selection_create_bitmap_copy (SPDesktop *desktop) // Imagemagick is known not to handle spaces in filenames, so we replace anything but letters, // digits, and a few other chars, with "_" filename = g_strcanon (filename, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.=+~$#@^&!?", '_'); - // Build the complete path by adding document->base if set - gchar *filepath = g_build_filename (document->base?document->base:"", filename, NULL); + + // Build the complete path by adding document base dir, if set, otherwise home dir + gchar * directory = NULL; + if (SP_DOCUMENT_URI(document)) { + directory = g_dirname(SP_DOCUMENT_URI(document)); + } + if (directory == NULL) { + directory = homedir_path(NULL); + } + gchar *filepath = g_build_filename (directory, filename, NULL); //g_print ("%s\n", filepath); |
