]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't ignore path when prompting for file in SaveAs()
authorJulian Smart <julian@anthemion.co.uk>
Wed, 9 Jan 2008 14:56:22 +0000 (14:56 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 9 Jan 2008 14:56:22 +0000 (14:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/docview.cpp

index 6c364c14382c1dc87e53d38129f4c51fe229055a..7f37a56f550004c905a9ad3929b9ae3cc328b22a 100644 (file)
@@ -298,8 +298,12 @@ bool wxDocument::SaveAs()
 #else
     wxString filter = docTemplate->GetFileFilter() ;
 #endif
+    wxString defaultDir = docTemplate->GetDirectory();
+    if (defaultDir.IsEmpty())
+        defaultDir = wxPathOnly(GetFilename());
+
     wxString tmp = wxFileSelector(_("Save As"),
-            docTemplate->GetDirectory(),
+            defaultDir,
             wxFileNameFromPath(GetFilename()),
             docTemplate->GetDefaultExtension(),
             filter,