Fixed using list of wildcards in filter of wxDocTemplate.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-02-21 19:53:31 +00:00
parent 1557c77b9f
commit 0f30d8e39e
2 changed files with 13 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ All (GUI):
- Added <disabled> XRC tag for wxToolBar elements and <bg> for wxToolBar itself.
- Fixed centering of top level windows on secondary displays.
- Implemented wxDisplay::GetFromWindow() for platforms other than MSW.
- More than one filter allowed in in wxDocTemplate filter.
wxMSW:

View File

@@ -60,6 +60,7 @@
#include "wx/confbase.h"
#include "wx/file.h"
#include "wx/cmdproc.h"
#include "wx/tokenzr.h"
#include <stdio.h>
#include <string.h>
@@ -796,6 +797,17 @@ wxView *wxDocTemplate::CreateView(wxDocument *doc, long flags)
// that of the template
bool wxDocTemplate::FileMatchesTemplate(const wxString& path)
{
wxStringTokenizer parser (GetFileFilter(), wxT(";"));
wxString anything = wxT ("*");
while (parser.HasMoreTokens())
{
wxString filter = parser.GetNextToken();
wxString filterExt = FindExtension (filter);
if ( filter.IsSameAs (anything) ||
filterExt.IsSameAs (anything) ||
filterExt.IsSameAs (FindExtension (path)) )
return true;
}
return GetDefaultExtension().IsSameAs(FindExtension(path));
}