Various bug fixes to OGL; wxStripExtension prototype added to filefn.h
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -196,16 +196,28 @@ bool wxDocument::SaveAs(void)
|
||||
|
||||
char *tmp = wxFileSelector("Save as", docTemplate->GetDirectory(), GetFilename(),
|
||||
docTemplate->GetDefaultExtension(), docTemplate->GetFileFilter(),
|
||||
0, GetDocumentWindow());
|
||||
wxSAVE|wxOVERWRITE_PROMPT, GetDocumentWindow());
|
||||
|
||||
if (!tmp)
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
SetFilename(tmp);
|
||||
SetTitle(wxFileNameFromPath(tmp));
|
||||
wxString fileName(tmp);
|
||||
wxString path("");
|
||||
wxString name("");
|
||||
wxString ext("");
|
||||
wxSplitPath(fileName, & path, & name, & ext);
|
||||
|
||||
if (ext.IsEmpty() || ext == "")
|
||||
{
|
||||
fileName += ".";
|
||||
fileName += docTemplate->GetDefaultExtension();
|
||||
}
|
||||
|
||||
SetFilename(fileName);
|
||||
SetTitle(wxFileNameFromPath(fileName));
|
||||
|
||||
GetDocumentManager()->AddFileToHistory(tmp);
|
||||
GetDocumentManager()->AddFileToHistory(fileName);
|
||||
|
||||
// Notify the views that the filename has changed
|
||||
wxNode *node = m_documentViews.First();
|
||||
|
Reference in New Issue
Block a user