]> git.lyx.org Git - lyx.git/blobdiff - src/BiblioInfo.cpp
Context menu item to add unknown branch (rest of #7643)
[lyx.git] / src / BiblioInfo.cpp
index 470c7ee4f84caf360a5e34a22534c23885fe4682..bc46e17448d9aa7f0d8a048deb3910c521ad14a3 100644 (file)
@@ -169,14 +169,17 @@ docstring convertLaTeXCommands(docstring const & str)
                // unicodesymbols has things in the form: \"{u},
                // whereas we may see things like: \"u. So we'll
                // look for that and change it, if necessary.
+               // FIXME: This is a sort of mini-tex2lyx.
+               //        Use the real tex2lyx instead!
                static lyx::regex const reg("^\\\\\\W\\w");
                if (lyx::regex_search(to_utf8(val), reg)) {
                        val.insert(3, from_ascii("}"));
                        val.insert(2, from_ascii("{"));
                }
+               bool termination;
                docstring rem;
                docstring const cnvtd = Encodings::fromLaTeXCommand(val,
-                               Encodings::TEXT_CMD, rem);
+                               Encodings::TEXT_CMD, termination, rem);
                if (!cnvtd.empty()) {
                        // it did, so we'll take that bit and proceed with what's left
                        ret += cnvtd;
@@ -558,7 +561,7 @@ docstring const BibTeXInfo::getLabel(BibTeXInfo const * const xref,
        Buffer const & buf, string const & format, bool richtext,
        docstring before, docstring after, docstring dialog, bool next) const
 {
-       docstring loclabel_;
+       docstring loclabel;
 
        /*
        if (!is_bibtex_) {
@@ -569,12 +572,12 @@ docstring const BibTeXInfo::getLabel(BibTeXInfo const * const xref,
        */
 
        int counter = 0;
-       loclabel_ = expandFormat(format, xref, counter, buf, richtext,
+       loclabel = expandFormat(format, xref, counter, buf, richtext,
                before, after, dialog, next);
 
-       if (!loclabel_.empty())
-               loclabel_ = convertLaTeXCommands(loclabel_);
-       return loclabel_;
+       if (!loclabel.empty())
+               loclabel = convertLaTeXCommands(loclabel);
+       return loclabel;
 }