]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.cpp
Account for old versions of Pygments
[lyx.git] / src / TextClass.cpp
index 615734870dc7d87290e61d6b55b6ac8499989596..612539843f0b2148574d4eb3cb512ce113786e6e 100644 (file)
@@ -463,8 +463,13 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
 
                case TC_INPUT: // Include file
                        if (lexrc.next()) {
+                               FileName tmp;
                                string const inc = lexrc.getString();
-                               FileName tmp = libFileSearch("layouts", inc,
+                               if (!path().empty() && (prefixIs(inc, "./") ||
+                                                       prefixIs(inc, "../")))
+                                       tmp = fileSearch(path(), inc, "layout");
+                               else
+                                       tmp = libFileSearch("layouts", inc,
                                                            "layout");
 
                                if (tmp.empty()) {
@@ -544,9 +549,8 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                        // Either way, we just scan the rest and discard it
                        else {
                                Layout lay;
-                               // false positive from coverity
-                               // coverity[CHECKED_RETURN]
-                               readStyle(lexrc, lay);
+                               // signal to coverity that we do not care about the result
+                               (void)readStyle(lexrc, lay);
                        }
                        break;
                }
@@ -1097,6 +1101,8 @@ bool TextClass::readCiteEngine(Lexer & lexrc)
                                latex_cmd += ichar;
                        else if (mode == StarDesc)
                                stardesc += ichar;
+                       else if (ichar == '$')
+                               cs.hasQualifiedList = true;
                        else if (ichar == '*')
                                cs.hasStarredVersion = true;
                        else if (ichar == '[' && cs.textAfter)
@@ -1416,18 +1422,6 @@ bool TextClass::readOutlinerName(Lexer & lexrc)
 }
 
 
-docstring TextClass::outlinerName(std::string const & type) const
-{
-       std::map<std::string,docstring>::const_iterator const it
-               = outliner_names_.find(type);
-       if (it == outliner_names_.end()) {
-               LYXERR0("Missing OutlinerName for " << type << "!");
-               return from_utf8(type);
-       } else
-               return it->second;
-}
-
-
 string const & TextClass::prerequisites(string const & sep) const
 {
        if (contains(prerequisites_, ',')) {
@@ -1818,7 +1812,7 @@ Layout const & DocumentClass::htmlTOCLayout() const
 string const DocumentClass::getCiteFormat(CiteEngineType const & type,
        string const & entry, bool const punct, string const & fallback) const
 {
-       string default_format = "{%author%[[%author%, ]][[{%editor%[[%editor%, ed., ]]}]]}\"%title%\"{%journal%[[, {!<i>!}%journal%{!</i>!}]][[{%publisher%[[, %publisher%]][[{%institution%[[, %institution%]]}]]}]]}{%year%[[ (%year%)]]}{%pages%[[, %pages%]]}";
+       string default_format = "{%fullnames:author%[[%fullnames:author%, ]][[{%fullnames:editor%[[%fullnames:editor%, ed., ]]}]]}\"%title%\"{%journal%[[, {!<i>!}%journal%{!</i>!}]][[{%publisher%[[, %publisher%]][[{%institution%[[, %institution%]]}]]}]]}{%year%[[ (%year%)]]}{%pages%[[, %pages%]]}";
        if (punct)
                default_format += ".";