]> 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 771a9c49263e0d637534c37b0ed5ac163d011eaa..ccf2838d119ba2bbbcba9061ebf7a562639ae2cf 100644 (file)
@@ -43,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;
@@ -331,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"