]> git.lyx.org Git - lyx.git/blobdiff - src/support/globbing.C
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / globbing.C
index 61f10d1edf27c4100e396c08855ebb2de9594898..eb25cc50b4f7eb426cd5d024d1ffc8dbd00ddeea 100644 (file)
 
 #include "lstrings.h"
 #include "path.h"
-#include "std_sstream.h"
 
 #include <boost/regex.hpp>
 #include <boost/tokenizer.hpp>
 
-#include "glob.h"
+#include <glob.h>
 
+#include <sstream>
+
+using std::distance;
 using std::ostringstream;
 using std::string;
 using std::vector;
@@ -65,7 +67,7 @@ string const convert_brace_glob(string const & glob)
                pattern += boost::regex_merge(tail, block_re, fmt);
 
                // Increment the iterator to the end of the match.
-               it += std::distance(it, what[0].second);
+               it += distance(it, what[0].second);
        }
 
        return pattern;
@@ -86,7 +88,7 @@ vector<string> const glob(string const & pattern, int flags)
 
 
 vector<string> const expand_globs(string const & mask,
-                                 std::string const & directory)
+                                 string const & directory)
 {
        typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
        boost::char_separator<char> const separator(" ");
@@ -112,8 +114,9 @@ vector<string> const expand_globs(string const & mask,
 
 FileFilterList::FileFilterList(string const & qt_style_filter)
 {
-       string const filter = qt_style_filter.empty() ?
-               _("All files (*)") : qt_style_filter;
+       string const filter = qt_style_filter
+               + (qt_style_filter.empty() ? string() : ";;")
+               + _("All files (*)");
 
        // Split data such as "TeX documents (*.tex);;LyX Documents (*.lyx)"
        // into individual filters.
@@ -134,7 +137,7 @@ FileFilterList::FileFilterList(string const & qt_style_filter)
                parse_filter(string(what[-1].first, what[-1].second));
 
                // Increment the iterator to the end of the match.
-               it += std::distance(it, what[0].second);
+               it += distance(it, what[0].second);
        }
 }