Commit c540f51d authored by Johan B. C. Engelen's avatar Johan B. C. Engelen Committed by Johan Engelen

automatically enter current filename in windows save as dialog.

Fixed bugs:
  - https://launchpad.net/bugs/530957

(bzr r10107)
parent 88a617b7
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment