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:
@@ -89,6 +89,7 @@ All (GUI):
|
|||||||
- Added <disabled> XRC tag for wxToolBar elements and <bg> for wxToolBar itself.
|
- Added <disabled> XRC tag for wxToolBar elements and <bg> for wxToolBar itself.
|
||||||
- Fixed centering of top level windows on secondary displays.
|
- Fixed centering of top level windows on secondary displays.
|
||||||
- Implemented wxDisplay::GetFromWindow() for platforms other than MSW.
|
- Implemented wxDisplay::GetFromWindow() for platforms other than MSW.
|
||||||
|
- More than one filter allowed in in wxDocTemplate filter.
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -60,6 +60,7 @@
|
|||||||
#include "wx/confbase.h"
|
#include "wx/confbase.h"
|
||||||
#include "wx/file.h"
|
#include "wx/file.h"
|
||||||
#include "wx/cmdproc.h"
|
#include "wx/cmdproc.h"
|
||||||
|
#include "wx/tokenzr.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -796,6 +797,17 @@ wxView *wxDocTemplate::CreateView(wxDocument *doc, long flags)
|
|||||||
// that of the template
|
// that of the template
|
||||||
bool wxDocTemplate::FileMatchesTemplate(const wxString& path)
|
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));
|
return GetDefaultExtension().IsSameAs(FindExtension(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user