summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/filedialogimpl-win32.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-03-15 23:04:21 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-03-15 23:04:21 +0000
commitc540f51dc3ff636b8d3688140e3e4221925d7780 (patch)
tree052ccb727c1be3166b327d28cb810dc569a660c8 /src/ui/dialog/filedialogimpl-win32.cpp
parentExtensions. Float and Int default mode set to minimal. Filters' mode changed ... (diff)
downloadinkscape-c540f51dc3ff636b8d3688140e3e4221925d7780.tar.gz
inkscape-c540f51dc3ff636b8d3688140e3e4221925d7780.zip
automatically enter current filename in windows save as dialog.
Fixed bugs: - https://launchpad.net/bugs/530957 (bzr r10107)
Diffstat (limited to 'src/ui/dialog/filedialogimpl-win32.cpp')
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index b18d5a1bc..4f0978c05 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -1577,6 +1577,17 @@ FileSaveDialogImplWin32::FileSaveDialogImplWin32(Gtk::Window &parent,
{
FileSaveDialog::myDocTitle = docTitle;
createFilterMenu();
+
+ /* The code below sets the default file name */
+ myFilename = "";
+ if (dir.size() > 0) {
+ Glib::ustring udir(dir);
+ Glib::ustring::size_type len = udir.length();
+ // leaving a trailing backslash on the directory name leads to the infamous
+ // double-directory bug on win32
+ if (len != 0 && udir[len - 1] == '\\') udir.erase(len - 1);
+ myFilename = udir.substr(0, udir.find_last_of( '.' ) ); // this removes the extension, or actually, removes everything past the last dot (hopefully this is what most people want)
+ }
}
FileSaveDialogImplWin32::~FileSaveDialogImplWin32()