]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed using list of wildcards in filter of wxDocTemplate.
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 21 Feb 2006 19:53:31 +0000 (19:53 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 21 Feb 2006 19:53:31 +0000 (19:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/docview.cpp

index adbf9715dd6d645c89de582dc851d4127dbdcfc1..493d21b9bffe2b11e3e4d6027cf562890f546641 100644 (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:
 
index 86736878ffcae4135a10641d57ccc63c8149ae1c..22fc22e499f1873eac18f512db9625da039a577e 100644 (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));
 }