]> git.lyx.org Git - lyx.git/blobdiff - src/LayoutFile.cpp
Try another way to signal a false positive to coverity
[lyx.git] / src / LayoutFile.cpp
index 8cca663c4b6ace8e872ace70304b801e2074afee..ccf2838d119ba2bbbcba9061ebf7a562639ae2cf 100644 (file)
@@ -27,7 +27,6 @@
 #include "support/lassert.h"
 #include "support/lstrings.h"
 
-#include "support/bind.h"
 #include "support/regex.h"
 #include "support/TempFile.h"
 
@@ -44,7 +43,8 @@ LayoutFile::LayoutFile(string const & fn, string const & cln,
                       string const & desc, string const & prereq,
                       string const & category, bool texclassavail) 
 {
-       name_ = fn;
+       name_ = onlyFileName(fn);
+       path_ = fn.rfind('/') == string::npos ? string() : onlyPath(fn);
        latexname_ = cln;
        description_ = desc;
        prerequisites_ = prereq;
@@ -332,7 +332,8 @@ LayoutFileIndex  LayoutFileList::addLocalLayout(
                return string();
 
        LayoutFile * tmpl =
-               new LayoutFile(textclass, class_name, textclass, class_prereq, category, true);
+               new LayoutFile(addName(moved ? oldpath : path, textclass),
+                       class_name, textclass, class_prereq, category, true);
        //FIXME: The prerequisites are available from the layout file and
        //       can be extracted from the above regex, but for now this
        //       field is simply set to class_name + ".cls"