]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/biblio.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / biblio.C
index 56255fdfddbf1a9bf91c64c753e40c0e5ebd6b61..e689b2213d51d18e43eaca556807f34349f5e17d 100644 (file)
@@ -12,6 +12,8 @@
 #include <config.h>
 
 #include "biblio.h"
+
+#include "Lsstream.h"
 #include "gettext.h" // for _()
 #include "helper_funcs.h"
 #include "Lsstream.h"
 
 #include <algorithm>
 
+using namespace lyx::support;
+
 using std::vector;
 
+
 namespace biblio {
 
 string const familyName(string const & name)
@@ -54,7 +59,7 @@ string const familyName(string const & name)
 
 string const getAbbreviatedAuthor(InfoMap const & map, string const & key)
 {
-       lyx::Assert(!map.empty());
+       Assert(!map.empty());
 
        InfoMap::const_iterator it = map.find(key);
        if (it == map.end())
@@ -78,6 +83,7 @@ string const getAbbreviatedAuthor(InfoMap const & map, string const & key)
        }
 
        string author = parseBibTeX(data, "author");
+
        if (author.empty())
                author = parseBibTeX(data, "editor");
 
@@ -105,7 +111,7 @@ string const getAbbreviatedAuthor(InfoMap const & map, string const & key)
 
 string const getYear(InfoMap const & map, string const & key)
 {
-       lyx::Assert(!map.empty());
+       Assert(!map.empty());
 
        InfoMap::const_iterator it = map.find(key);
        if (it == map.end())
@@ -169,7 +175,7 @@ vector<string> const getKeys(InfoMap const & map)
 
 string const getInfo(InfoMap const & map, string const & key)
 {
-       lyx::Assert(!map.empty());
+       Assert(!map.empty());
 
        InfoMap::const_iterator it = map.find(key);
        if (it == map.end())
@@ -252,9 +258,7 @@ string const escape_special_chars(string const & expr)
        // The '$' must be prefixed with the escape character '\' for
        // boost to treat it as a literal.
        // Thus, to prefix a matched expression with '\', we use:
-       string const fmt("\\\\$&");
-
-       return reg.Merge(expr, fmt);
+       return STRCONV(reg.Merge(STRCONV(expr), "\\\\$&"));
 }
 
 
@@ -265,7 +269,7 @@ struct RegexMatch
        // re and icase are used to construct an instance of boost::RegEx.
        // if icase is true, then matching is insensitive to case
        RegexMatch(InfoMap const & m, string const & re, bool icase)
-               : map_(m), regex_(re, icase) {}
+               : map_(m), regex_(STRCONV(re), icase) {}
 
        bool operator()(string const & key) {
                if (!validRE())
@@ -280,7 +284,7 @@ struct RegexMatch
 
                // Attempts to find a match for the current RE
                // somewhere in data.
-               return regex_.Search(data);
+               return regex_.Search(STRCONV(data));
        }
 
        bool validRE() const { return regex_.error_code() == 0; }