]> git.lyx.org Git - lyx.git/blobdiff - src/LayoutFile.cpp
Cleanup mouse/selection/context-menu interactions.
[lyx.git] / src / LayoutFile.cpp
index 7096cf402f8ee510661da4d5c49597ab1ff22351..0680f33f02386d153a33798675131f5fe4b012eb 100644 (file)
@@ -186,10 +186,12 @@ void LayoutFileList::reset(LayoutFileIndex const & classname) {
 
 
 string const LayoutFileList::localPrefix = "LOCAL:";
+string const LayoutFileList::embeddedPrefix = "EMBED:";
 
 
 LayoutFileIndex 
-       LayoutFileList::addLayoutFile(string const & textclass, string const & path)
+       LayoutFileList::addLayoutFile(string const & textclass, string const & path,
+               Layout_Type type)
 {
        // FIXME  There is a bug here: 4593
        //
@@ -197,7 +199,12 @@ LayoutFileIndex
        // NOTE: latex class name is defined in textclass.layout, which can be 
        // different from textclass
        string fullName = addName(path, textclass + ".layout");
-       string localIndex = localPrefix + fullName;
+       string localIndex;
+       
+       if (type == Local)
+               localIndex = localPrefix + fullName;
+       else if (type == Embedded)
+               localIndex = embeddedPrefix + textclass;
        
        // if the local file has already been loaded, return it
        if (haveClass(localIndex))
@@ -223,9 +230,8 @@ LayoutFileIndex
                                BOOST_ASSERT(sub.size() == 4);
                                // now, create a TextClass with description containing path information
                                string className(sub.str(2) == "" ? textclass : sub.str(2));
-                               string description(sub.str(3) + " <" + path + ">");
                                LayoutFile * tmpl = 
-                                       new LayoutFile(textclass, className, description, true);
+                                       new LayoutFile(textclass, className, localIndex, true);
                                // This textclass is added on request so it will definitely be
                                // used. Load it now because other load() calls may fail if they
                                // are called in a context without buffer path information.