use filter index first, then the path to find the correct template
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1364,7 +1364,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
|
|||||||
wxString descrBuf = wxT("*.*");
|
wxString descrBuf = wxT("*.*");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int FilterIndex = 0;
|
int FilterIndex = -1;
|
||||||
|
|
||||||
wxWindow* parent = wxFindSuitableParent();
|
wxWindow* parent = wxFindSuitableParent();
|
||||||
|
|
||||||
@@ -1396,13 +1396,13 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
|
|||||||
|
|
||||||
path = pathTmp;
|
path = pathTmp;
|
||||||
|
|
||||||
// This is dodgy in that we're selecting the template on the
|
// first choose the template using the extension, if this fails (i.e.
|
||||||
// basis of the file extension, which may not be a standard
|
// wxFileSelectorEx() didn't fill it), then use the path
|
||||||
// one. We really want to know exactly which template was
|
wxDocTemplate *theTemplate = (wxDocTemplate *)NULL;
|
||||||
// chosen by using a more advanced file selector.
|
if ( FilterIndex != -1 )
|
||||||
wxDocTemplate *theTemplate = FindTemplateForPath(path);
|
|
||||||
if ( !theTemplate )
|
|
||||||
theTemplate = templates[FilterIndex];
|
theTemplate = templates[FilterIndex];
|
||||||
|
if ( !theTemplate )
|
||||||
|
theTemplate = FindTemplateForPath(path);
|
||||||
|
|
||||||
return theTemplate;
|
return theTemplate;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user